Jim Killingsworth

Lin­ear and Log Scale Dis­tri­b­u­tions

In my pre­vi­ous post ti­tled Fixed Frac­tions and Fair Games, I ex­plored the prop­er­ties of two dif­fer­ent bet­ting strate­gies ap­plied to a re­peat­ed coin toss game. The fo­cus was on the ex­pect­ed val­ue for each of the two bet­ting strate­gies. In this post, I take a deep­er look at the dis­tri­b­u­tion of pos­si­ble out­comes af­ter a large num­ber of plays.

Es­ti­mat­ing the Dis­tri­b­u­tion Em­pir­i­cal­ly

Sup­pose a gam­bler with $100 plays 200 rounds of the coin toss game, bet­ting a fixed con­stant of $20 on each play. The ex­pec­ta­tion is breakeven. The most like­ly out­come for the gam­bler is that he has the same amount of mon­ey that he start­ed with af­ter 200 plays. The re­sults can vary, how­ev­er. There are oth­er out­comes that are not as like­ly to hap­pen but are still pos­si­ble. We can es­ti­mate the prob­a­bil­i­ty of each pos­si­ble out­come by run­ning 10,000 unique sim­u­la­tions of the coin toss game and ob­serv­ing the fre­quen­cy of each out­come:

Figure 1

The chart above looks like it rough­ly ap­prox­i­mates a bi­no­mi­al dis­tri­b­u­tion, with out­comes clos­er to the breakeven amount more like­ly than out­comes fur­ther away. We can al­so sep­a­rate the out­comes in­to cat­e­gories based on whether the re­sult is a prof­it, a loss, or a breakeven amoun­t:

Figure 2

While the sim­u­lat­ed re­sults might give us a pret­ty good ap­prox­i­ma­tion of the dis­tri­b­u­tion of pos­si­ble out­comes, there is a way to be more ac­cu­rate.

Com­put­ing the Dis­tri­b­u­tion An­a­lyt­i­cal­ly

Re­gard­less of which bet­ting strat­e­gy the gam­bler us­es, the out­come of the re­peat­ed coin toss game de­pends on the to­tal num­ber of win­ning and los­ing plays. The or­der of win­ners and losers does­n’t mat­ter. For the fixed con­stant bet­ting strat­e­gy, the fol­low­ing for­mu­la can be used to com­pute the fi­nal out­come based on the num­ber of win­ning and los­ing games:

Figure 3

Since there are on­ly two pos­si­ble out­comes for each toss of the coin, the dis­tri­b­u­tion of pos­si­ble out­comes in a re­peat­ed coin toss game can be mod­eled as a bi­no­mi­al dis­tri­b­u­tion. We can use the fol­low­ing prob­a­bil­i­ty mass func­tion to com­pute the prob­a­bil­i­ty of each out­come based on the num­ber of win­ning rounds rel­a­tive to the to­tal num­ber of plays:

Figure 4

While there are mul­ti­ple tech­niques for com­put­ing the bi­no­mi­al co­ef­fi­cien­t, the for­mu­la us­ing fac­to­ri­als seems to be the most com­mon:

Figure 5

How­ev­er, I pre­fer to use the fol­low­ing al­ter­na­tive method when us­ing a com­put­er to per­form the cal­cu­la­tion­s:

Figure 6

If the gam­bler plays 200 rounds of the coin toss game, there is a to­tal of 201 unique pos­si­ble out­comes. We can com­pute the prob­a­bil­i­ty of each out­come an­a­lyt­i­cal­ly by ap­ply­ing the for­mu­las above. Us­ing the same pa­ra­me­ters of the coin toss game as be­fore, the com­put­ed dis­tri­b­u­tion looks like this:

Figure 7

This is the ide­al­ized form of the pre­vi­ous chart. No­tice that the chart is sym­met­ri­cal. The dis­tri­b­u­tion of prof­itable out­comes to the right of $100 mir­rors the dis­tri­b­u­tion of los­ing out­comes to the left of $100. Group­ing the re­sults in­to prof­it, loss, and breakeven cat­e­gories again, we get the fol­low­ing:

Figure 8

While the sym­me­try be­tween the dis­tri­b­u­tion of win­ning and los­ing out­comes may not be sur­pris­ing when us­ing a fixed con­stant bet size, can we ex­pect the same prop­er­ty to hold true if we use the fixed frac­tion bet size strat­e­gy in­stead? Let’s find out.

Dis­tri­b­u­tions on a Log­a­rith­mic Scale

To gen­er­ate the equiv­a­lent prob­a­bil­i­ty dis­tri­b­u­tion chart for the fixed frac­tion bet­ting strat­e­gy, we need to com­pute the fi­nal out­comes dif­fer­ent­ly. In this case, we use the fol­low­ing for­mu­la to de­ter­mine the fi­nal out­come based on the num­ber of win­ning and los­ing plays:

