Saturday, May 22, 2021

A betting paradox that might make your head hurt

 I read about this paradox in a Scientific American article, and could not believe it was true until I had played around with the numbers for a while. It still bothers me, even though I've accepted it. 

Suppose a casino has introduced a new table game they call "17/20." You put a bet down--let's say $100. They flip a fair coin--a genuinely random, 50/50 chance of heads or tails. If it's heads, you win 20% of your bet. If it's tails, you lose 17% of your bet. 

Sounds great, right? It's obviously +EV to play, because you'll either win $20 or lose $17. That's a positive EV of $1.50. 

Now consider what happens if you play twice, and one time it's heads, the other time it's tails. If heads comes first, you now have $120. But then the next toss is tails, so you lose 17% of $120, which is $20.40, leaving you with $99.60--less than you started with. 

If tails comes up first, you lose $17, leaving you with $83. Then it's heads, and you win 20% of that, or $16.60. Now you have $99.60--the same as when it went heads then tails. This shows that it doesn't matter what order the wins and losses come in. 

Even if you win exactly half the time and lose exactly half the time, you still bleed your money away to the house over time. And that is so even though each potential win is greater than each potential loss, before the coin is tossed. 

So this is the paradox: The game is +EV to play once, but -EV to play more than once. The reason is pretty straightforward: 17% of $120 (your loss on the second toss in the head-then-tails scenario) is a larger amount than 20% of $100 (your win on the first toss). And 17% of $100 (your loss on the first toss in the tails-then-heads scenario) is a larger amount than 20% of $83. 

You could fiddle with the percentages and change the long-term outcome. If a win is defined as 20% of your bet, the break-even point will be if a loss is 16.666...% of the bet. Any more than that, and the game is a loser. Below that, it's +EV in the long run. 

Now, I think you could game it so that you're effectively resetting it each time to be like the first toss. That is, if your first toss is a win, you take the $20 profit off the table and bet $100 again. If the first toss is a loss, you add $17 from your pocket and bet $100 again. With a balanced number of heads and tails, and each heads a $20 profit and each tails a $17 loss, you should make money over time. But I think we have to assume that the casino's rules wouldn't allow that, since they're not going to spread any game that's that easy to beat. (Let's not quibble over exactly how the rules would be written or enforced; this is just a hypothetical exercise.) But if you leave the money on the table untouched, and keep playing, it will eventually disappear into the casino's coffers. 

I was hugely surprised by this. I would not have thought it possible to devise a game--especially one so simple--that is +EV to play once, but -EV to play more than once. 


Addendum, May 24, 2021 

You'll need to read the discussion in the comments below for this to make sense. My commenters have caused me to rethink and recalculate. I did so in an attempt to show why they were wrong--but that's not exactly what happened. 

There are a few different pieces to this. 

The two-toss strategy

In the OP, I said that the game would be +EV to play one toss, but -EV for more than one. So suppose you walk into this casino every day and, starting with $100 on the table, play for exactly two coin tosses--no more, no less--then quit for the day. What would be your long-term results? 

As the commenters point out, there are four equally probable outcomes: HH, HT, TH, and TT. Over the long run, those should happen equally often. The net profits/losses are, respectively, +44, -0.40, -0.40, and -31.11. The sum of those is +12.09, an average of $3.02 per day profit, or $1.51 per coin toss. 

Interestingly, that's a hair more than the $1.50 profit per toss that we would calculate to be the EV of playing one toss and quitting. Which suggests that playing the two-toss strategy is more profitable. 

The three-toss strategy

So I went to the obvious next step: Suppose I always play three tosses per session. Now there are 8 equally probable outcomes. One outcome is HHH, which yields +72.80. One is TTT, which yields -42.82. There are three combinations with two heads and one tails, each of which is +19.52. there are three combinations with one heads and two tails, -17.33. Add all those up, and it's +36.55, for an average profit of $4.57 per day, or $1.52 per toss. 

So now it appears that the 3-toss strategy is more profitable--both per day and per toss--than the 2-toss strategy, which in turn is more profitable than the 1-toss strategy. 

This is not what I expected. 

Asymmetry 

