User:Encryptedsalad/sandbox

Suppose you are betting on some outcome in probability, where any amount bet is doubled if you win the bet, but you lose all of the money you bet if you lose the bet. Given any probability $$k$$ of winning the bet, what is the optimal bet to place as a proportion of how much money you have?

To solve this, I modeled the outcome after a number of bets by multiplying by $$(1+x)$$ for every victory, and $$(1-x)$$ for every defeat, where $$x$$ is the proportion of money bet.

After a large number of outcomes, the proportion of wins will approach the probability of winning $$k$$, while the proportion of losses will approach $$1-k$$

After some $$n$$ outcomes, then, the amount of money you have will approach $$(1+x)^{kn}(1-x)^{(1-k)n}$$, where the value of any individual bet is simply $$(1+x)^k(1-x)^{1-k}$$

Assuming constant $$k$$, you now optimize for the value of $$x$$ by finding the maximum in the interval $$[0,1]$$

$$\frac{d}{dx} ((1+x)^k(1-x)^{1-k}) = -(1 - x)^{-k} (x + 1)^{k - 1} (-2 k + x + 1) = 0 $$ at $$ x=2k-1 $$,

thus the optimal proportion of money to bet given some probability $$k$$ of winning is $$2k-1$$

$$\int_{a}^{b} f'(x)dx = f(a) - f(b) $$