Thursday, June 23, 2011

Dice game

Two students play a game based on the total roll of two standard dice.  Student A says that a 12 will be rolled first.  Student B says that two consecutive 7s will be rolled first.  The students keep rolling until one of them wins.  What is the probability that A will win?

Solution:

Let p be the probability that student A wins.  We consider the possible outcomes of the first two rolls.  (Recall that each roll consists of the throw of two dice.)  Consider the following mutually exclusive cases, which encompass all possibilities.
  • If the first roll is a 12 (probability 1/36), A wins immediately.
  • If the first roll is a 7 and the second roll is a 12 (probability 1/6 · 1/36 = 1/216), A wins immediately.
  • If the first and second rolls are both 7 (probability 1/6 · 1/6 = 1/36), A cannot win.  (That is, B wins immediately.)
  • If the first roll is a 7 and the second roll is neither a 7 nor a 12 (probability 1/6 · 29/36 = 29/216), A wins with probability p.
  • If the first roll is neither a 7 nor a 12 (probability 29/36), A wins with probability p.
Note that in the last two cases we are effectively back at square one; hence the probability that A subsequently wins is p.
Probability p is the weighted mean of all of the above possibilities.
Hence p = 1/36 + 1/216 + (29/216)p + (29/36)p.
Therefore p = 7/13.

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Use This code in your microsoft office 2010 and you will get p = 1/2

    Sub DiceGameTest()
    Randomize
    Dim NewValue1 As Single
    Dim NewValue2 As Single
    Dim LastValue1 As Single
    Dim LastValue2 As Single
    Dim StudentAwin As Single
    Dim StudentBwin As Single
    Dim Winner As Single

    For i = 1 To 5000000
    LastValue1 = 0
    LastValue2 = 0
    Winner = 0
    While Winner = 0
    LastValue1 = NewValue1
    LastValue2 = NewValue2
    NewValue1 = Int((6 * Rnd) + 1)
    NewValue2 = Int((6 * Rnd) + 1)
    If NewValue1 = 6 And NewValue2 = 6 Then Winner = 1
    If NewValue1 + NewValue2 = 7 And LastValue1 + LastValue2 = 7 Then Winner = 2
    Wend
    If Winner = 1 Then StudentAwin = StudentAwin + 1
    If Winner = 2 Then StudentBwin = StudentBwin + 1
    Winner = 0
    Next i
    total = StudentBwin + StudentAwin
    Selection.TypeText Text:=str(StudentAwin / total)
    End Sub

    ReplyDelete