As the commenters point out, the difference lies in the outcomes when you don't have an exactly 50/50 split in heads and tails. It's clearly, demonstrably true that any session you play in which the heads and tails are exactly evenly divided results in a net loss. E.g., playing 8 tosses, with 4H and 4T (in any order) yields a net loss of $1.59 on the initial $100 bet (again, with all the money left on the table until the end). 

But the interesting part happens in the asymmetrical outcomes. On the rare occasion that you play an 8-toss strategy and get all 8 tails, you're left with $22.52 on the table at the end, for a loss of $77.48. But you will equally often get a run of all 8 heads, at the end of which you will have $429.98 on the table, for a profit of $329.98. The probabilities are symmetrical, but the outcomes are decidedly asymmetrical. The same sort of thing is true for each balanced pair of possible outcomes, e.g., 7H1T/7T1H, or 5H3T/3H5T. 

In fact, if you extend the idea to, say, a 1000-toss strategy, you'll quickly realize that many days you'll lose the entire starting $100 (assuming that the casino doesn't deal in bets of a fraction of a penny) long before the thousandth toss. Your losses are capped at $100, but your wins are potentially unlimited. 

This is, I now think, the key consideration. I was previously assuming that an exactly 50/50 split was the most likely, and since the probabilities of uneven heads/tails splits were symmetrical, those could just be disregarded. 

Long sessions

With that in mind, I set up an Excel spreadsheet to simulate a 10,000-toss strategy, and ran it 20 times. I kind of suspect that Excel's random-number generator is a little wonky, because I got 15 outcomes with more than 5000 heads, and only 5 with less. But that doesn't matter for present purposes. 

In 13 trials, I had a fraction of a cent left--call it zero. In five trials, I had less than $1 left. These included, e.g., 5038 heads leaving me with $0.24, and 5041 heads leaving me with $0.73. (Remember that because an exactly even 50/50 distribution is always a loss, you have to be well above the average number of heads to ever leave with a profit.) 

But in two trials, I had hugely positive results. In one that had 5086 heads (and, of course, 4914 tails), the final amount on the table was $11,629,561! And in one extremely improbable trial, the spreadsheet somehow came up with 5125 heads, yielding--you'd better be sitting down for this--$20 trillion! 

Now, that's another outcome that makes me suspect Excel's RNG, because getting 5125 heads out of 10,000 tosses has a probability of only about 0.0064. (I used this online binomial calculator to get that number.) But the point is that in long sessions in which luck favors you with substantially more heads than tails, you can win huge amounts, while in the equally probable sessions with substantially more tails than heads, you still lose only $100 each time. 

Conclusion 

I think I was wrong about how to calculate the EV of the game beyond a single toss--as was the author of the Scientific American article. And I appreciate the two commenters for pressing me to look deeper. 


Addendum, May 24, 2021 

Not all Scientific American articles are available online, but the one that started this for me happens to be. "Is Inequality Inevitable?" by Bruce M. Boghosian: https://www.scientificamerican.com/article/is-inequality-inevitable/

Here's the relevant section: 




In 1986 social scientist John Angle first described the movement and distribution of wealth as arising from pairwise transactions among a collection of “economic agents,” which could be individuals, households, companies, funds or other entities. By the turn of the century physicists Slava Ispolatov, Pavel L. Krapivsky and Sidney Redner, then all working together at Boston University, as well as Adrian Drgulescu, now at Constellation Energy Group, and Victor Yakovenko of the University of Maryland, had demonstrated that these agent-based models could be analyzed with the tools of statistical physics, leading to rapid advances in our understanding of their behavior. As it turns out, many such models find wealth moving inexorably from one agent to another—even if they are based on fair exchanges between equal actors. In 2002 Anirban Chakraborti, then at the Saha Institute of Nuclear Physics in Kolkata, India, introduced what came to be known as the yard sale model, called thus because it has certain features of real one-on-one economic transactions. He also used numerical simulations to demonstrate that it inexorably concentrated wealth, resulting in oligarchy.

To understand how this happens, suppose you are in a casino and are invited to play a game. You must place some ante—say, $100—on a table, and a fair coin will be flipped. If the coin comes up heads, the house will pay you 20 percent of what you have on the table, resulting in $120 on the table. If the coin comes up tails, the house will take 17 percent of what you have on the table, resulting in $83 left on the table. You can keep your money on the table for as many flips of the coin as you would like (without ever adding to or subtracting from it). Each time you play, you will win 20 percent of what is on the table if the coin comes up heads, and you will lose 17 percent of it if the coin comes up tails. Should you agree to play this game?

You might construct two arguments, both rather persuasive, to help you decide what to do. You may think, “I have a probability of ½ of gaining $20 and a probability of ½ of losing $17. My expected gain is therefore:

½ x ($20) + ½ x (-$17) = $1.50

which is positive. In other words, my odds of winning and losing are even, but my gain if I win will be greater than my loss if I lose.” From this perspective it seems advantageous to play this game.

Or, like a chess player, you might think further: “What if I stay for 10 flips of the coin? A likely outcome is that five of them will come up heads and that the other five will come up tails. Each time heads comes up, my ante is multiplied by 1.2. Each time tails comes up, my ante is multiplied by 0.83. After five wins and five losses in any order, the amount of money remaining on the table will be:

1.2 x 1.2 x 1.2 x 1.2 x 1.2 x 0.83 x 0.83 x 0.83 x 0.83 x 0.83 x $100 = $98.02

so I will have lost about $2 of my original $100 ante.” With a bit more work you can confirm that it would take about 93 wins to compensate for 91 losses. From this perspective it seems disadvantageous to play this game.


Addendum, June 10, 2021 

I emailed the author of the article about my concerns. He responded, saying that many people had raised similar questions, so when the article was reprinted in a book, he took the opportunity to revise the section in question for greater clarity. 

 Here's the relevant portion of the revised version of the article he sent me: 



(The revision is posted here with Mr. Boghosian's kind permission. Source: B.M. Boghosian, “The Inescapable Casino”, reprinted in “The Best Writing on Mathematics 2020”, M. Pitici ed., Princeton University Press (2020).)

This revision sounds correct to me: the EV is positive, but you'll lose more often than you'll win. I still quibble with the last sentence, that "it seems decidedly disadvantageous to play this game." I mean, there's a sense in which that's true, but only if you're tallying wins and losses, while taking no account of their magnitudes--which seems like not the best method of accounting. It was this sentence that made me think that Mr. Bohosian was saying that the game's EV was negative when played more than one toss. I see now that that wasn't actually what he was trying to say. 

Of course, you have to be able to tolerate the losses without going broke. In his email to me, Mr. Boghosian mentioned the Kelly criteria for determining what fraction of one's bankroll can be risked. I think Kelly's formula is pretty well known among serious poker players. Phil Laak is particularly vocal about it--e.g, this 2009 Bluff magazine column. For an introduction, see here or here


 

21 comments:

Mr Subliminal said...

Unless I'm missing something, I don't see any paradox here. The game has a positive EV of 1.5% per coin toss, for each and every toss. I would be happy to sit down and play it as long as I'm allowed to.

You mention the Win Loss (WL) and Loss Win (LW) scenarios, but forget the equally probable WW and LL outcomes when tossing a coin twice.

For a $100 initial bet :
WW ends with $44 profit
WL ends with $0.40 loss
LW ends with $0.40 loss
LL ends with $31.11 loss

for a total of $12.09, so expected gain after 2 tosses is $12.09/4, or $3.0225.

This corresponds to $100 * 1.015 * 1.015 = $103.0225.

THETA Poker said...

I don't consider it to be a paradox at all. It's just counterintuitive that HT and TH both lose. But the game is obviously and definitely +EV long-term because HH makes up for HT/TH/TT.

HH = +44.00
HT = -0.40
TH = -0.40
TT = -31.11

Average = +3.0225

Rakewell said...

I used Excel to lengthen out the calculation. Starting with $100, I made it win 50 times in a row (each new cell being 1.2 x the previous cell), then lose 50 times in a row (each new cell being 0.83 x the previous cell. Net result is that $100 turns into $81.84. I tried the reverse just to be sure (50 losses followed by 50 wins), and it's the same result.

If you take the four possibilities for the first two tosses and arrange them consecutively (HH, HT, TH, TT) in any order, the net result after 8 tosses (four heads and four tails) is $98.41, a loss of $1.59. If you repeat this pattern more times, you just get more net loss.

The problem with your math is in taking an average of the four. That's not how the game is played. The effect of how you're calculating it is almost (but not quite) the same as how I pointed out that you could manipulate the betting so that you're starting with $100 for each coin toss. If I employ the strategy I described over the course of eight tosses, four of which are heads and four of which are tails (in any order), I will have four wins of $20 each, for +$80, and four losses of $17 each, for -$68. That's a net gain of $12, which translates to an average of $1.50 win per toss.

The difference in your math is that it's like you're playing the game twice, then taking the money off the table and starting over, repeated four time. After your HH, you have $144. You take the profit off the table and start again. You get HT, for a loss of $0.40. You add back money from your pocket to reset the bet to $100, play again, and get TH. Another loss of $.40. You reset to $100 again, and play two more tosses with TT, losing $31.11. Your total wins are $44. Your total losses are $31.91. Your net gain is $12.09 over 8 tosses. With the "reset after each bet" strategy, you will have a net gain of $1.50 per toss over the long run. They're very close to the same.

Go ahead--do the arithmetic on what happens to your initial $100 if you run through HH, HT, TH, and TT once each--consecutively (in any order you like), leaving the money on the table every time. What do you end up with? I think you'll find that it's $98.41--a loss, not a win.

Agree?

BloodyP said...

Blogger FTW!!

THETA Poker said...

I'm sure the light bulb will turn on for you any moment, but until then, I will happily play this game with you for any amount of money for as long as you like.

The averages are absolutely what you want to know long-term. For example, if I play one round, I expect to make $1.50. If I play two rounds (without resetting), I expect to make $3.02. Three rounds get me $4.57 and four $6.14.

It's probably not intuitive that HHTT and TTHH are both losers, or that 11 of the 16 four-round outcomes are negative, but the remaining 5 outcomes will fill my pocket (HHHH = +107.36, HHHT/HHTH/HTHH/THHH = +43.42).

Rakewell said...

For now, let's set aside what you say your theoretical expectations should be. Make the rubber hit the road. Use a spreadsheet, or grind out the math with a calculator one toss at a time, and find out the net win or loss from whatever number of tosses you choose (10, 50, 100, 1000). As long as they are evenly divided into heads and tails, they can be in any order you like. Assuming that you're leaving all the money on the table for the entire run, I am very confident that you'll find a net loss at the end.

Go actually do this. I'm obviously not going to convince you on the basis of theory, so go run the numbers and see what happens. If you find a net win, tell me how you got there. If you find a net loss, I will accept your groveling apology with humility and grace. :-)

Mr Subliminal said...

I agree that "if you run through HH, HT, TH, and TT once each--consecutively (in any order you like), leaving the money on the table every time ... you'll find that it's $98.41--a loss, not a win". This only confirms the commutative property of multiplication. However, I believe you are making the same error here as you did in the 2 coin toss scenario - ignoring all the other permutations.

When you combine HH, HT, TH, and TT, you are in essence dealing with 4 coin tosses. So running through only HH, HT, TH, and TT in any order will lead to a loss, just as running through only HT and TH in the 2 coin toss scenario leads to a loss. However in 4 coin tosses, we don't always have the perfect symmetry of 4 heads and 4 tails. Sometimes we'll have 5 heads and 3 tails for a profit of $42.28, which eclipses the $31.93 loss of the opposite 3 heads and 5 tails. Not to mention the other permutations.

Rakewell said...

OK, so run a spreadsheet simulation of the game that isn't strictly 50/50, but randomly chooses H or T for each toss. Let it run 1000 trials or more so that the outcome isn't overly influenced by short-term lopsidedness in luck. What is the result?

Rakewell said...

BTW, I just did exactly that trial, with randomization. Incredibly, about halfway through the 1000 simulated coin tosses, I was up to $53,000, because of several heads-heavy runs. But the law of large numbers caught up to me. It finally dipped back below $100 on toss #883, and after 1000, I was down to $3.09.

Mr Subliminal said...

"As long as they are evenly divided into heads and tails, they can be in any order you like."

Unfortunately this isn't the case in real life.

Before I reluctantly spend time on a simulation on this beautiful Sunday afternoon, let me know the first sentence you disagree with below, and why :

1) For 2 coin tosses with initial bet of $100, HH = +$44, HT = -$0.40, TH = -$0.40, TT = -$31.11

2) For 2 coin tosses, the probability of HH = HT = TH = TT = 0.25, and there are no other possible permutations.

3) The expectation of 1) above therefore is $11 - $0.10 - $0.10 - $7.7775 = $3.0225.

