Your beloved friend Zack has designed you a special variant of snakes and ladders board game which, ironically, has no snakes and ladders! How lovely!
Game rules:
You start from square number 1, your goal is to reach square number 100 by advancing through squares 2 to 99
In each "move", you roll a conveniently designed fair 6-sided dice which has numbers , , , , , on it and advance your token forwards by the same number of squares as indicated by your dice
You do not need to roll the exact number to reach the final square, for example, if you are on square 99 and you roll a 3, you still win the game
Zack didn't bother to put any snakes or ladders, so there's no climbing up or sliding down
No magic teleportation!
What is the expected number of moves needed (correct to 5 significant digits) in order for you to win the game?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Suppose E n is the expected number of moves required to reach square number 1 + n from square number 1, our goal is to find E 9 9 .
Note that the starting square is arbitrary here, so this is exactly equivalent to saying that E n is the expected number of moves required to advance at least n squares.
First and foremost, let's look at some trivial values:
E 0 = 0 , we don't need to do anything to advance 0 squares, we are already at the target square!
E − 1 = 0 , we already went past the target square (it is 1 square behind us), again we don't need to do anything (we define this as this will become useful later on).
E 1 = 1 , no matter what number we roll, we will always advance at least 1 square, the expected number of moves to advance at least 1 square is 1.
Awesome, now that's out of the way, let's think about E n , in order to advance at least n squares, you must either:
Roll a 1 , taking a move, and advance at least n − 1 more squares
Roll a 2 , taking a move, and advance at least n − 2 more squares
Roll a 3 , taking a move, and advance at least n − 3 more squares
Since the probabilities of rolling each number are equal ( = 3 1 ), we thus have, for n ⩾ 2 , E n = 3 1 ( 1 + E n − 1 ) + 3 1 ( 1 + E n − 2 ) + 3 1 ( 1 + E n − 3 ) ∴ 3 E n = E n − 1 + E n − 2 + E n − 3 + 3 ( 1 )
Shift n by 1: 3 E n + 1 = E n + E n − 1 + E n − 2 + 3 ( 2 )
( 2 ) − ( 1 ) ⟹ 3 E n + 1 − 3 E n = E n − E n − 3
∴ 3 E n + 1 = 4 E n − E n − 3
This is a fourth order linear recurrence relation, its characteristic polynomial is 3 r 4 − 4 r 3 + 1 = ( r − 1 ) 2 ( 3 r 2 + 2 r + 1 ) ( look up how to solve linear recurrence relations here ), equating this to 0 and solving this polynomial would yield roots 1 (repeated) and − 3 1 ± 3 2 i = 3 1 e ± i θ , where θ = π − tan − 1 2 , hence a solution to this recurrence relation is in the form E n = ( 3 1 ) n ( c 1 cos n θ + c 2 sin n θ ) + ( c 3 + c 4 n ) ( 1 ) n
Using ( 1 ) to derive E 2 by plugging n = 2 , we get E 2 = 3 4 .
Now with the initial conditions E − 1 = E 0 = 0 , E 1 = 1 , E 2 = 3 4 , we can solve for c 1 , c 2 , c 3 and c 4 . After plugging in n = − 1 , 0 , 1 , 2 , we will get the following system of equations:
⎩ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎧ 3 ( c 1 cos θ − c 2 sin θ ) + c 3 − c 4 = 0 c 1 + c 3 = 0 3 1 ( c 1 cos θ + c 2 sin θ ) + c 3 + c 4 = 1 3 1 ( c 1 cos 2 θ + c 2 sin 2 θ ) + c 3 + 2 c 4 = 3 4
Where, cos θ = cos ( π − tan − 1 2 ) = − 3 1 , sin θ = sin ( π − tan − 1 2 ) = 3 2 , cos 2 θ = 2 cos 2 θ − 1 = − 3 1 , sin 2 θ = 2 sin θ cos θ = − 3 2 2 .
Solving the system of equations above, we have c 1 = − 3 1 , c 2 = 6 2 1 , c 3 = 3 1 , c 4 = 2 1 .
∴ E n = ( 3 1 ) n ( − 3 1 cos n θ + 6 2 1 sin n θ ) + 3 1 + 2 1 n
Finally, to find E 9 9 , all we need to do now is to set n = 9 9 and it would give E 9 9 ≈ 4 9 . 8 3 3 .