# A Math Problem

Courtesy LispClub.com:

Sue and Bob take turns rolling a 6-sided die. Once either person rolls a 6, the game is over. Sue rolls first. If she doesn’t roll a 6, Bob rolls the die; if he doesn’t roll a 6, Sue rolls again. They continue taking turns until one of them rolls a 6.

Bob rolls a 6 before Sue.

What is the probability Bob rolled the 6 on his second turn?

I love puzzles which are simple to state but have a fiendishly tricky or counterintuitive answer. I just threw up a page on the xkcd IRC wiki to hold some of the better ones I’ve found over the years. I’ll be adding more over the next few weeks as I remember or find good ones. Feel free to add some of your own!

Edit: Buttons and then Daniel Barkalow got the correct answer first.  Here it is, rot13‘d.  Check your answer against this before posting smugly or people (I) will tease you:  gjb friragl svir bire gjryir avargl fvk, be nobhg gjragl-bar cbvag bar creprag.

## 0 thoughts on “A Math Problem”

1. Actually,

it’s 1/2. We are given the certainty that Bob won the game. So Sue doesn’t matter. Bob wins. The chances of him winning on his second turn are 1/2. The chances of him winning on his third turn are 1/3 and so on.

Liked by 1 person

2. The answer is 1/6. If you take a large enough sample size, each number should come up approximately 1/6 of the time. Regardless though, each roll’s probability is independent of the last. So even if you rolled your die 27,000 times and never got a six, you still only have a 1 in 6 chance of rolling a six on the 27,001 roll.

Like

3. Puzzle: “given that Bob won, what’s the probability he did so on his second turn?”

Jan Flour: ??

medyum: “given that Bob is about to roll his second, what’s the probability he will win right there?”

Like

4. the answer would appear to be 1/6 at first, however you have to take into account totally unrelated circumstances, such as: the dice spontaneously shattering and bob needing to get a five sided dice because sue only owns 1 6-sided dice but apparently owns a 5 sided dice; or the dice randomly shifting position to always fall on the six side because that side has 6 dimples worth of dye and is therefore electromagnetically attracted more to a component in the microwave downstairs, causing it to be highly improbable for bob or sue to roll a six; or theres the possibility that because no one would play this game unless they were drunk or high, that bob intentionally weighted the dice so that the game would take a while and sue would get drunk/high enough for bob to have a chance with her… btw, please make a strip based on this

Like

5. Okay
I think this is a conditional probability.
It’s asking, ‘what is the probability of Bob wining in 2 turns GIVEN bob wins.’

So the formula for conditional probability is the intersection of the two events divided by the condition.
I.e. Pr(2 turns ‘intersect’ Bob-wins)/Pr(Bob-wins)

I’m not sure what the answer is because I don’t remember how to calculate infinite series but yeah… hope this helps clarify things!

Like

6. I’ve got it!

So using the formula in my previous post;
The numerator is just; [(5/6)^3]*(1/6)
The denominator is just; {SUM[(5/6)^(2n-1)]}*(1/6)
which equals; (30/11)*(1/6)

Numerator over denominator gives you the answer!

As for an explanation of the denominator; the denominator stands for the probability that Bob wins (Regardless of how many turns it takes him, so it covers ALL possibilities). In order for Bob to win, the dice has to roll a six on a EVEN turn (Since Bob always goes after Sue). Hence, the probability of Bob wining is the probability of not rolling a six ‘2n-1’ times, followed by the rolling of a six. It is ‘2n-1’ in order to form an odd number regardless what ‘n’ is.
Hence, you sum over all possible values of ‘n.’ The limiting sum formula is a/(1-r) where ‘a’ is the first term in the series and ‘r’ is the ratio in which each term increases by. So hence, the limiting sum has the first term being (5/6) and the ratio being [(5/6)^2].
Following this will get you to the denominator!

Hope this helps!

Liked by 1 person

7. Im not nearly as educated as many people here seem to be, but I read that some are ignoring Sues rolls when Sue is REQUIRED to roll 2 non-sixes in order for the result to take place. That is, Bob cannot roll a 6 before Sue has rolled twice. So Sue rolls a non-6 (5/6), Bob rolls a non-6 (5/6), Sue rolls another non-6 (5/6), and finally Bob rolls his 6 (1/6), which gives us 5^3 / 6^4 or 125/1296 or the 9.65% some are getting. Am I missing something here?

Like

8. Hi,

Define events:

A1: Bob wins in the second throw.
A2: Bob wins.

We need, P(A1|A2) = P(A1,A2)/P(A2) = P(A1)/P(A2)

Now, P(A2) = 5/6*1/6 + 5/6*5/6*5/6*1/6 + …. = 5/6 (Infinite GP).

P(A1) = 5/36.

So, P(A1|A2) = (5/36)/(5/6) = 1/6.

