Q:

gambling probability problem

We are given a fair coin. We start out with 5 dollars. We keep tossing the coin. If the outcome is different than the previous one, we are awarded another 5 dollars. However, we do not get anything if the outcome is the same as the previous one. Let's say we toss the coin X times in the long run. How much do we expect to have in the end?

A:

Given the current state: time $n\geq 0$ and the amount of money $5x$ dollars, the probability that we have $5(x+1)$ at the next step is the same as the probability that we stay with $5x$, and of course both are $\frac12$. So as Hagen has mentioned, your expected profit is
$$
  5+\mathsf E\sum_{i=0}^X \xi_i = 5\left(1+\frac X2\right).
$$
since $\xi_0 = 0$ and $\xi_i$ takes values $\{0,5\}$ equiprobable.

