Riddler Express
I have three dice on my desk that I fiddle with while working, much to the chagrin of my co-workers. For the uninitiated, the is a tetrahedron that is equally likely to land on any of its four faces (numbered through ), the is a cube that is equally likely to land on any of its six faces (numbered through ), and the is an octahedron that is equally likely to land on any of its eight faces (numbered through ).
I like to play a game in which I roll all three dice in “numerical” order: , then and then . I win this game when the three rolls form a strictly increasing sequence (such as , but not ). What is my probability of winning?
Extra credit: Instead of three dice, I now have six dice: and . If I roll all six dice in “numerical” order, what is the probability I’ll get a strictly increasing sequence?
Computational solution
From the simulation below, we see that the probability of the winning with and is and the probability of winning with and is .
from random import choice
def prob(dice_num_faces, runs=10000000):
dice = {n:list(range(1, n+1)) for n in dice_num_faces}
cnt_succ = 0
for _ in range(runs):
roll = [choice(dice[d]) for d in sorted(dice.keys())]
cnt_succ += all(i < j for i, j in zip(roll, roll[1:]))
return cnt_succ/runs
print(prob([4,6,8]))
print(prob([4,6,8,10,12,20]))