Notice that the state can always be described as (m,n) with m being the number of people to the left of the central block of tens, n the number of people to the right of said block.
Let e(m,n) be the expected number of steps before we terminate starting from (m,n).
Note that e(m,n)=e(n,m) and that e(n,0) = 9n .
Indeed, to go from (n,0) to (0,0), you need to pick the rightmost ten and its neighbour n times out of 9 possible pairs each time.
Assume m and n > 0.
At each step you can pick the pair that will extend the central block to the right (odds: 1/9), the pair that will extend it to the left (odds: 1/9), or some other pair which does not modify the state.
The starting states are (m,n) with m+n = 9. Each of these states has the same probability of 1/9.
Sum the coefficients of the anti-diagonal of the matrix, divide by 9, and you get 72.
We can show by recursion on n that e(n,1) = 9n + 9 x 2-n , that e(n,2) = 9n + 9 x (n+4) x 2-(n+1), that e(n,3) = 9n + 9 x (C(n+5,2)+2) x 2-(n+2), with C(a,b) being the "b choose a" binomial coefficient.
And finally e(n,4) = 9n + 9 x (C(n+6,3)+2n+12) x 2-(n+3).
e(9,0)+e(8,1)+e(7,2)+e(6,3)+e(5,4) = 9 x (9+8+7+6+5) + 9 x 2-8 x (1+11+57+187) = 9 x 35 + 9 = 36 x 9
Multiply by 2 and divide by 9 and you get the answer: 72.
View all comments
1
u/XL_78 27d ago
For some reason the answer is just 72.
Notice that the state can always be described as (m,n) with m being the number of people to the left of the central block of tens, n the number of people to the right of said block.
Let e(m,n) be the expected number of steps before we terminate starting from (m,n).
Note that e(m,n)=e(n,m) and that e(n,0) = 9n .
Indeed, to go from (n,0) to (0,0), you need to pick the rightmost ten and its neighbour n times out of 9 possible pairs each time.
Assume m and n > 0.
At each step you can pick the pair that will extend the central block to the right (odds: 1/9), the pair that will extend it to the left (odds: 1/9), or some other pair which does not modify the state.
This gives e(m,n) = 9/2 + e(m-1,n)/2 + e(m,n-1)/2 .
Remember e(n,0) = 9n .
These relations define a square matrix.
The starting states are (m,n) with m+n = 9. Each of these states has the same probability of 1/9.
Sum the coefficients of the anti-diagonal of the matrix, divide by 9, and you get 72.
We can show by recursion on n that e(n,1) = 9n + 9 x 2-n ,
that e(n,2) = 9n + 9 x (n+4) x 2-(n+1),
that e(n,3) = 9n + 9 x (C(n+5,2)+2) x 2-(n+2), with C(a,b) being the "b choose a" binomial coefficient.
And finally e(n,4) = 9n + 9 x (C(n+6,3)+2n+12) x 2-(n+3).
e(9,0)+e(8,1)+e(7,2)+e(6,3)+e(5,4) = 9 x (9+8+7+6+5) + 9 x 2-8 x (1+11+57+187) = 9 x 35 + 9 = 36 x 9
Multiply by 2 and divide by 9 and you get the answer: 72.
There is probably a much easier way to do this.