# Math Help - Probability and expected number of turns in coin flipping game?

1. ## Probability and expected number of turns in coin flipping game?

Suppose we play a coin game: we flip a coin, upon tails you get one dollar from me, upon heads I get one dollar from you. We repeat this until one of us is broke.

Now, at the beginning of the game, I have $4 and you have$6.

1. What is the chance of me winning the game? (thus ending up with \$10, leaving you broke)

2. What is the expected number of turns we have to take until the game finishes? (i.e. until one of us is broke)

Intuitively I feel the answer to Q1 should be $\frac{4}{10}$, but I can't seem to calculate this properly. No idea how to approach Q2. I can see that $\mathbb{E}(T_0) = \mathbb{E}(T_{10}) = 0$ and $\mathbb{E}(T_4) = 1 + \frac{1}{2}\mathbb{E}(T_3) + \frac{1}{2}\mathbb{E}(T_5)$ (with $T_n$ being the number of turns from a game situation where I have n dollar) but I don't know how to resolve this to a definite result.

3. ## Re: Probability and expected number of turns in coin flipping game?

Thanks, didn't know the right term for this kind of problem. But unfortunately that doesn't help me much. Well it does confirm the probability is indeed 4/10, but it doesn't really explain how to calculate this. The linear homogenous recurrence relation mentioned by wikipedia is exactly where I'm stuck at.

Would anyone happen to know how to prove that $p_k=\frac{k}{n}$ when given $p_0=0\ ,\ p_n=1\ ,\ p_k=\frac{1}{2}(p_{k-1}+p_{k+1})$ ?

4. ## Re: Probability and expected number of turns in coin flipping game?

The auxiliary equation associated with the recurrence is:

$r^2-2r+1=0$

$(r-1)^2=0$

With the root r = 1 of multiplicity 2, we know $p_n$ will take the form:

$p_k=k_0+k_1\cdot k$

Using $p_0=0$ we find $k_0=0$ and using $p_n=1$ we find:

$k_1=\frac{1}{n}$

Thus:

$p_k=\frac{k}{n}$

5. ## Re: Probability and expected number of turns in coin flipping game?

Awesome, thank you very much!

In the mean time I found a less sophisticated solution myself:

$p_k = \frac{1}{2}(p_{k-1}+p_{k+1})$ means $p_{k+1}=2p_k-p_{k-1}$

Let's say $p_1=x$, and we already know that $p_0=0$, so we can say $p_k=kx\ \forall\ k\leq 1$.

Then also $p_{k+1}=2p_k-p_{k-1}=2kx-(k-1)x=(k+1)x$, and therefore (by induction) we have $p_k=kx\ \forall\ k\leq 10$.

Since $p_{10}=1$, we have $x=1/10$ so $p_k=k/10$.

6. ## Re: Probability and expected number of turns in coin flipping game?

Just in case, similar to my own method for Q1, for Q2 I found $\mathbb{E}(T_{k+1})=2\mathbb{E}(T_k)-\mathbb{E}(T_{k-1})-2 \Longrightarrow \mathbb{E}(T_k)=k(10-k)$ so $\mathbb{E}(T_4)=24$.

I'm not too familiar with that auxiliary equation method so I'll get my head around that, as it seems much more powerful in situations like these.