I made up a short computer program that calculates the optimal bet for a power utility function like u(x) = x^(1-A)/(1-A) if A>1, u(x)=ln(x) if A=1.
I have seen it suggested that the optimal Kelly (A=1) bet for a distribution of outcomes f*ri, each with probability pi is
sum(pi*ri)/sum(pi*ri^2)
where f is the fraction of bankroll. You can assume the optimal bet for a particular set of (pi,ri) can be described as a fraction of the bankroll because the utility function has constant relative risk aversion [(u''/u')*u = constant]
This formula is based on a second-order Taylor approximation to ln(1+Q) when -1 sum((pi*ri)/(1+f*ri)^A) = 0
regardless of if A=1 or A>1.
The routine I made uses a numerical solver to find f given the pi's, ri's and A. For blackjack, the approximate formula is very good! The differences in the optimal bets suggested are not practically important due to rounding to the nearest convenient bet size.
Another thing I wanted to look into is the suggestion that if you want to have A = z for z>1, you should find the Kelly (A=1) bet and bet 1/z times the Kelly bet. I went through some math and determined that this approximation appears to be making the following assumption:
ln(1+f*ri) is close to z*ln(1+f*ri/z)
If you linearize ln(1+H) around H=0, you get that intercept = 0 and slope = 1, since ln(1)=0 and d(ln(y))/dy evaluated at 1 equals 1. This means that the "bet 1/z the kelly bet for A=z" approximation depends on a linear approximation to the "ln" function. This can be seen by replacing the "ln" functions with their argument less 1 in the above equation:
f*ri = z*f*ri/z = f*ri
Because the ln function is sub-linear (negative curvature everywhere it is defined) for all values of f*ri, it turns out that the approximation leads to a smaller "optimal f" than the theoretical result.
I believe this is why it is suggested to use a large aversion parameter A and consider your bankroll to be all your wealth in the universe rather than set aside an artificial bank and play that more aggressively.- optimal bet for aversion A is smaller than twice the optimal bet for aversion 2*A. I have seen SBA author Karel Janecek recommend sizing bets to total wealth with a larger value of A, such as 40, rather than playing a smaller part of your wealth to half-Kelly or third-Kelly. This is mentioned in the documentation for SBA as well as in an economics paper by him I read.
The more precise formulas dont necessarily have a great deal of practical importance. They do require knowing the entire distribution of outcomes rather than just the EV and Standard deviation (second moment = EV^2+SD^2).
Comments on the math? Comments on anything else?
-CT COUNTER
The actual equation satisfied by the optimal bet is
The actual optimal bet satisfies the following equation:

