# expected value of money for coin toss

I play the following game using a coin that lands heads with probability $$p$$. I start with $$X_0$$ = $$1$$ and at each stage I gamble all I have on the toss of the coin. If it lands heads I end up with twice what I started with; if it lands tails I lose everything. All coin tosses are independent.

(1) With $$X_n$$ denoting how much money I have after the nth toss, find $$E[X_{n+1}|X_n = k]$$ in terms of k. (2) Find $$E[X_n]$$ for all $$n$$.

My attempt at solution:

(1) If we know that $$X_n = k$$, and the $$n+1$$ toss will be either H or T with probability $$p$$ and $$1-p$$ respectively, that means Xn+1 will be either 2k or 0 respectively. So $$E[X_{n+1}|X_n = k] = (p)(2k) + (1-p)(0) = 2pk$$

(2) Not sure if I have the right thought process but $$E[X_n] = 2p(X_{n-1})$$ because there's a $$p$$ probability of doubling $$X_{n-1}$$ and $$1-p$$ probability of getting $$0$$. So using the same logic as in (1), it would be $$2p(X_{n-1})$$.

I think my reasoning for (2) is correct, but I'm not sure if that's the final answer.

Your both answers are correct (ignoring the abuse of notation in the second part that $$E[X_n]$$ cannot be equal to $$2p X_{n-1}$$ since $$X_{n-1}$$ is random, but $$E[X_n]$$ is not).

For (1), you've already written the correct solution. For (2), we'll just use Law of Iterated (Total) Expectation: $$E[X_n]=E[E[X_n|X_{n-1}]]=E[2pX_{n-1}]=2pE[X_{n-1}]$$ Going towards $$n=0$$, we have: $$E[X_n]=2pE[X_{n-1}]=(2p)^2E[X_{n-2}]=\ ...\ =(2p)^nE[X_0]=(2p)^n$$

I can suggest another solution for the second part by the way:

In $$n$$-th toss, you'll have either $$2^n$$ dollars or $$0$$ dollars. And, you'll get $$2^n$$ only if your all tosses are success, i.e. with probability $$p^n$$. In any other case, i.e. $$1-p^n$$, you'll get $$0$$ dollars. So, the expectation will be $$p^n2^n+(1-p^n)0=(2p)^n$$.