Calculate Expected Flips for Two Heads Coin Toss
ExperianData Scientist · Technical ScreenLast updated
This interview question evaluates statistical assumptions, formulas, estimation strategy, uncertainty, edge cases, and interpretation in a realistic interview setting. A strong answer for Calculate Expected Flips for Two Heads Coin Toss states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.
Scenario
Experian DataLabs online assessment – core probability section. Several short probability problems are asked back to back, covering coin-flip distributions and conditional probability.
Question
Answer the following:
- You repeatedly flip a fair coin until you obtain two heads (not necessarily consecutive). What is the expected number of flips?
- If you flip a fair coin three times, what is the probability of getting exactly two heads?
- Given two events A and B with P(A) = 0.3, P(B) = 0.5, and P(A ∩ B) = 0.15, compute P(A | B).
- Given two events A and B with P(A) = 0.3, P(B) = 0.4, and P(A ∩ B) = 0.12, compute P(A | B).
Hints
- For waiting-time problems, use the geometric / negative-binomial expectation E[T] = r / p.
- For a fixed number of flips, use the binomial PMF P(X = k) = C(n, k) p^k (1 − p)^(n − k).
- For conditional probability, apply P(A | B) = P(A ∩ B) / P(B), and check whether the events are independent.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.