Kelly bet question

financeprobabilityprobability distributions

I stumbled upon Kelly bet during studies and decided to try simulating it. I chose a simple example where $b = 1$ and $p = 0.6$, which gave me the Kelly bet equal to $0.2$ of the wealth. I took $25$ dollars as a starting wealth and did $10000$ simulations of a $300$ bet game with $11$ possible bets including the Kelly bet, starting from $0$ (yeah, I did get $25$ average in the end, just wanted to make sure my program worked) with increment $0.1$ up to $1.0$ of starting wealth (i.e. full $25$ bet from the get go)

The resulting wealth turned out to be abit unintuitive to me: here is the list of wealths for each bet, i.e $25.0$ is for the bet = $0$ of starting wealth, $9789.283$ is for bet = $0.1$ of starting wealth.

[$25.0, 9789.283, 4322833.16, 68980116.885, 1665088721.462, 92284022.736, 19489.665, 0.012, 0.0, 0.0, 0.0$]

Kelly bet corresponds to $4322833.16$, whichis not the max value for the given bets. It turned out that $0.5$ is the best and $0.2$ is not even close.

Why is it like that? Could someone show an intuitive or direct mathematical reason for this or give me some hints.

Thank you very much

edit: added code in python

import random

N = 300
x = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
b = 1
p = 0.6 
Iter_cnt = 10000

wealthlist = []
win_rate = 0

def gamble(bet_ratio, prob, win_multi, totalbets):
    wealth = 25
    wincnt = 0
    for i in range(totalbets):
        rnd = random.uniform(0, 1) #random real in (0, 1)
        if rnd >= 1 - prob: #if win
            wincnt += 1
            wealth *= 1+win_multi*bet_ratio 
        else: #if lose
            wealth *= (1-bet_ratio)

    return (wealth, wincnt/totalbets) #return of a tuple with 1st argument being equal to resulting wealth and 2nd argument equal to the ratio for this simulation

avg_res_1bet = 0
avg_wr = 0

for i in x: #iterate over the list of betting ratios
    for j in range(Iter_cnt): #iterate as many times as the value of Iter_cnt 
        avg_res_1bet += gamble(i, p, b, N)[0]/Iter_cnt #calculates the average result for each of the betting ratios
        avg_wr += gamble(i, p, b, N)[1]/(Iter_cnt*len(x)) #calculates the average winrate of all simulations

    wealthlist.append(round(avg_res_1bet,3)) #adds the resulting wealth to the final list, rounded to 3 decimals
    avg_res_1bet = 0 #have to nullify in order to make the above command work properly


print("Sample win ratio is: {}".format(avg_wr)) #output
print("Final wealth is: {}".format(wealthlist)) #output

Best Answer

I think there must be something wrong with your program. I wrote a python script to try to duplicate your results, and $20\%$ consistently comes out best. Here's my script:

from random import random, seed

seed()
frac = [k/10 for k in range(11)]
bankrolls = 11*[25]
wins = 0
for _ in range(300):
    bets = [f*b for (f,b) in zip(frac, bankrolls)]
    win = random() <= .6
    if win:
        wins += 1
        bankrolls = [r+b for (r,b) in zip(bankrolls, bets)]
    else:
        bankrolls = [r-b for (r,b) in zip(bankrolls, bets)]

print(wins, "wins")
for idx, b in enumerate(bankrolls):
    print(idx, b)

Here is sample output:

178 wins
0 25.0
1 1525.5418231115136
2 4668.530690514337
3 605.0866915333761
4 2.2038544365635504
5 0.00010387825597102039
6 1.5227053142812533e-11
7 4.2329300312072035e-22
8 3.648424706789544e-39
9 1.0377218907500444e-71
10 0.0

EDIT

I can't find an error in your code, but both our scripts are rather silly. If you start with a bankroll of $B,$ win $W$ times and lose $L$ times, then your bankroll at the end is $B(1+r)^W(1-r)^L$ where $r$ is the percentage you bet each hand. There is no need to do simulations.

You can experiment and see that the ending bankroll is highly sensitive to $W$. With $r=.2,$ an initial bankroll of 25, and $300$ total bets, $W=170$ gives an ending bankroll of $182.16,$ and $W=190$ gives an ending bankroll of $605724.76.$ (Note that the standard deviation of the number of wins is $\sqrt{72}\approx8.5$ so these are not outlandish outcomes.)

I think the flaw in your program is that you are running different simulations for each betting rate. Since the number of wins is not the same for the various regimes, the outcome aren't comparable.

It would be more informative to simply make a table comparing the ending bankroll for different betting ratios and numbers of wins.

Thank you for posting this question. I'd never heard of the Kelly bet before. I'd be interested to know if there are studies taking the probability of ruin into account. For example, if the bettor is a bank or an insurance company say, and it has a string of losses, its reserves will fall below the statutory minimum long before it loses all it capital, and the appropriate regulatory authority will shut it down. How should this be reflected in choosing the optimum bet? For an individual gambler, it's easy to say, "When you've lost all can afford to, go home," but a financial institution can't do that.

Related Question