Rakewell said...

The problem is with #3, because it is not arithmetically equivalent to running 8 coin tosses in a row while leaving the money on the table the whole time.

Let's take the order of 8 tosses as HHHTTHTT, to match what you wrote here. Starting with $100, what you'll have left after that sequence of tosses is $98.41. That's trivially easy to check. Do you get a different result?

Assuming you get the same result that I do, then mix up the order of the Hs and Ts. I believe you'll find that it makes no difference. Agreed?

Mr Subliminal said...

Firstly my 3 sentences above were about 2 coin tosses, so let's stick to that. I don't know why you bring up 8 coin tosses.

And mixing up the order of a symmetrical H and T count (HT or HHTT or HHTHHTTT, where number of H = number of T) will always result in a loss. No argument there.

Here's an idea - how about looking at 3 coin tosses, an uneven number.

Mr Subliminal said...

"Let's take the order of 8 tosses as HHHTTHTT, to match what you wrote here."

No, it's not 8 tosses. It's the 4 possible, equiprobable results of 2 tosses, and #3 is just the expected value of those 2 tosses.

Rakewell said...

"And mixing up the order of a symmetrical H and T count (HT or HHTT or HHTHHTTT, where number of H = number of T) will always result in a loss. No argument there."

I'm not quite sure what you're saying here. Let me rephrase it and see if you agree:

