Q. 3.19

Question

Consider the gambler’s ruin problem, with the exception that A and B agree to play no more than n games. Let Pn,idenote the probability that A winds up with all the money when A starts with i and B starts with N-i. Derive an equation for Pn,i in terms of Pn-1,i+1 and Pn-1,i-1, and compute P7,3N=5

Step-by-Step Solution

Verified
Answer

Value of P7,3 in terms of Pn-1,i+1 and Pn-1,i-1 is P7,3=p2+2p3q+5p4q2

1Step1: Recursive probability

Computing factorials could be famous example of recursive programming. 

A number's factorial is calculated by multiplying it by all the numbers below it, up to and including one.

2Step2: Find P 7 , 3


The recursive relation is like this,

Pn,i=0,  i=0 or n<N-i

       =1,     i=N

       =pPn-1,i+1+qPn-1,i-1     other cases

where q=1-p is that the chance that A will win the round, and p is that the likelihood that A will win the round?

Find P7,3 with N=5,

P7,3=pP6,4+qP6,2


=p2+pqP5,3+pqP5,3+q2P5,1

=p2+2pqP5,3+q2P5,1

=p2+2p2qP4,4+2pq2P4,2+pq2P4,2

=p2+2p2qP4,4+3pq2P4,2

=p2+2p3q+2p2q2P3,3+3p2q2P3,3

=p2+2p3q+5p3q2P2,4

=p2+2p3q+5p4q2