PDA

View Full Version : Kelly Betting Simulator


highnote
10-12-2006, 01:23 AM
I wrote a Kelly Betting Simulator so you can see how Kelly Betting does versus Flat Betting.

The objective function of Kelly Betting is to maximize the long run rate of growth of your wealth. You can see from the simulation that Kelly outperforms Flat Betting by a large margin.

Download the attachment and unzip it.

Run the .exe program.

Try these parameters:

Betting wealth = 1000
Number of trials = 1000
Estimated probability of winning = 53 ------- NO DECIMAL POINT NEEDED
Cost of bet per dollar dividend = 1.1 ------------- I think it is correct that in Vegas you have to wager $11 to get $10 on a sporting event, right?

If you are getting 2-1 odds then change "Cost of bet..." to 0.50.

Click the Kelly button and the "Odds to 1 being offered" will fill in automatically and the result will appear in the far left column. You can keep hitting the Kelly button to run more trials.

Now enter $40 into the box labeled "Flat Bet Size" and click "Flat Bet" button. You will almost never lose money after 1000 bets. You might be behind after 1000 bets with Kelly.

I think the highest final wealth I ever saw with Flat Bet was $7,000. I saw amounts much greater than $7,000 with Kelly I've seen final wealth be over $1,000,000 with Kelly.

If you do 10,000 trials the results of Kelly versus Flat are amazingly different. Kelly is many order of magnitudes better than flat betting.

If you want more security you can change the Kelly fraction to say .5 or .3. BE SURE TO USE A DECIMAL POINT.

Check the "Show all bets" box if you want to see each bet displayed.

Note: if you check "Show all Bets" and you run 10,000 trials it might take awhile to finish. I don't know what the limit for the number of lines that can be displayed in the text box is.

Click "Clear Values" to erase the Betting result boxes. This will not clear the parameter boxes.

Hope you find this informative.

John

PS

This program and formulations are correct to the best of my knowledge. Let me know if you find errors. Thanks.

highnote
10-12-2006, 02:50 PM
An overflow error probably means there is a negative expected value.

I'll try to fix that and upload a new version. Start with the numbers I recommended and then go from there.

rgustafson
10-12-2006, 05:02 PM
Swetyejohn,

Have you read Fortune's Formula by William Poundstone? If not , Iwould strongly reccomend it. Very interesting reading.

highnote
10-12-2006, 05:38 PM
Yep. Very good read.

leonid
10-12-2006, 06:35 PM
hi, wouldn't the cost per dollar/dividend be 1.17 to represent the take-out?

(of 17%)

highnote
10-12-2006, 07:21 PM
hi, wouldn't the cost per dollar/dividend be 1.17 to represent the take-out?

(of 17%)


In this simulation, it assumes you are making the same bet over and over. Takeout doesn't fit into this simulation. You can factor that into your expected value or odds, etc. Just like we don't factor income tax into our betting decisions. Most people don't pay taxes on gambling income, but for those who do, it is a factor, but is usually not taken into account when the wager is made.

For example, if you enter 1.1 into the "cost of bet per dollar dividend" what you are saying is that you need to bet $1.10 to earn $1.00 of profit. Which means that the odds being offered are 0.91 - 1.

If you enter .5 as your "Cost of bet per dollar dividend" then the odds will be 2-1. That means that for every 50 cents you bet you will get back $1.

This is not the traditional way to think about this in a horse racing context, but it is one correct way of looking at it.

Conversely, if you enter 2 into the "Cost of bet per dollar divident" the odds will be 1 - 2, or 0.5 - 1.... same thing.

It was easier to program the simulation if the dividend (profit) was always $1.

Does that make sense? If not, please let me know and I can give some more examples. I know it is not intuitive, but once you get the hang of it, it makes sense.

Thanks.

John

PS

Try putting in 1000 wealth, 1000 trials, 53 probability, 2 cost and then click Kelly.

Click the Kelly button about 10 times to run 10 trails of 1000 each. Note the results. They are all over the place -- possibly ranging from $8 wealth to $321,723 -- or even greater!

Click "Clear Values".

Now enter 40 for your flat bet size and hit the Flat Bet button 10 times and notice the results. You'll probably see a range of 2000 to 5000 wealth. You get security, but you don't get growth.

Clear values and enter .25 Kelly. Click Kelly 10 times and note the results. Maybe you'll lose a little bit 2 out of 10 times. The rest of the time your results will be maybe 5000 to 20,000.

If you think you have a 60 percent edge then change 53 to 60 and repeat the process and note the results.

You will tap out a lot at Full Kelly, but sometimes you will have astronomical gains.

You'll probably average about 9000 gains with flat bet, but nothing legendary.

Now, try .25 Kelly. I never tapped out once and my gains were on the order of millions every time! That is the power of log betting.

Now go back to 53 percent and this time do a 100 thousand trials at .25 kelly. The final wealth will be enormous -- something like 7 to the 74th.

Do the same for $40 flat betting and you might end up with $250,000.

I think this shows clearly that flat betting is safe, but does not grow your bankroll. If you truly have an edge and you can estimate it well, then Kelly is the best system of betting.