The Chase is a game played with two dice and an even number
of players.
The players sit around a table; the game begins with two opposite
players having one die each. On each turn, the two players with a die
roll it.
If a player rolls a , he passes
the die to his neighbour on the left; if he rolls a , he passes the die to his neighbour on
the right; otherwise, he keeps the die for the next turn.
The game ends when one player has both dice after they have been
rolled and passed; that player has then lost.
In a game with players, what
is the expected number of turns the game lasts?
Give your answer rounded to ten significant digits.
N = 100 con = [1, 8, -18, 8, 1] M = N >> 1 b = [-36] * M + [0] a = [] for i inrange(M): t = [0for _ inrange(M + 1)] for j inrange(5): x = i + j - 2 t[min(x % N, -x % N)] += con[j] a.append(t) a.append([0] * M + [1]) x = np.linalg.solve(a, b) ans = x[0] print("{:.6f}".format(ans))