aez-notes
Gambler's Ruin
Player \(M\) has \(\$1\), and Player \(N\) has \(\$2\). Each play gives one of the players \(\$1\) from the other. Player \(M\) is enough better than Player \(N\) that he wins \(2/3\) of the plays. They play until one is bankrupt. What is the chance that Player \(M\) wins?
This is pretty much the same as the previous problem with a different boundary condition.
load(solve_rec)$ p[0] = 0; p[3] = 1; my_deq : p[n] = (2/3) * p[n+1] + (1/3) * p[n-1]; my_sol : solve_rec(my_deq, p[n], p[0] = 0, p[3] = 1); print(ev(my_sol, n = 1)); /* 4 p = - 1 7 */