There is an advantageous bet that you can repeat forever. If you bet x amount, one of 3 things can happen:
a) Win w*x with probability p=.59375, where w = .42174
b) Lose L*x with probability q=.395833, where L = .272
c) Lose x with probability r=.010417
I tried to answer this: what % (call it f) of your bankroll should you wager each time to maximize expected growth (or median future wealth)?
My attempt:
g = (1+.42174f)
.59375 * (1-.272f)
.395833 * (1-f)
.010417
Numeric optimization in R:
Code:
kelly = function(p,w) {
fn = function(f,p,w) prod((1+f*w)^p)
optimize(fn,p=p,w=w,lower=0,upper=1,maximum=TRUE,tol=.Machine$double.eps)$maximum
}
w <- c(.42174, -.272, -1)
p <- c(.59375, .395833, .010417)
paste(kelly(p,w))
Result: 0.793143075975138
My own optimization algorithm in Julia:
Code:
@fastmath function kelopti(p::Float64, r::Float64, w::Float64, L::Float64, firstep=1/16)
q = 1-p-r
f, g, step, upper = 0.0, 0.0, firstep, 1.0
while(true)
newf = f+step
while(true)
(0 ≤ newf ≤ upper) ? break : step/=2
newf = f+step
end
newg = (1+w*f)^p * (1-L*f)^q * (1-f)^r
if newg ≤ g
step /= -2
step==0.0 && return f
end
f = newf
g = newg
end
end
kelopti(.59375, .010417, .42174, .272) = 0.7931431029303357
But f can't be >p, can it? So I tried an analytical solution. I took the derivative of ln(g), set it to 0 and used Sagemath to solve for f:
f = {Lpw + Lp + Lqw + w - L - qw - √[(qw + L - Lp - Lpw - Lqw - w)² - 4Lw(p + q + pw - Lq - 1)] } / (2Lw)
which gives an answer of 0.7931430966114893
Lastly, I tried a random simulation but same result.
It appears that all roads point to f>p, but how in the hell can that be? I can't bring myself to believe it, but I also don't know where my mistake is. My guess would be the growth equation, but if so, I have a fundamental misunderstanding of growth.
Here's why I refuse to believe f>p. When there are only 2 possible outcomes, the kelly equation is f = p - (1-p)/w. Here, if you remove Outcome C, observe that the kelly stake will be smaller than p:
p' = p/(p+q) ≈ .6
w' = w/L ≈ 1.5505
f' = .6 - .4/1.5505 =
.342
The effect of inserting a 3rd outcome
worse than B should be to
decrease f, not increase it.
Can someone explain what's going on? Tyvm