Coin tosses until doubling amount Two friends are playing the following game:
The first player named A has an initial amount of M dollars. By tossing a fair coin once, he bets 1 dollar and if he gets heads, player B gives him 1 dollar, while if he gets tails, A gives his 1 dollar to B. The game ends when A doubles his money or when he loses it all. What is the probability he doubles his money?
OK at the first coin toss he starts with M dollars and bets 1. With probability 1/2 he now has M+1 and with probability 1/2 he has M-1. At the second round, he bets another dollar and with probability 1/2 he has M+2 and with probability 1/2 he has M-2 and so on. Since the events are independent, the total probability of winning each time is 1/2*1/2 etc.
How do we calculate the total probability?
I clarify that each time he bets only 1 dollar.
 A: If we can supose that he has a finite amount of dollars, then both cases have probability $\frac{1}{2}$. 
You can think this as the random walk problem.
Edit: It's clear that both cases have equal probability, by the argument that stated Zubin Mukerjee on the comments. We only need to use that the probability to be playing the game forever is zero, in order to be able to claim that the probability is  exactly $\frac{1}{2}$.
A: This game has a specific name. That called Gambler's ruin. 
Let $P(x)$ be the probability that A wins the game with $x$ dollars. It's clear that $P(2M) = 1$, $P(0) = 0$ and $P(x) = \frac{1}{2}P(x-1) + \frac{1}{2}P(x+1)$.
By some algebraic work on $P(x) = \frac{1}{2}P(x-1) + \frac{1}{2}P(x+1)$, we have $P(x+1) = 2P(x) - P(x-1)$. 


*

*$P(2) = 2P(1) - P(0) = 2P(1) - 0 = 2P(1)$ 

*$P(3) = 2P(2) - P(1) = 2\times2P(1) - P(1) = 3P(1)$

*$P(4) = 2P(3) - P(2) = 2\times3P(1) - P(2) = 4P(1)$

*...


$\Rightarrow P(x) = xP(1)$ and we know that $P(2M) = 1 \Rightarrow P(2M) = 2M\times P(1) = 1 \Rightarrow P(1) = \frac{1}{2M}$
Thus, the probability of winning A with $M$ initial dollars is $P(M) = M\times P(1) = M \times \frac{1}{2M} = \frac{1}{2}$ 

Here, I explain more about $P(x)$. By a simple use of Total Probability Theorem, we have 
$P(x) = P(x|\text{A wins in the last round})\times P(\text{A wins in the last round}) + P(x|\text{A looses in the last round})\times P(\text{A looses in the last round}) = \frac{1}{2}P(x|\text{A wins in the last round}) + \frac{1}{2} P(x|\text{A looses in the last round}) = \frac{1}{2}P(x+1) + \frac{1}{2}P(x-1)$
A: As others have said, the probability of doubling your money is $\frac{1}{2}$ due to symmetry arguments.  The probabilities of winning or losing $1 in one bet are equal; the patterns of individual wins and loses that leads to doubling your money are mirror images of equally likely patterns that lead to you losing it all. Another way to see that is that the game is symmetric and fair between the two players.  If they both start with M then when one has doubled his money, the other has lost it all.
You can perform detailed calculations if you wish but they will be fairly messy.
Fewer than $M$ bets and obviously the game cannot be complete.  
Exactly $M$ bets and it could be complete.  Fairly obviously, the probability of having doubled your money is $\frac{1}{2}^M$ and losing all is the same.  Unless $M = 1$, these will not add up to $1$ as they will be a probability that the game is not complete.  
A game of length $M + 1$ is not possible.  $M + 1$ wins will overshoot your target and you should have stopped.  $1$ loss will mean that you have only reached $M - 1$ and you should not stop yet.  
A game of length $M + 2$ is possible: $M + 1$ wins and $1$ loss which was any time except the last two.  The probability of this with a particular point for the loss is $\frac{1}{2}^{M+2}$ but there are $M$ occasions on which the loss could occur so a game of length $M + 2$ has probability $M \times \frac{1}{2}^{M+2}$. 
To get a full answer, you could work a few more cases, guess a pattern to the answers and then prove that by induction.  
Expanded explanation of my symmetry idea.  
Suppose that you start with $\$3$ so the game will end when you reach $\$6$ or $\$0$.  These patterns of individual wins and loses (any many more) will bring you to $\$6$.  
Length 3: WWW.  Probability $\frac{1}{2}^3$.  
Length 4: None
Length 5: LWWWW, WLWWW, WWLWW.  All probability $\frac{1}{2}^5$.  
Length 6: None
Length 7: LLWWWWW, LWLWWWW, WLWLWWW, and many more. All probability $\frac{1}{2}^7$.  
Etc.
Now swap all of the Ws and Ls.  You will get another set of patterns with the same probabilities but these will lead to $\$0$.  
For every pattern of wins and loses that leads to doubling your money, there is an equally likely pattern that leads to losing it all (and vice versa).  
As some have commented, if you score it slightly differently and track how much up or down you are then the game ends at $+M$ or $-M$ and the symmetry should be more obvious.  
Also considering playing debt notes rather than dollar bills so that the effect of passing the "winnings" is reversed.  The probability of winning with anti-money will be the same as losing with regular money.  
