Q:

Find the distribution from a game

I have been thinking on the following problem during the weekend and I have no idea where to begin.
A player plays the following game: at each step of the game, he can double or divide his portfolio with a probability of $\frac{1- p }{2}$ or lose everything with probability $p$, for $p \in (0, 1)$.
The player's starting wallet is $1$ dollar. Let $X_n$ represent the state of the portfolio after $n$ steps, find:
The distribution of $X_n$ and the possible value of it, $~ \lim_{n \to \infty} P(X_n = 0)$, and $\lim_{n \to \infty} E(X_n = 0)$.

A:

You compute the probability of halving each number of steps.  For example, if there is ever a lose everything, the value is zero.  The chance of having at least one lose everything after $n$ steps is $1-(1-p)^n$.  Now if you assume you didn't lose everything, you have a $\frac 12$ chance at each step to double or cut in half.  If you have $k$ doubles you have a final portfolio of $2^k\cdot \frac 1{2^{n-k}}=2^{2k-n}$  The final distribution is 
$$\begin {array} {r r}\text{value}&\text{probability}\\
0&1-(1-p)^n\\
2^{2k-n}&(1-p)^n{n \choose k}2^{-n}
\end {array}$$
for $0 \le k \le n$

