Data Interview Question

Race to Roll a Six

bugfree Icon

Hello, I am bugfree Assistant. Feel free to ask me for any question related to this problem

Problem Statement

Alice and Bob are taking turns rolling a fair six-sided die. The first player to roll a "6" wins the game. Alice rolls first. What is the probability that Alice will win?

Solution & Explanation

Step 1: Understanding the Probabilities

  • Probability of rolling a 6: Each player has a 1/6 chance of rolling a 6 on any given roll.
  • Probability of not rolling a 6: Each player has a 5/6 chance of not rolling a 6.

Step 2: Analyzing the Game

  • Alice rolls first, so she has the first chance to win by rolling a 6.
  • If Alice fails to roll a 6, Bob gets a chance to roll.
  • If Bob also fails to roll a 6, the situation resets, and Alice rolls again.

Step 3: Formulating the Probability

The probability that Alice wins on her first roll is simply the probability of rolling a 6:

P(Alice wins in first roll)=16P(Alice\ wins\ in\ first\ roll) = \frac{1}{6}

If Alice fails to roll a 6, and Bob also fails to roll a 6, the game resets, and Alice has another chance to win. This forms an infinite geometric progression:

  • Alice wins in the first round: 16\frac{1}{6}
  • Both fail in the first round, Alice wins in the second round: 56×56×16\frac{5}{6} \times \frac{5}{6} \times \frac{1}{6}
  • Both fail in the first and second rounds, Alice wins in the third round: 56×56×56×56×16\frac{5}{6} \times \frac{5}{6} \times \frac{5}{6} \times \frac{5}{6} \times \frac{1}{6}

Step 4: Infinite Geometric Series

The probability of Alice winning can be expressed as an infinite geometric series:

P(Alice wins)=16+(56)2×16+(56)4×16+P(Alice\ wins) = \frac{1}{6} + \left(\frac{5}{6}\right)^2 \times \frac{1}{6} + \left(\frac{5}{6}\right)^4 \times \frac{1}{6} + \cdots

This is a geometric series with:

  • First term a=16a = \frac{1}{6}
  • Common ratio r=(56)2=2536r = \left(\frac{5}{6}\right)^2 = \frac{25}{36}

Step 5: Sum of the Infinite Geometric Series

The sum SS of an infinite geometric series is given by the formula:

S=a1rS = \frac{a}{1 - r}

Plugging in the values:

P(Alice wins)=1612536=161136=16×3611=611P(Alice\ wins) = \frac{\frac{1}{6}}{1 - \frac{25}{36}} = \frac{\frac{1}{6}}{\frac{11}{36}} = \frac{1}{6} \times \frac{36}{11} = \frac{6}{11}

Conclusion

The probability that Alice will win the game is 611\frac{6}{11}. This solution demonstrates the use of geometric series to solve problems involving repeated independent events.