When all the money is left on the table without resetting, any number of coin tosses greater than 1 will result in a net loss if the heads and tails are equal in number, regardless of what order the heads and tails come in.

I assert that that is a true and provable statement. Do you agree?

Rakewell said...

"No, it's not 8 tosses. It's the 4 possible, equiprobable results of 2 tosses, and #3 is just the expected value of those 2 tosses."

I understand your point. Your point is that playing a two-toss game has a positive EV, because the sum of the wins and losses resulting from the four possible H/T two-toss combinations, all of which are equally probable, is a net win.

I'll say this: There's something to what you're saying. I've played around with some numbers for the last hour, and got some results I wasn't expecting. I'll write more in the morning about what I've found.

Mr Subliminal said...

"When all the money is left on the table without resetting, any number of coin tosses greater than 1 will result in a net loss if the heads and tails are equal in number, regardless of what order the heads and tails come in.

I assert that that is a true and provable statement. Do you agree?"


Yes. That's why I suggested looking at 3 tosses.

Mr Subliminal said...

Looking back, there was a typo in my post of 4:40 PM :

"When you combine HH, HT, TH, and TT, you are in essence dealing with 4 coin tosses."

All references to 4 coin tosses should be to 8 coin tosses.

THETA Poker said...

This true statement, "any number of coin tosses greater than 1 will result in a net loss if the heads and tails are equal in number, regardless of what order the heads and tails come in", has led you astray.

