OFFSET
1,1
COMMENTS
In each round of the game, 1 unit is transferred from one randomly chosen player to another. Players play until they are out of money, so when the first player is out the other two continue to play. The winner is the player who ends up with all n+2 units of money.
LINKS
Pontus von Brömssen, Table of n, a(n) for n = 1..53
Persi Diaconis and Stewart N. Ethier, Gambler’s ruin and the ICM, Statist. Sci. 37 (3) 289-305, August 2022.
Persi Diaconis, Gambler's ruin with k gamblers, slides from talk in the Rutgers Experimental Mathematics Seminar, Fall 2023 Semester, Oct 12, 2023.
Experimental Mathematics, Gambler’s ruin with k gamblers, recording of talk, Vimeo video, Oct 22, 2023.
PROG
(Sage)
from itertools import permutations
def T(n):
nodes = [(i, j) for i in range(n+2) for j in range((n+2-i)//2+1)]
m = len(nodes)
Q0 = {x:{y:0 for y in nodes} for x in nodes}
for x in nodes:
c1 = x+(n+2-sum(x), )
for i, j in permutations(range(3), int(2)):
if c1[i] and c1[j]:
c2 = list(c1)
c2[i] -= 1
c2[j] += 1
y = (c2[0], min(c2[1:]))
if c2[0] != n+2:
Q0[x][y] += n+2-c2[0]
Q0 = matrix(QQ, [list(R.values()) for R in Q0.values()])
s = sum(Q0.columns())
Q = identity_matrix(QQ, m-1)
for i in range(1, m):
for j in range(1, m):
if s[i] != 0: Q[i-1, j-1] -= Q0[i, j]/s[i]
return (Q**(-1)*ones_matrix(QQ, m-1))[-2, 0]
def A366995(n):
return T(n).numerator()
def A366996(n):
return T(n).denominator()
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
Pontus von Brömssen, Oct 31 2023
STATUS
approved