Fair Coin for 1/3 and 2/3

Simulating Coin Flips for One Third Probability is a medium quant interview question on Combinatorics.

Difficulty Medium Topic Combinatorics

This interview question is about constructing nontrivial probabilities from a perfectly fair random source, in this case a fair coin. The setup asks for a way to simulate two separate events with different target probabilities, both of which are simple rational values but not directly realizable from a single toss. The candidate must design a scheme based on repeated coin flips that guarantees the correct long-run frequencies, while also ensuring that the two events behave independently. This type of construction appears in quant research and electronic trading roles, where one often has access to uniform randomness but needs to generate more complex distributions.

To answer it well, a candidate must recognize the need to map sequences of equally likely outcomes into outcome classes with the desired ratio, and to handle any leftover sequences via rejection or repetition. The problem leans on ideas from combinatorics, discrete probability, and basic measure-theoretic thinking about sample spaces. Interviewers look for a clear argument that the method is unbiased, terminates almost surely, and preserves independence, as well as for awareness of efficiency trade-offs in the chosen construction.

What it tests

When simulating events with arbitrary probabilities using a uniform random source (like a fair coin), the core idea is to partition the outcome space of repeated trials into equally likely sequences, then assign these sequences to the desired events in proportion to their target probabilities. This works because repeated independent trials generate a uniform distribution over all possible outcome sequences, allowing us to approximate any rational probability as a ratio of counts. The method is fundamentally about matching the ratio of assigned sequences to the desired probability, and if the total number of sequences isn't a perfect multiple, we can either ignore some outcomes (rejection sampling) or repeat the process. This principle holds because the uniformity of the underlying random process ensures fairness in the assignment, and the law of large numbers guarantees the simulated event frequencies converge to the target probabilities as the number of trials increases.

Practise this question with written feedback, or hear it in a spoken mock interview.

Get started free