What’s wrong with this?

Like

9. A: Sue wins
B: Bob wins
C: Bob wins in his second turn
D: Sue does NOT win in her first turn

We want to find the probability that Bob wins in his second turn, given that he wins in first place:

P(C|B) = P(C^B) / P(B)

Since B follows logically from C:

P(C|B) = P(C) / P(B)

The probability that the winner is determined in the fourth die toss (Bob’s second) can be easily calculated:

P(C) = (5/6) * (5/6) * (5/6) * (1/6) = 125/1296

Calculating P(B) is a little bit trickier, but not so much. First, we note that, with probability 1, either Sue or Bob must win the game at some point. (The probability that the game hasn’t before the nth die toss converges to zero as n grows. This doesn’t mean that it’s impossible that the game never ends.) And, since they can’t both win at the same time:

P(A) + P(B) = 1

Given that Sue doesn’t win in her first turn, Bob’s chances are exactly the same that they were for Sue before her first turn. So we have:

P(A) = P(B|D) = P(B^D)/P(D)

Since D follows logically from B:

P(A) = P(B|D) = P(B)/P(D) = P(B) * (6/5)

Replacing for P(A) in P(A) + P(B) = 1 gives:

P(B) * (6/5) + P(B) = 1
P(B) = 5/11

(Kudos to Nathanael Nerode for calculating the probability that Bob wins using geometric series!)

So we can calculate the original conditional probability:

P(C|B) = P(C) / P(B) = (125/1295) / (5/11) = 275/1296

Liked by 1 person

10. Could it possibly be 1/6? Since the previous rolls of the dice have no influence on the next roll, it would be just the vanilla chance, just like how flipping a coin 20 times, there’s still a 50% chance that it will be heads or tails, despite the other outcomes.

I’m sure that this takes more than my meager high-schools math, though.

Like

11. Suppose you win when you toss two coins, and they both land heads (which you could interpret as throwing two coins simultaneously, or sequentially, or sequentially with the second toss skipped if you landed tails, which is all equivalent). Probability of winning: 1/2? Not quite; it is actually 1/4, no matter how independent your coins are (they are just combined by the game, which has nothing to do with the tosses themselves being independent). This puzzle is similar, just a bit more complex. There are actually more traps on your way if this comment helped, so don’t think you’re done just yet.

Like

12. I’d have to go with 275/1296 (Bayes)

Although, seriously, life would be so much simpler if we could just go with 5/36.. too bad it’s wrong 😦

Love the blog btw 🙂

Like

13. Not hard…. just 5/6 X 5/6 X 5/6 X 1/6…… The chance that the first three rolls are not a 6 is 5/6 and the chance that the fourth is a 6 is 1/6

Like

14. @ Internetmeme

It wouldn’t be 1/6th, because in order for bob to reach his second throw, there has to be throws prior to it that aren’t a 6.

Like

15. Pingback: Sue and Bob’s dice game

16. Eduardo is right. I’m ashamed not to have used conditional probabilities to do it properly (since I did almost half my modules in statistics in my undergraduate degree), but I used excel basically as follows:

The probability that Bob wins on his n-th turn:

5^(2n-1)/6^(2n)

Therefore the probability that Bob wins at all:

SUM(0<n<infinity)(5^(2n-1)/6^(2n))

Then the probability Bob wins on his second go (conditional on winning):

((5^3)/(6^4))/SUM(0<n<infinity)(5^(2n-1)/6^(2n))

And since I don't have any math program and am not familiar with how to do summations on excel (if it's even possible), I just used the first 200 terms to estimate this at 0.212191 (=275/1296)

125/1296 (i.e. 5/6 * 5/6 * 5/6 * 1/6) is wrong, even though it seems intuitively correct, Bob winning is an initial condition of the puzzle.

(It follows that 125/275 (=5/11) is the chance that Bob will win the game)

Like

17. I have not seen this puzzle since school!

It brought back a few memories I can tell you.

Like

18. you guys are all idiots, if he rolled a six he wins and doesn’t get another turn. game’s over, probability 0

Like

19. vandelz, if 5/11 is the chance that bob wins at all, 1-(5/11)=6/11 is the probability that alice wins. do u c u idiot.

Like

20. f 5/11 is the chance that bob wins at all, 1-(5/11)=6/11 is the probability t ndala

Like

21. f 5/11 is the chance that bob wins at all, 1-(5/11)=6/11 is the probability t berbang router imanda

Like

22. f 5/11 is the chance that bob wins at all, 1-(5/11)=6/11 is the probability t slades retern copmle

Like

23. berendeb slabed of teh comple tv sadece yapaed

Like

24. mistakes”, but that doesn’t appear to be the case. It doesn’t even seem like the author roturned shpoped

Like

25. very nice this blog thanks admin

