← Boston Consulting Group Interview Insights
I knew parity arguments were a thing but blanked on how to set them up cleanly under time pressure.
Recognize that the sum of n i.i.d. Bernoulli(p) variables follows a Binomial(n, p) distribution. Then, use the probability generating function (PGF) or the binomial theorem to derive a closed-form expression for the probability that the sum is even, which involves evaluating the PGF at 1 and -1.
Pro tip: Mention that the same technique generalizes to finding the probability that the sum is divisible by k using roots of unity, which is a powerful trick in probabilistic combinatorics and can impress interviewers.
State that the sum S = X1 + ... + Xn follows a Binomial(n, p) distribution, since each Xi is independent Bernoulli(p).
Write the PGF of S as G(z) = (1 - p + p z)^n. The probability that S is even is (G(1) + G(-1))/2.
Compute G(1) = 1 and G(-1) = (1 - 2p)^n. Then the probability is (1 + (1 - 2p)^n)/2.
Check n=1: probability even = 1-p, formula gives (1 + 1 - 2p)/2 = 1-p, correct. Check p=1/2: probability even = 1/2 for any n, formula gives (1 + 0)/2 = 1/2, correct.
State the final answer: P(S even) = (1 + (1 - 2p)^n)/2.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.
Set up a Markov chain with states tracking the last flip outcome, which felt right.
Model the process as a Markov chain with states representing the last flip outcome (H or T) and solve for the expected number of flips from the start until absorption. Alternatively, use conditional expectation by defining E as the expected flips from the start and E_s as the expected additional flips given the last flip, then solve the resulting linear equations.
Pro tip: After solving, verify your answer by simulation or by considering the first two flips: if they match, you stop at 2 flips; if not, you are in a symmetric state and the expected additional flips is the same as from the start, leading to a quick equation.
Identify the states: start (no previous flip), last flip H, last flip T. Let E be the expected flips from start, and E_H, E_T be the expected additional flips given the last flip was H or T respectively.
Write equations based on the next flip: E = 1 + 0.5 E_H + 0.5 E_T; E_H = 1 + 0.5*0 + 0.5 E_T; E_T = 1 + 0.5 E_H + 0.5*0. Note symmetry: E_H = E_T.
Using symmetry, let E_H = E_T = x. Then x = 1 + 0.5 x => x = 2. Then E = 1 + 0.5*2 + 0.5*2 = 3.
Check that the answer makes sense: the expected number of flips is 3. Optionally, verify by simulation or by considering the first two flips: if they match (prob 0.5), stop at 2; if not (prob 0.5), you are back to start, so E = 2*0.5 + (2+E)*0.5 => E = 3.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.