Tuesday, July 12, 2022

Dice, Simulations, and Math

My friend Andrew Parsons send me this link to an interesting video The unexpected logic behind rolling multiple dice and picking the highest. Now I love simulating dice on the computer. Creating a Die class is one of my favorite projects for teaching objects and classes in programming classes. I’ve long kept example of dice with other than six sides around to help students think outside the six sided dice box. So this video grabbed my interest.

Basically the presenter is looking at what happens if you roll two dice and pick the higher value of the two. What sort of advantage does it provide?.  So this gets into some probability and some related math. One of the first things he does is to look at the problem through a simulation (His Python code is here) OK now I personally would be happy with the simulation but of course that gives one the “what happens” but doesn’t go into why it happens. The math does that. The math is presented in an interesting way if a bit fast for me. I can see it being useful in an algebra or statistics class though. Lots of good math stuff. (Can I say “math stuff?)

For a computer teacher, the things this goes though are ripe for simulation problems though. What is the result for two dice? For three dice? And what about dice with more sides than six? What do you think? Have students watch the video at home and build their own simulations to compare with the mathematical results?

BTW the dice at the top of the post were made with a laser engraver that I have been playing with. Figured dice in binary would be fun.

No comments: