## Gambling theory problem/puzzle solution

I originally posted a problem about a week ago here and an update with a hint here. If you haven’t read those, please do and give it a try before reading the solution.

Here’s a restatement of the problem:

You deposit $400 in an online casino and are given a $100 bonus immediately, so you have $500 to bet with. You can withdraw only after betting a total of $2500. Let’s say you play a game where you flip coins and if you win you get 1.99 times your bet and nothing if you lose. This has a 99.5% return like blackjack, but I’m abstracting it because in blackjack you can run into bad EV spots where you make a bet and then don’t have enough to split or double down. The table limits for this game are minimum bet $1 and maximum bet $100. How much should we bet to maximize EV, and why?

**Solution:**

The solution is to bet as much as you possibly can, repeatedly, except for a couple of special cases. The most obvious case is where you need a bet smaller than the maximum in order to finish the wagering requirement (e.g. if you have wagered $2450 then you only need to bet $50 instead of $100). The other case is when the current account balance is greater than or equal to the remaining wagering requirement (e.g. if you have wagered $2000, have $500 left on the wager requirement, but have a balance of $550). In the latter case it doesn’t matter what bet sizes you use, as you’ll see below.

Think first about the problem and the hints I gave. If the problem had a trivial answer it wouldn’t be very interesting at all. As I stated, most people intuitively come up with a handful of answers and those are all wrong. The hint I gave about martingaling’s EV in comparison to flat minimum betting should lead you to one of two conclusions. If you don’t think martingaling has a higher EV then you are of the persuasion that the bet size doesn’t matter, and I already stated that isn’t right. So, martingaling at some point has a higher EV. Now you just need to figure out when and why. In actuality, the increasing bet sizes of martingaling is a consequence of knowing that large bets give higher EV in this situation, rather than a good place to start thinking about the problem. A deceptive hint on my part.

As a general method of reasoning, when you have a lot of possible options and it wouldn’t help or would take too long to think about individual cases, it helps to look at things like extreme cases, boundary conditions, and infinite iterations. This is very useful in fields like math and engineering. If you watch my videos on Poker VT or read some of my other blog posts, you’ll see me saying things like “Even if this guy called with 100% of his hands, it would be a good push” or “Even if you have AA you should fold.”

So, consider 1000 of these bonuses. You will earn $100k in bonus money. If you bet $1 per hand then you will almost never bust, and you will have wagered 1000 * $2500 = $2.5 million. With the -0.005 return on every dollar bet, you’ll have lost $12.5k for a total profit of $87.5k. If you bet $100 per hand then you will bust quite a lot. If you lose all your money then you don’t have anything else to do, you have only completed part of the wagering requirement and move on to the next bonus with a fresh $400 deposit and new bonus. At the end of 1000 of these bonuses you may have only wagered $1.5 million. The -0.005 EV here means you will have lost $7.5k for a total profit of $92.5k.

Congrats to user Ka.Yung from Poker VT who figured this out early and his reasoning why is absolutely correct as well. I tried to throw him off with a false response but got no reply, so I don’t know if he bought it or not.

My refutation was this: “say you are successful with the $100 bets, then isn’t your EV is the same as with the $1 bets — you expect to make $87.50 with the bonus because you’ve wagered $2500 in both cases” which is deceptively wrong. At the very least, if you understand that we don’t care about variance then you think that $1 bets and $100 bets have the same EV. You know you are going to bust a lot with the $100 bets, though, so you should correctly reason that the times that you **don’t** bust with the higher bets, that your wins will be high enough to compensate for those times you do bust. For instance, if you never bust with $1 for an expected result of $487.50, and you bust half of the time with the $100 bets, then you would expect the ending balance when you don’t bust with $100 bets to be $975. It would be extremely rare to be up 575 $1 units over your initial deposit like this, but if you don’t bust when betting $100 then to be up 5.75 units is not surprising at all. Anyway, as I showed in the solution above, you would actually expect to have a slightly higher profit than this $975 anyway.

One person tried looking at the extreme case of depositing $2500 and then betting the $2500 all at once. This fundamentally changes the nature of the problem and indeed the answer is trivial in this case. You will complete the wagering requirement every time regardless of how much you bet, so any bet size gives the same EV here. We can only increase our EV when we have an opportunity to go broke before meeting the wagering requirement.

This problem is pretty easy to write a Monte Carlo simulation for, and I did, similar to what I did for my megapost on variance in SNGs. In practice the result for the $1 bets is indeed around $87.50 per bonus but for the maximum bet the result is above $90 over a statistically significant number of bonuses.

## EngineerSean said:

It figures that the answer to this problem is not trying to maintain your bankroll for as long as possible but rather how fast you can go busto. With your $500 on a table with no maximum bet, and you bet your entire bankroll or the remaining amount to clear, you can expect to go busto 75% of the time, end up with $3000.95 12.5% of the time, and end up with $975.05 12.5% of the time, giving you an expected value of $496. I think the fact that the maximum bet was $100 instead of infinity was a good way to throw people off, very good thought experiment.

## Matt said:

This was a neat thought experiment, and to play around with it I threw together a quick php script for simulation.

http://codepad.org/HLQHF2S4

Your EV with $1 bets is of course -$12.50 . It looks like the EV when you bet $100 x25 is around -10.5. But for EV ignoring bonuses (contextual EV I’ll call it) I’m just having it calculate the total amount wagered for 10k runthroughs and applying the .5% edge over that. When you calculate EV based on the amount actually won including bonuses (actual EV) it’s a pretty standard $86-87 for $1 bets and it fluctuates quite a bit for $100. I’ve only eyeballed those stats but it seems to stay in the 90s although I’ve seen it plummet down to the 50s on some runs.

That got me thinking about the bonus:buyin ratio, along with playthrough amount, and how it influences things if at all. Initially with the original problem I thought the higher contextual EV you get for risking bustso would be counter-balanced by the hit taken to your actual EV when you consider the substantial amount of times where you bust and lose advantage of the 25% bonus. That is to say, with the ~33% risk of ruin you get for betting $100, wouldn’t the bonus money lost on those runs alter the overall outlook of the deposit bonus?

So I experimented a little and made the buyin $100 and the deposit bonus $400 with the same playthrough req: would we see a different outcome in the simulation between $1 bets and $100? What about a $1 buyin and 499 bonus? Turns out, which makes sense now but didn’t to me at first, that it doesn’t seem to have much of an impact at all. Contextual EV is identical across the board (-12.5 vs. -10.5) of course, and overall EV (”I buyin for $1, gamble with 500, and come away with X”) shows the same trends where the $1 bet has a very consistant range and the $100 bet is a bit wider.

Unfortunately I don’t have more time to spend on this, but my next step with simulating would be to generate a curve on total $ won, factoring in bonuses, because right now I’m just eyeballing results on 10k run throughs and its’ still pretty swingy. I’d be interested to see how the bonus ratio influences things because it seems like it should. My thought now is that the smaller the bonus, the more you want to minimize your risk of ruin and the larger the bonus the more you want to gamble with it. Of course it could affect nothing and you’re always better off taking the bigger gamble whether the bonus is $0 or 100x your buyin.