Gambles are independent, and each one results in the player being equally likely to win or lose 1 unit. Let W denote the net winnings of a gambler whose strategy is to stop gambling immediately after his first win.
Find P(W < 0).
I am not sure how to calculate the probability for this. I know that P(W > 0) is 1/2.
Find E[W] How does it equal 0?
P(W > 0) is 0.5 because there is a 0.5 chance the player will win on their first gamble and stop with a net profit.
P(W = 0) is 0.25 because there is a 0.5 chance the player will lose on their first gamble, then also a 0.5 chance they will win on their second gamble and stop with a profit of 0.
All other combinations of gambles result in a net loss, so P(W < 0) = $1 - $P(W > 0)$ - $P(W = 0)
The expected value can be obtained by summing the products of each profit and the probability of that profit. In this case, you have $1 * 0.5 + 0 * 0.25 + (-1) * 0.125 + (-2) * 0.0625$, etc. So your E(W) is the sum $$\sum_{n=0}^{\infty}{\frac{1-n}{2^{n+1}}}=0$$