Let's play a quick gambling game

You are going to start by betting a penny, and then I roll a 10-sided die. It is labeled 0 through 9. Whatever you roll, that's what I multiply your bet by and give back to you. Then you will decide if you want to play again, but there is the caveat that you must bet everything you have made if you want to keep going. We can keep playing for as long as you like... but once we stop, we will never play this game again.

When would you stop playing this game to maximize your expected return?

The real question is "To what extent can logic help us decide how to play this game?"

  • $\begingroup$ I am waiting for you to select a correct answer. $\endgroup$
    – DSM
    Feb 22 '19 at 11:48

First of all, let's do the obvious calculation.

Rolling the die turns 1 into, in expectation, (0+1+...+9)/10=4.5. So your expected return is greater if you roll the die than if you don't.

Now note that

starting with an amount bigger than one penny doesn't really change anything; it just scales things up.


your expected return is always better if you take that next roll.

But of course

if you continue literally for ever then with probability 1 you eventually roll a zero and lose everything. On the other hand, the remaining 0% of the time you get an infinite amount of money. And, more to the point, it doesn't follow from "it's always better to do X N+1 times than only N times" that "it's even better to do X infinitely often". Infinity doesn't work that way.

So the answer to the question as stated is

that there is no policy that maximizes your expected return, because among "finite" policies you always do better (at least using the criterion of doing-well required of us by the question) by going on for longer but the obvious "limiting" policy of continuing to roll until you have to stop loses everything with probability 1.

But it's important to notice

a couple of caveats which may or may not make this feel a bit less paradoxical. The first is that, of course, no one can really offer you this series of gambles, because no one actually has an infinite amount of money to give you. So beyond a certain point the consequence of rolling again isn't "I might get 9x as much money" as "I might be owed 9x as much money but not actually get it because my counterparty doesn't have it". And of course in this situation it's no longer true that it's always best to roll again. The second is that having ten billion dollars is not really as much better than having 5 billion as having 5 billion is better than having none at all, so expected amount of money is a silly thing to be trying to maximize.

One common way to deal with the second of these is

to say that utility (i.e., how good things are for you) increases somewhat like log(money). In this case, the expected gain in utility from rolling the die again is always negative because there's a nonzero chance of ending up with zero, which has infinitely negative utility. That's a bit bogus because when you roll a zero you don't lose all your money, only what you were gambling with; if my calculations are right then with utility proportional to log(money) you should keep rolling until your stake is more than about 362872 times the rest of your wealth -- but you may well find that the first problem becomes an issue before you get there.

Let's consider both of those together

and suppose you're the median American with a net wealth of about \$60k, and that your counterparty has exactly \$1B that s/he is prepared to hand over if you keep winning. And that your utility still looks like log(total money). Then you should keep going until you have about \$322M and then stop.

In fact

I think general consensus is that utility increases a bit slower than log(money), but that makes less difference than you might think: if I leave the scenario as above but make your utility log(log(total money)) then you should keep going to about \$208M.

  • $\begingroup$ While I like much of what you concluded, your advice to an average-income American playing this game would be to stop once they hit 2-3 hundred million dollars... and I know we are getting outside the realm of maths, but that really seems too greedy. Also... the penny was Canadian. Sorry. $\endgroup$ Feb 6 '19 at 22:09
  • $\begingroup$ For what it's worth, if I were playing the game I'd stop sooner even though I have the good fortune to be better off than the average American. This shows that either my own utility grows substantially more slowly than logarithmically, or that I am not a perfectly rational expected-utility maximizer, or that there are other complications I'm (perhaps unconsciously) taking into account :-). I think probably all three. $\endgroup$
    – Gareth McCaughan
    Feb 6 '19 at 22:18
  • $\begingroup$ Note e.g. that there's very good evidence that people are substantially more risk-averse than can be explained as expected-utility maximization with any remotely plausible utility function. So my brain is almost certainly not utility-maximizing. And even if my counterparty were Warren Buffett I wouldn't really expect them to keep paying up to \$1B. If you have \$1M in other assets and your counterparty is prepared to give you up to \$1M then you should stop at about \$851k, which seems more reasonable. (\$742k if you have \$100k. \$594k if \$10k.) $\endgroup$
    – Gareth McCaughan
    Feb 6 '19 at 22:29
  • $\begingroup$ That all assumes logarithmic utility. The reason why the figure is lower if you have less other money is that then it hurts you more when you lose your whole stake. $\endgroup$
    – Gareth McCaughan
    Feb 6 '19 at 22:30
  • $\begingroup$ psychological risk-aversion bakes in the fact that the world is fundamentally untrustworthy. In the real world, it's not "accept this money now, or I roll the die, and you probably get more money" It's "take this money now, or I roll the die. I promise you'll probably get more money." Thought experiments only rarely include explicitly the chance that the experimenter is lying. $\endgroup$
    – Ben Barden
    Feb 7 '19 at 15:14

