## Math489/889 Stochastic Processes and Advanced Mathematical Finance Homework 5

Due Wed, October 6, 2010
1. Use a fair coin, say a penny, to play a simple coin-flipping game, as described throughout the chapter. Use the chart in the section to record the outcomes of the game. Save your chart as you will use this random record several times later in the course to test and illustrate some of the theorems. Each “gambler” flips the coin, and records a $+1$ (gains \$1) if the coin comes up “Heads” and records $-1$ (loses \$1) if the coin comes up “Tails”. On the chart, the player records the outcome of each flip by recording the flip number, the outcome as “H” or “T” and keeps track of the cumulative fortune of the gambler so far. It is best to keep these records in a neat chart, since we will refer to them later. Each “gambler” should record $100$ flips, which takes about 10 to 20 minutes.

For the homework, to turn in:

1. Record the total number of heads, the total number of tails, and the difference of the number of heads and tails.
2. Record whether the coin flip game reached “victory” $+10$ before reaching $-10$, or “ruin” or conversely reached ruin before reaching “victory”, or reached neither in $100$ flips.
3. Record the number of flips to first reach either $+10$ or $-10$ or state that the game reached neither.
4. Record the total number of flips out of 100, i.e the total time, that the number of Heads exceeded the number of Tails.
1. For ${T}_{0}=10$ and $a=20$, draw a graph of the probability of ruin as a function of the probability $q$. This graph was produced with the Maple command plot(subs(T0 = 10, a = 20, p = 1-q, Ruin), q = 0 .. 1) where the expression Ruin was defined with  Ruin := ((q/p)^a-(q/p)^T0)/((q/p)^a-1)

2. For $a=20$ and $q=0.55$ draw a graph of the probability ruin as a function of ${T}_{0}$. This graph was produced with the Maple command plot(subs(a = 20, p = .45, q = .55, Ruin), T0 = 0 .. 20)

3. For $a=20$ and $q=0.45$ draw a graph of the probability of ruin as a function of ${T}_{0}$. This graph was produced with the Maple command plot(subs(a = 20, p = .55, q = .45, Ruin), T0 = 0 .. 20)

2. A gambler starts with \$2 and wants to win \$2 more to get to a total of \$4 before being ruined by losing all his money. He plays a coin-flipping game, with a coin that changes with his fortune.
1. If the gambler has \$2 he plays with a coin that gives probability $p=1∕2$ of winning a dollar and probability $q=1∕2$ of losing a dollar.
2. If the gambler has \$3 he plays with a coin that gives probability $p=1∕4$ of winning a dollar and probability $q=3∕4$ of losing a dollar.
3. If the gambler has \$1 he plays with a coin that gives probability $p=3∕4$ of winning a dollar and probability $q=1∕4$ of losing a dollar.

Use “first step analysis” to write three equations in three unknowns (with two additional boundary conditions) that give the probability that the gambler will be ruined. Solve the equations to find the ruin probability.

Solution: The first step equations for the ruin are:

$\begin{array}{llll}\hfill {q}_{4}& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {q}_{3}& =\left(3∕4\right){q}_{2}+\left(1∕4\right){q}_{4}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {q}_{2}& =\left(1∕2\right){q}_{1}+\left(1∕2\right){q}_{3}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {q}_{1}& =\left(1∕4\right){q}_{0}+\left(3∕4\right){q}_{3}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {q}_{0}& =1\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{2em}{0ex}}& \hfill \end{array}$

The solution of the equations is: ${q}_{1}=5∕8$, ${q}_{2}=1∕2$, ${q}_{3}=3∕8$.

3. A gambler plays a coin flipping game in which the probability of winning on a flip is $p=0.4$ and the probability of losing on a flip is $q=1-p=0.6$. The gambler wants to reach the victory level of \$16 before being ruined with a fortune of \$0. The gambler starts with \$8, bets \$2 on each flip when the fortune is \$6,\$8,\$10 and bets \$4 when the fortune is \$4 or \$12 Compute the probability of ruin in this game.

Solution: Writing the set of first-step equations:

$\begin{array}{llll}\hfill {q}_{16}& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {q}_{12}& =0.6{q}_{8}+0.4{q}_{16}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {q}_{10}& =0.6{q}_{8}+0.4{q}_{12}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {q}_{8}& =0.6{q}_{6}+0.4{q}_{10}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {q}_{6}& =0.6{q}_{4}+0.4{q}_{8}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {q}_{4}& =0.6{q}_{0}+0.4{q}_{8}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {q}_{0}& =1\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & \phantom{\rule{2em}{0ex}}& \hfill \end{array}$

Rewrite the equations as:

$\begin{array}{llll}\hfill 0.6{q}_{8}-{q}_{12}& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill 0.6{q}_{8}-{q}_{10}+0.4{q}_{12}& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill 0.6{q}_{6}-{q}_{8}+0.4{q}_{10}& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill 0.6{q}_{4}-{q}_{6}+0.4{q}_{8}& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill -{q}_{4}+0.4{q}_{8}& =-0.6\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

In matrix form this is

$\left(\begin{array}{ccccc}\hfill 0\hfill & \hfill 0\hfill & \hfill 0.6\hfill & \hfill 0\hfill & \hfill -1\hfill \\ \hfill 0\hfill & \hfill 0\hfill & \hfill 0.6\hfill & \hfill -1\hfill & \hfill .4\hfill \\ \hfill 0\hfill & \hfill 0.6\hfill & \hfill -1\hfill & \hfill 0.4\hfill & \hfill 0\hfill \\ \hfill 0.6\hfill & \hfill -1\hfill & \hfill 0.4\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill -1\hfill & \hfill 0\hfill & \hfill 0.4\hfill & \hfill 0\hfill & \hfill 0\hfill \\ \hfill \hfill \end{array}\right)\left(\begin{array}{c}\hfill {q}_{4}\hfill \\ \hfill {q}_{6}\hfill \\ \hfill {q}_{8}\hfill \\ \hfill {q}_{10}\hfill \\ \hfill {q}_{12}\hfill \\ \hfill \hfill \end{array}\right)=\left(\begin{array}{c}\hfill 0\hfill \\ \hfill 0\hfill \\ \hfill 0\hfill \\ \hfill 0\hfill \\ \hfill -0.6\hfill \\ \hfill \hfill \end{array}\right).$

The solution is ${q}_{4}=0.90857$, ${q}_{6}=0.85371$, ${q}_{8}=0.77143$, ${q}_{10}=0.64800$, ${q}_{12}=0.46286$.

4. Use the ruin probability notation to show that in a random walk starting at the origin the probability of reaching the point $a>0$ before the random walk returns to the origin is $p\left(1-{q}_{1}\right)$.

Solution: The random walk starts at the origin ${T}_{0}=0$. Consider the case that the first step is to the left, occurring with probability $q$, so that ${T}_{1}=-1$. Then if the walk is ever to reach the goal $a>0$, then the walk must necessarily pass through the origin again. Hence for the walk to reach the goal $a>0$ the walk must first step to the right with probability $p$. Then the walk starts from state one, and we seek the subsequent probability that the walk reaches $a$ before reaching $0$. In our terminology, that is the probability of victory from $1$ before being ruined. That is ${p}_{1}$ or equivalently $1-{q}_{1}$. Hence the combined probability of these two independent events is $p\left(1-{q}_{1}\right)$.