Mathematical Riddle: The Solution

[Blogger Advisory: unspeakable nerdery, use of foul language.]

As promised: the answer to yesterday’s riddle (I know, suspense is killing you)…

Upon closer inspection, maybe I went a bit ahead of myself when I postulated the solution was “really easy”. Note that the explanation below, while somewhat tedious and longwinded, should be perfectly intelligible to anybody with very basic notions of arithmetic and a few sober neurons. If you don’t fit either criteria, feel free to skip to the last paragraph.

The Question

Does one stand better chances of: 1) getting at least one ace with 6 throws of a die, or 2) getting at least two aces with 12 throws?

The Reasoning

First, and without getting into a complete course on stats: whatever probability you find, it better be between 0 and 1. Anything above 1, means in essence that your result would happen more times than the total number of experience (e.g. getting seven ace with six dice), which, most sources agree, would about bring our entire universe down, collapsing under the weight of its own impossibility.

A probability of 1 means that your event will always turn true. In this regard, all those who found p = 1 to either of the previous case (either throwing 6 or 12 dice) have been wasting their life so far: they should be busy getting rich at the nearest casino, where their own laws of probabilities guarantee them one successful draw for every six rolls (pretty good odds, if you ask me) 🙂

Yet, I have to agree that, at first, it may look like a sensible solution (and this is why stats problems are usually so fun): since your probability of getting a given score (say an ace) for one roll of a die is p(x) = 1/6 (with x = 1…6), it’s not completely farfetched to assume that your total probability to get an ace out of 6 draws would be 6 * p(1) = 1. Except that, following the same logic, 7 draws gives you a probability of 7 * p(1) = 7/6, and before you reach the end of this thought, the whole universe has instantaneously disappeared, to be immediately replaced by a more bizarre and inexplicable one, according to Douglas Adams’ 1st Law of Astrophysics.

Unfortunately, the solution is a tad more complicated than that:

Let’s keep things simple and start with two dice. Now, we know the odds of getting any given score for one die are p(x) = 1/6, that is: any of the six faces has an equal probability of coming up. With two dice, the total number of combinations is, quite obviously, 6 * 6 = 36. That is, there are exactly 36 different possible results (1 & 1, 1 & 2, 1 & 3 etc.), each with exactly the same odds of happening. Of these, there are 11 ways we could get at least one ace (1 & 2, 1 & 3 […] 1 & 6, 2 & 1, 3 & 1 […] 6 & 1 and 1 & 1).
Our probability, then, is the ratio of these two numbers: p(at least one ace) = [ways to get at least an ace] / [total number of combinations] = 11 / 36 = 0.30. Roughly one out of three: not bad.

Now, consider more dice: you would find that 3 dice have 91 ways of showing one ace or more, out of 6 * 6 * 6 = 216 total combinations (p = 0.42), 4 dice have 671 out of 1296 combinations (p = 0.52). And so on and so forth. Quite logically, the more dice, the better your chances of getting at least one ace.

All in all, figuring the odds for “1 ace or more” with n dice (basically, situation 1. in the problem above) is rather straightforward for low numbers of dice. It gets tedious for more than 3 or 4 and downright daunting for 12 dice.

Situation 2. requires a slightly more evolved logic. Let’s reduce the case and assume we want at least two aces out of 3 dice. That’s gonna be either A and B, B and C, A and C or all three A, B, C, giving an ace.

Let’s look at the general case systematically and draw the rule (hang on to your hair, that’s where it becomes a teeny bit technical).

Say we got n dice and want to know the odds of getting exactly r aces:

  • Out of our n dice, we know there will be exactly r aces and n-r non-aces. Odds for that are: p(the die gives an ace) to the power of r * p(the die does not give an ace) to the power of (n-r) = (1/6)r * (5/6)(n-r).
  • Now, the odds above are true if we have already decided which r dice, out of the total n, are the “winning” ones. To get the total probability, we must be multiply by the total number of ways to pick r dice out of n.
  • Picking r elements out of of n total is a fairly common operation in stats, the total number of ways to do that is called a “combinatorial”, and it is equal to: (nr} = [n * (n-1) * (n-2) * ... * (n-r)] / [r * (r-1) * (r-2) * ... * 3 * 2 * 1] = n! /1n-r)! r!). Stop hyperventilating: I swear it’s pretty intuitive to figure out as a result, just try with small values (e.g. picking 2 out of 3, or 2 out of 5 etc). But giving the proper explanation to the formula would really tip the scale of this entry from mild technical nerdism into full-blown pedantry (huh? “too late”? bah…).
  • As such, the final formula to get the odds of getting exactly r aces and n-r non-aces is: p(r) = (nr) (1/6)r * (5/6)(n-r)