A very interesting question. (I am assuming the die is a fair one, for now.)

The way that I would think of this is to look at the probability of rolling no 0's in n rolls. Unless my stats has gotten seriously rusty, that's just 0.9^n. Rolling six times, I have a 53.1% chance of rolling no 0's, the seventh is 47.8% So, I think I would roll six times (assuming I don't lose), and force myself to stop then and there. This should (in theory) win me about $50-150 * about half of the times I play. Not a bad investment of one penny.

* A. Depending on actual rolls, of course. It could range from 0.01 to 5314.41. B. To simplify the matrix of possible combinations and look at two "middle of the road" examples, rolling a 5 each time nets $156.25, while rolling 2, 3, 4, 5, 6, 7 nets 50.40

Another way to look at this is to say that, at every stage, I have an 80% chance of increasing my bet, a 10% chance of keeping it, and a 10% chance of losing it. I think this is the dangerous way to look at it. Reason being that you keep thinking, "I'm most likely to win, or keep the money, and only slightly likely to lose it." Since past events don't have any impact on future probabilities, I can see quite a few folks falling into this trap. However, even though a player might decide, after rolling 6 non-zeroes that he is 53% likely to do so over the next 6 rolls (and he would be right), but I think this is an example of Survivorship Bias (to some extent).

Lastly, although you don't explicitly state that you can only play once, I assume that is your intention. If you are willing to play against multiple opponents, I would elect to wait to make sure I can see if the die is fair or not. (Many mass-produced dice are unintentionally unfair. There was a great video of a die maker who showed why and how and why his dice were more fair and the better, albeit more expensive, random number generators.) That knowledge will alter my calculations.

  • $\begingroup$ Yeah, at some point we would have to worry about inflation from all this excess cash entering the economy, so I think just the one time is for the best. The fairness of the die seems really important to you so I'll make a decision on that: the die is not quite fair. I played D&D for hours on end and it never rolled a 7+ when I needed it to. $\endgroup$ Feb 6 '19 at 22:16

Defining $ {X}_{k} $ as the money at the $ k $ turn.
Defining $ {Y} $ as the number of turns with no roll of zero.

Also, assuming the dice has $ n $ (Where $ n \geq 2 $) sides going $ \left\{ 0, 1, 2, \ldots, n - 1 \right\} $.

By the Law of Total Expectation the expected money is given by:

$$ \mathbb{E} \left[ {X}_{k} \right] = \sum_{l = 1}^{k} \mathbb{E} \left[ {X}_{k} \mid {Y} = l \right] = \mathbb{E} \left[ {X}_{k} \mid {Y} = k \right] + \mathbb{E} \left[ {X}_{k} \mid {Y} < k \right] $$

Clearly $ \mathbb{E} \left[ {X}_{k} \mid {Y} < k \right] = 0 $ and $ \mathbb{E} \left[ {X}_{k} \mid {Y} = k \right] = {\left( \frac{n - 1}{n} \right)}^{k} {\left( \frac{n}{2} \right)}^{k} $.

The problem is given by:

$$ \hat{k} = \arg \max_{k} \mathbb{E} \left[ {X}_{k} \right] $$

Clearly for $ n = 2, 3 $ the optimal $ \hat{k} $ is $ 1 $.
Yet for any other $ n $ it is better to keep rolling.

This is counter intuitive as the probability to have zero in infinite number of rolls is 1:

$$ \lim_{k \to \infty} \mathbb{P} \left( Y = k \right) = 0 $$

Arguments about dealing this case, including better objective function, are described in @Gareth McCaughan's answer.

Simulation Code

Simple MATLAB code to play with:


numTrials = 2e7;
numRolls = 60;

numSides = 4;

mRolls = randi([0, numSides - 1], [numRolls, numTrials]);
mProd = cumprod(mRolls, 1);
vR = mean(mProd, 2);

plot(1:numRolls, vR);

vK = ((numSides - 1) / numSides) .^ (1:numRolls);
vE = (numSides / 2) .^ (1:numRolls);

