The casino offers a certain win-lose game, where you have $p$ chance of winning. You can bet any amount of money, and if you win you get twice your bet; otherwise, you lose your bet. If you use the optimal strategy, what is your chance of doubling your money, as a function of $p$?
I came up with the following incorrect solution:
You have a 100% chance of winning if $p>\frac{1}{2}$ and $p$ chance of winning if $p<\frac{1}{2}$. Suppose that $p>\frac{1}{2}$. Then each time you bet exactly half your money. If you have $x$ dollars, you end up with $\frac{3}{2}x$ if you win and $\frac{1}{2}x$ if you lose, hence your expected outcome is $\frac{3}{2} xp + \frac{1}{2}x(1-p)$ which equals $xp + \frac{1}{2}x$. So if $p>\frac{1}{2}$, then the total is greater than $x$.
Given that each game on average gains you money and you can play an arbitrary number of games, of course you should have 100% chance of doubling your money.
Similarly, if $p<\frac{1}{2}$, it can be shown that no matter how much we bet, we lose money on average. Then on average our money will tend to go toward zero, so we're better off just going all-in at the start, with $p$ chance of doubling our money.
I do not understand the proper solution, but I think this solution is incorrect; however, I'm having trouble pinpointing where my proof falls apart. Thanks.
Edit: for reference I've included a screenshot of the given solution.