Last step is to add the odds for each given r (the number of ace we want), so as to cover “r aces or more”. This would be written: p(r) + p(r+1) + p(r+2) + ... + p(n-1) + p(n) (where p(r) is the probability of getting exactly r aces, as shown above).

Depending on the value of r and n, we may want to make our life easier, and point out that the probability of getting r or more aces is: 1 – the probability of getting less than r aces. Alright, this one bit may not sound completely obvious (though it’s rather intuitive), but it’s only a trick to make calculations quicker in cases where r = 1 and n = 6: instead of adding p(1) + p(2) + p(3) + p(4) + p(5) + p(6), you only have to find p(0) and say that the former is 1 - p(0) (since we know that p(0) + p(1) + p(2) + p(3) + p(4) + p(5) + p(6) = 1, the mathematical translation of “probability of getting zero or more aces = always”). Once again, this is only a shortcut, forget about it, if it sounds too arcane for you.

All right, now we got the magic formula to compute the odds of getting r aces or more out of n dice. We can test it with the first results we found above:
for n = 3,
p(getting one ace or more) = p(1) + p(2) + p(3) + p(4) + p(5) + p(6)
= 1 - p(0)
= 1 - (30) * (1/6)0 * (5/6)3
= 1 - (1 * 1 * 125/216)
= 0.42 (matches what we had)

for n = 4,
p(getting one ace or more) = 1 - 625/1296 = 0.52 (bingo again)

And, for 6 dice, we get… (drum rolling)…
p(getting one ace or more) = 1 - p(0)
= 1 - (60) * (1/6)0 * (5/6)6
= 1 - (5/6)6
= 0.665

That was for situation 1.

Situation 2. gives a slightly more complicated result:

With r = 2 and n = 12, using the magic formula:
p(getting two aces or more) = 1 - p(0) - p(1)
= 1 - (120} * (1/6)0 * (5/6)12 - (121} * (1/6)1 * (5/6)12
= 1 - (5/6)12 - 12 * (1/6) * (5/6)11
= 0.619

The Answer

Thus, you have a 66.5% chance of getting one ace or more, out of 6 dice, and 61.9% of getting 2 or more, out of 12. That’s somewhat weaker odds for situation 2.

Just for fun: your chances to get 3+ aces out of 18 rolls of a die are even lower: 59.73%.

The odds (of getting k+ aces out of 6k dice) keep decreasing when the number of dice increases, and slowly move toward a neat 50% for an “infinite” number of dice (i.e., for a big enough number, you’ll get very close to 50%).

The formula above can be used for any values of r (minimum number of aces to obtain) and n (total number of dice)… see below for another common result…

Some Background

This riddle is a famous one, and was initially asked by one of the first alpha blogger there ever was: Samuel Peppy, a renowned 17th Century English diarist.

There is a very nifty online version of his diary, organized as a modern-day blog. It’s very much worth a check. Don’t worry: this present tidbit is probably the only such math-related in the whole of his detailed recollections of life in the times of Cromwell. At the time, Pepys submitted this problem to Isaac Newton, who graciously gave him the best option to win the bet.

Meanwhile, in France, the Chevalier de Méré wondered about the probability of getting at least one “6” in four rolls of a die (0.52) vs. at least one double-six in 24 throws of two dice (0.49: slightly weaker). Pascal gave him the answer. A result that can also be figured from adapting the formula above.

From now on, you shouldn’t lose a single dollar on a game of craps ever again in your life (provided you bring your autistic brother or a very discreet calculator).

Next year, we demystify blackjack.

Filed under: Geek, Too Much Caffeine

4 comments

  1. Nerdish? Yea, but actually not so completely useless, really: the formula above is basically all you need to maximize your earnings at craps.

    Too bad I’m not much into casinos…

  2. Aaron,

    Heh, yea, that would be more accurate.

    Though actually, going that direction, optimal strategy to minimize your losses requires absolutely no mathematical skills at all: leave the table, cash chips and run without ever turning back…

    I’m not quite sure what the House edge is for craps (not much of a gambler, as I said), it’s most certainly a guaranteed loss for even Rain man.
    There again, the topic would warrant more extensive digging whenever I’ll have a chance, but I seem to recall that absolutely no common casino game, with the usual Vegas rules, has an edge in favor of the Player. I know that craps has one of the better odds for “stupid” players (i.e. “optimized” strategy is fairly braindead) , while Blackjack is, against popular belief, viciously bad for the average player (optimized strategies require unnatural mathematical abilities)… That’s about the depth of my knowledge on that.

    I’m actually a bit curious to see what will happen in the next few years, when it will become virtually impossible to prevent people from using either computers or communication devices on a casino floor…

Comments are closed.