Like

26. very nice this blog thanks admin

Like

27. The trick to this puzzle isn’t just that we know Bob wins, it’s also knowing that Sue rolls first, so she has a marginally greater chance of winning. Consider this game being played in rounds, then each round Sue has first roll and thus a greater chance of winning each round

Suppose now that instead of taking turns to roll the die, they both roll together. The first to roll a 6 wins, but if they both roll a 6 at the same time, Sue wins by default (to reflect the ‘Sue rolled first’ condition). The Game is the same, as are the probabilities of each player winning. Now the maths…..

Both Sue and Bob have an equal chance of winning except for Sue’s extra 1/6 chance by having a ‘stronger’ 6 than Bob. Sue can win by the 50:50 chance of getting a 6 first, or the 1/6 chance of getting a 6 when Bob does (given Bob has a 6, Sue’s chance of a 6 in that round is 1/6, not 1/36)

So Sue’s chance of winning is (1/6) + (5/6)*(1/2) = 7/12
and Bob’s is (5/6)*(1/2) = 5/12

This shows the bias of Sue rolling first and their equal chance of winning – weighted by 5/6 to make the total probability = 1

As we all know, Bob’s chance of winning in the second round is (5^3)/(6^4) = 125/1296.

So now the conclusion.

The conditional probability for dependant probabilities is P(B|A)=P(A and B)/P(A)

P(Bob winning on 2nd roll | Bob wins) = P(Bob wins AND wins on the second roll) / P(Bob wins)

P(Bob wins AND wins on the 2nd roll) is the same as P(Bob wins on the 2nd roll) because he can’t ‘lose and win on 2nd roll’. So this boils down to:

P(Bob wins 2nd roll)/P(Bob wins)
=(125/1296)/(5/12)
=25/108
= approx 0.23

….I think 🙂

Like

28. Sean, Sue’s chance to win a particular turn pair is 1/6. Bob may lose the 1/36 where both roll a six, but just because Sue doesn’t lose it doesn’t mean she gains an extra 1/36. So Sue has 1/6 and Bob has 5/36, or 6/11 and 5/11 after a complete game. You were close though. 🙂

Like

29. lets face it – if you are losing your hair you are losing your social value… balding people are [understand] the target of laughter of people with thick heads of hair
“I may be an exception to the rule but literally days after using Nioxin Shampoo my hair loss literally STOPPED ! No more hair in the bathtub drain. That was 5-6 years ago and I am still enjoying the results! Also, I only used the product for a short while and today I am still not losing hair. I am going to make some more purchases anyways and the shampoo does feel good too. I did not grow back any hair and did not expect to either. I could kiss someone for this product!”

Like

30. And I thought I was so swift, getting to an (incorrect) solution nice and quick… For those who wanted to simulate:

``` static void Main(string[] args) { int wins = 0;```

``` for (int rounds = 0; rounds < 10000; rounds++) { wins += (runGameRound() ? 1 : 0); Console.WriteLine("{0:p} - {1} / {2}", wins / (float)rounds, wins, rounds); } Console.ReadLine(); } private static bool runGameRound() { //loop until bob wins - discarding non bob wins while (true) { int r = 0; for (; !roll(); r++) ; //check if bob won if (r % 2 == 1) { //check if it is his second turn if (r == 3) return true; return false; } } } ```

``` private static bool roll() { return (r.Next(1, 7) == 6); } ```

Like

31. It was interesting. Issue raised is one of the biggest challenges today. Shall see how far this has gone. Experts agree a lot with this issue.

Like

32. I guess it’s the probability that he rolls a 6 from any event is 1/6.
If he did not hit it on the first one does not matter that his chance to hit it on the second one is higher. Just means he wasn’t lucky.

Like

33. Oh, I think I got it.

5/6 (probability that Sue doesn’t get it from the first *
5/6 (probability he gets it from the first *
5/6 (probability that Sue didn’t get it from the second either *
1/6 (probability that he gets it from the second turn

so… 5/6*5/6*5/6*1/6 = 125 / 1296 = 0.09645061728
I am pretty confident now.

Like

34. One of the modern methods to increase community awareness of the Internet. Nowadays, the Internet has been a very good position in this field achieved.
I’m up for being in a particular field, your information will go to the Internet. Because this method is very simple and reliable. Glad that the visitor field increases conversancy There are sites that.
Thanks for a very nice content site

Like

35. One of the modern methods to increase community awareness of the Internet. Nowadays, the Internet has been a very good position in this field achieved.
I’m up for being in a particular field, your information will go to the Internet. Because this method is very simple and reliable. Glad that the visitor field increases conversancy There are sites that.
Thanks for a very nice content site

Like

36. Until now I did not notice these things. I’m glad you’ve mentioned. I understand what you mean. I must thank you for this article

Like