Posts

My favorite mathematical card trick

Image
I learned this card trick in the fourth grade, decades ago, before the World Wide Web existed. I have never seen it written about, and anyone to whom I have shown it has never seen it either. This is surprising given how long I've known this trick. Did a brilliant classmate (or a parent) invent it? I'd love to know the origin. This is a mathematical card trick. Meaning, there is no sleight of hand, no actual trickery, just manipulation of playing cards that gives a surprising, final result. You can find many examples of mathematical card tricks on the internet; some of them appear downright magical and quite impressive. What the audience sees Here is how this trick appears to the audience. It looks like many steps, but they are easy to remember after you've practiced the trick even once: Starting with a deck of 52 cards (no jokers), you ask a volunteer from your audience shuffle the deck. You deal out the cards into seemingly arbitrary face-up piles, handing t

Legitimate uses of loaded dice

Image
This is why, as a game master / dungeon master (DM), I would never allow a player to bring 3D printed dice to a game. However, I would supply them to players, for certain purposes. In this article I examine the characteristics of "most fair" and "most unfair" designs of d20 dice, which I made in a CAD program and 3D printed for experiments. A fair and balanced d20 (white), a d20 biased to 20 (bronze, with the ☺ on the 20 face), and a d20 biased to 1 (purple, with the F for "fail" on the 1 face). A d20 is a twenty-sided icosahedron with faces numbered from 1 to 20. In the game Dungeons and Dragons , the d20 is ubiquitous. It determines success or failure of an action. It is the first thing rolled any time a player takes an action. The result of the d20 roll, with some modifiers added based on the player's character abilities and skills, determines whether the player's action succeeds or fails, with appropriate consequences. Advantage a

Simulating erosion

Image
I decided to create a procedurally-generated 3D landscape in a CAD program, and wrap it around a globe, which led me to an investigation of erosion algorithms. I include a JavaScript erosion demo at the end of this article for you to play with. As an aside, let me say that I like OpenSCAD in spite of its idiosyncrasies. Other CAD programs can do many things that OpenSCAD can't, but OpenSCAD is the only 3D modelling software I know of that makes it easy to create procedural or algorithmic parametric designs. It runs on all my computers: Windows, macOS, and Linux — and it's freeware. Its main idiosyncrasy is that it uses a declarative language that requires familiarity with functional programming , a different programming mindset in which all values are evaluated at compile-time instead of run-time, meaning that all "variables" are effectively constants. Even so, one still has conditional branching, looping, and recursive functions, so one can get stuff done. For exa

Bollinger Band prediction

Image
The Bollinger Bands plot on a price bar chart is a common component of technical analysis among financial traders. Bollinger Bands display a graphical envelope around the moving average of price, with the width of the envelope representing volatility of the financial instrument charted. Exchange-traded fund SPY showing 20-day moving average (cyan centerline) and 2-standard-deviation Bollinger Bands (red), as charted by TradeStation 10. Traders sometimes use Bollinger Bands for trading signals; for example, if a stock price crosses outside of the 2-standard-deviation envelope, buy or sell the stock. This is fine for signaling market orders, but if you want to set an intra-day stop order or a limit order at a specific price based on a Bollinger Band, you don't know where that price will be, because the band changes size during a single price bar as price moves in the range of the bar. Not only does the moving price affect the value of the moving average, but it also affec

Building the strandbeest

Image
Some years ago I visited the Exploratorium in San Francisco, where I saw an impressive work of kinetic art, a large mechanical contraption with many articulated legs made from PVC pipe. It walked easily when gently pushed. Kids would take turns in groups pushing it back and forth in a parking lot. This was my first exposure to a strandbeest (Dutch for "beach beast"), a name given by the artist Theo Jansen to his walking kinetic sculptures. The link in the previous sentence has a good video showing how easily the mechanism walks. It looks almost alive. Theo Jansen has built huge strandbeesten powered by wind that walk down beaches while waving or spinning parts of themselves in the breeze. Click here to skip down to assembly instructions 3D printing a strandbeest Leg proportions for Theo Jansen's strandbeest. When we got a 3D printer in our home, I began thinking about how I would build one of these mechanisms myself. I found a few attempts already publish

Syncing Office 365 Outlook to Google calendar using Power Automate

Image
When my employer switched over from the Google office suite to Microsoft's Office 365, it caused unexpected disruption in my family. I had been sharing my work calendar with my wife (sharing no details, just busy times). It became an integral part of her calendar, to help her coordinate (between her job and my job) who picks up and drops off my son from school, and to let her know when I was free to take a phone call during my work day. Since the switchover to O365, my ability to share a calendar externally was eliminated. Based on documentation I could find, it should be possible, but the option doesn't appear in my employer's implementation of Outlook. I can view my personal Google calendar in my work Outlook calendar, but I can't share it the other way. Microsoft's Power Automate provides a way to solve this problem. It lets you create flows of data, triggered manually or automatically by events, to move data around, not only among the Microsoft products but

Popular posts from this blog

Syncing Office 365 Outlook to Google calendar using Power Automate

The water rocket: Thrust from water

New approach to screw threads in OpenSCAD