Question 5: [[MA241 Assignment 1.pdf]]. Solution Let $y(n)=\mathcal{P}(300\mid n)$ denote the probability of reaching $N$ dollars on the condition that we currently hold $n$ dollars. Note that $\mathcal{P}(N\mid0) = 0$ and $\mathcal{P}(N\mid N)$ supposing the player plays the game repeatedly until the player either goes broke or increases his holdings to $N$ dollars. Suppose the player has $n$ dollars at the moment, the next round will leave the player with either $n + 1$ or $n − 1$ dollars, both with probability $1/2$ so $y(n) = \frac{1}{2} y(n+1)+ \frac{1}{2} y(n-1) $The corresponding characteristic equation is $x^{2}-2x+1=0\implies(x-1)^{2}=0$ so the recurrence relation has a general solution has the form $y(n) = (A+Bn)\times1^{n} =A+Bn$Note that $y(0)=0$ and $y(300)=1$ so $0=A$ and $1 =300B\implies B=\frac{1}{300}$. Therefore $y(100)= \frac{1}{3}$. iii) Let $y(n)$ denote the probability of reaching $N$ dollars on the condition that we currently hold $n$ dollars. Then $y(n)= p y(n+1) + ( 1- p) y(n-1)$with $y(0)=0$ and $y(N)=1$. The corresponding characteristic equation for this difference equation is $px^{2}-x+1-p=0$ so $x= \frac{1 \pm \sqrt{ 1-4p(1-p) }}{2p}= \frac{1\pm \sqrt{ (1-2p)^{2} }}{2p} \in \left\{ 1 , \frac{q}{p} \right\}.$Note that $p = q \iff p=\frac{1}{2}$ so we get two distinct real roots when the coin is biased. Hence the general solution has the form $ y(n)=A + B \left( \frac{q}{p} \right)^{n} $ Substituting $y(0)=0$ gives $0=A+B\implies A=-B$. Substituting $y(N)=1$ gives $1= A-A\left( \frac{q}{p} \right)^{N}=A\left( 1- \frac{q}{p}^{N} \right)$ So $A = \frac{1}{\left( 1-\left( \frac{q}{p} \right)^{N} \right)}\implies y(n)=$