Figure 9

Plug­ging in the num­ber­s, us­ing the same pa­ra­me­ters of the coin toss game as we used in pre­vi­ous ex­am­ples, we get a prob­a­bil­i­ty dis­tri­b­u­tion chart that looks com­plete­ly dif­fer­ent than the one above:

Figure 10

In the fixed frac­tion case, the gam­bler’s bankroll can nev­er fall be­low ze­ro. This is why the chart does­n’t show the ex­is­tence of any pos­si­ble out­comes be­low ze­ro. No­tice that there is a clus­ter of out­comes be­tween ze­ro and the $100 breakeven amoun­t, while out­comes above $100 are few­er and more spaced out. The set of pos­si­ble out­comes is not even­ly dis­trib­ut­ed. It might be more ap­pro­pri­ate to plot this chart on a log­a­rith­mic scale:

Figure 11

The out­comes are even­ly dis­trib­uted on a log­a­rith­mic scale, but the most like­ly out­comes are shift­ed to the left of the $100 breakeven amoun­t. Af­ter play­ing 200 round­s, the gam­bler is far more like­ly to take a loss than to go home with a prof­it:

Figure 12

The most like­ly out­comes, out­comes with 100 win­ning plays and 100 los­ing plays, re­sult in the gam­bler’s $100 bankroll be­ing whit­tled down to less than $2 af­ter play­ing 200 games. Us­ing a fixed frac­tion bet­ting strat­e­gy changes the dy­nam­ic of the game be­cause the re­sults com­pound in a mul­ti­plica­tive fash­ion in­stead of an ad­di­tive fash­ion.

Bal­anc­ing the Re­ward Func­tion

As with the pre­vi­ous post, we as­sume the gam­bler al­ways bets on head­s. Re­call the re­ward func­tion we’ve been us­ing so far for the fixed frac­tion bet­ting strat­e­gy:

Figure 13

With this re­ward func­tion, for any giv­en round of the coin toss game, the val­ue of the win­ning amount is al­ways equal to the amount the gam­bler risks on a loss. While this might seem like an equal trade­off on the sur­face, we have shown above that a re­peat­ed coin toss game with this strat­e­gy re­sults in a high prob­a­bil­i­ty of a los­ing out­come.

How can the re­ward func­tion for the fixed frac­tion bet­ting strat­e­gy be mod­i­fied to give a bal­anced dis­tri­b­u­tion of win­ning and los­ing out­comes? In­stead of hav­ing a re­ward func­tion in which the win­ning and los­ing amounts are the same, we need to come up with a re­ward func­tion in which the mul­ti­pli­er ap­plied to the gam­bler’s bankroll for a win­ning play has the same mag­ni­tude as the mul­ti­pli­er used for a los­ing play. But the mul­ti­pli­ers must have an equal mag­ni­tude on a log­a­rith­mic scale in­stead of a lin­ear scale. Hold­ing the gam­bler’s risk of loss con­stan­t, we can de­fine the re­ward func­tion for the win­ning case in terms of the re­ward func­tion ap­plied for the los­ing case us­ing the fol­low­ing equa­tion:

Figure 14

Tak­ing the ex­po­nent of both sides, we can get the re­ward func­tion for the win­ning case. Putting both the win­ning and los­ing re­ward func­tions to­geth­er, we now have a bal­anced re­ward func­tion that looks like this:

Figure 15

The re­ward mul­ti­pli­er that gets ap­plied to the gam­bler’s bankroll when the coin lands on heads is the mul­ti­plica­tive in­verse of the mul­ti­pli­er used when the coin lands on tail­s. With the bal­anced re­ward func­tion, the for­mu­la to com­pute the fi­nal out­come based on the num­ber of win­ning and los­ing plays be­comes:

Figure 16

The prob­a­bil­i­ty dis­tri­b­u­tion chart now looks like this:

Figure 17

Of course, it makes more sense to plot this on a log­a­rith­mic chart:

Figure 18

With the mod­i­fied re­ward func­tion for the fixed frac­tion bet­ting strat­e­gy, the gam­bler now has an equal prob­a­bil­i­ty of get­ting a win­ning out­come as he does a los­ing out­come. The break­down of prof­it, loss, and breakeven out­comes is now the same as that of the fixed con­stant bet­ting strat­e­gy:

Figure 19

But while the dis­tri­b­u­tion is bal­anced in terms of win­ning and los­ing out­comes, the pay­off for a win­ning out­come al­ways out­weighs the pay­off for a los­ing out­come—some­times even by sev­er­al or­ders of mag­ni­tude. I imag­ine an ad­van­tage play­er could eas­i­ly find a way to prof­it from such a game.

Ac­com­pa­ny­ing source code is avail­able on GitHub.

Com­ments

Show comments