vP = vE .* vK;
[~, maxK] = max(vP)

  • 1
    $\begingroup$ The parts where you said "clearly" and then wrote more equations is making me think I should have finished more school. I haven't touched MATLAB in over decade, so I can't check that either, but did it help inform you of anything? $\endgroup$ Feb 9 '19 at 13:59
  • $\begingroup$ @DarkThunder, It just verified the Math. It was: Think about it, Formulate the Math then verify it in MATLAB. $\endgroup$
    – Royi
    Feb 9 '19 at 16:33

Ok I am going to try a trick in the wording.


you said "you must bet everything you have made", and that penny I already have is not something I have technically made but something I own already. I should keep on betting all of what I have made (excluding the first penny)

I should keep on playing forever.

But what if I get a zero when I just have a penny? Not sure about that.


I guess before this puzzle becomes stale I wanted to share my thoughts on it and see what people think. This puzzle is a bit of a joke, as I think most people got, which is that math seems to tell us to play forever even though that is, arguably, the one wrong answer.

Just because the math is wonky, doesn't mean that there isn't a reasonable approach to answering it. If Warren Buffet went crazy and decided to play this game with you, such that his entire multi-billion dollar fortune was at stake, where would you stop? I don't claim to have the math perfect but as I see it you have something like a 11% chance of taking all of his money assuming you wanted to shoot for that.

The more we ground this question in reality, the more problems it would have. I'm not talking about Canadian pennies having no value (they do) or limits on how much money anybody would actually pay out because that shouldn't change the approach you would have. Other complications I thought of:

  • You could probably figure out some kind of insurance plan where a big bank pays you a fixed amount and they collect your actual winnings, up to whatever point they specify.
  • Taxes. Probably not a huge issue in the scheme of things.
  • If you play this game for charity, vast amounts of money won't lose their utility like they would for someone playing for themselves. I have no idea how to approach that so let's just say you are playing selfishly.

Like Gareth McCaughan suggested, money has decreasing utility the more of it you have, but I feel like that isn't quite the right perspective to have. If your husband has cancer and needs a $100,000 treatment, I imagine you aren't going to be weighing the utility of money beyond that point. I think the right approach is understanding what you stand to lose at every stage, and weighing it against what you stand to gain in terms of what you would actually buy.

I would suggest making a list of things that you can't really currently afford that would solve a big problem you have. Do you worry about your car breaking down? A newer car would would give you peace of mind. Don't like where you live? A down-payment on a new house would solve that. Hate your job? Maybe enough money would let you open that restaurant you always wanted. Alternately you could win enough money to retire right now but that can cause a whole world of new problems for you if you don't know how to keep yourself busy. Read up on stories of lottery winners if you want examples.

The opposite approach, which is asking yourself "what is something I'd like to have?", is where people make bad financial decisions. Wanting a huge mansion with a few Bugattis in the garage is fine but you should appreciate how far beyond the point of fixing a problem that goes. This undoubtedly ties in to why studies show that there is something of a threshold for where a person's income stops having a meaningful impact on their reported happiness.

Anyway, to tie this up, when you sum up things that fix problems you have, that is a reasonable upper-end stopping point for the game. You may want to stop earlier, depending on which items you may not be willing to risk, but going beyond that falls in the category of being needlessly greedy. I didn't spend long calculating it for myself, but personally I would stop in the range of 3-years worth of my current salary. My odds of getting there aren't great, though, I'm only looking at a 25% chance. What's interesting is how my answer has almost nothing to do with the actual odds of the game... so if the die were a D20 instead I would still stop at the same dollar amount.


One thought not already expressed by the above answers is the focus on the line "Whatever you roll, that's what I multiply your bet by and give back to you." Previous posters assumed that the amount returned would be in something other than pennies, but what if the return is X times your winnings, still in pennies?

Guess what? Canadian pennies are worthless. The country did away with them, and they have $0.0 worth.

The gamble is pointless.

  • $\begingroup$ Don't understand the down votes.. Canadian pennies, which the OP identified as using in a comment, have 0 value as Canada discontinued the use of the penny. My answer solves the question legitimately and accurately... $\endgroup$
    – mkinson
    Feb 8 '19 at 16:44
  • 2
    $\begingroup$ I bet the metal in a billion dollars of Canadian pennies is worth quite a lot. $\endgroup$
    – Gareth McCaughan
    Feb 9 '19 at 0:25
  • $\begingroup$ If that's the answer, I would be disappointed. $\endgroup$
    – DSM
    Feb 9 '19 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.