An equal number of heads and tails does not happen all of the time or even a majority of the time. In a 4-round game, only 6 of the 16 outcomes have 2 heads and 2 tails. Four outcomes have 1 head and 3 tails, and one outcome has 4 tails. These 11 outcomes all lose money, but the 5 other outcomes (3+ heads) win more total money than these 11 negatives lose.


[BTW, to make sure that Kevin Nealon and I weren't going crazy, I did create a spreadsheet before my last comment. When the averages (with no resets) came out to +1.50 for 1 round, +3.02 for 2, +4.57 for 3, and +6.14 for 4, I stopped as those are exactly +1.5^1%, +1.5^2%, +1.5^3%, and +1.5^4% as expected. I also double-checked to make sure it wasn't April 1 but was unable to confirm if aliens had taken over your mind (I do think you're not playing enough poker now though).]

Pokerdogg said...

Have you tried running the simulation a bunch more times?

Rakewell said...

See the addendum I wrote to the original post.

Mr Subliminal said...

Thanks for posting the very interesting Scientific American article and the (17/20) game. Boghosian is a math professor at Tufts University, so I'm certain that he and the other international heavyweights cited in the article are familiar with the combinatorics behind the game. (17/20) however is presented as a suitable model for wealth trickling up, and the creation of oligarchs. This is borne out by your simulations - lots of folks going broke and a few getting obscenely wealthy.