Probability Techniques

Conditioning: The Law of Total Probability in Interviews

NeetQuant · August 2026 · 5 min read

This is the default move when you do not immediately see a solution. It works far more often than it has any right to.

The law

Partition the sample space into disjoint cases B1, B2, ... that cover everything. Then:

P(A) = P(A | B1) P(B1) + P(A | B2) P(B2) + ...

The same holds for expectations, which is usually the more useful form in interviews:

E[X] = E[X | B1] P(B1) + E[X | B2] P(B2) + ...

The technique

Condition on the first step. What happened on the first flip, the first draw, the first move. Then ask what the problem looks like afterwards.

The magic case - and it is common - is when the remaining problem is identical to the original. Then you get an equation in the unknown and you solve it algebraically.

Worked example

Expected number of fair coin flips to get the first head.

Condition on flip one. With probability 1/2 it is a head and you are done in 1 flip. With probability 1/2 it is a tail and you have used one flip and are exactly back where you started.

Let E be the answer:

E = 1/2 times 1 + 1/2 times (1 + E)

Solving: E = 2.

Notice you never summed a series. The self-reference did the work.

A harder one

Expected flips to see two heads in a row.

Condition more carefully. Let E be the answer from a standing start, and F the expected additional flips given you have just seen one head.

E = 1/2 (1 + F) + 1/2 (1 + E) F = 1/2 (1) + 1/2 (1 + E)

Solve the pair: E = 6.

The skill is choosing the right states. Here "just saw a head" is a state that matters, and noticing that is the whole problem.

Choosing the split

A good partition makes the sub-problems either trivial or identical to the original. If your conditioning produces three cases that are each as hard as what you started with, you split on the wrong thing - back up and try another.

Say it out loud

"I will condition on the first draw" is exactly the sentence that invites a hint if you are heading the wrong way. See thinking out loud.

Keep practising

Practise quant interview questions free

Create a free account to attempt hundreds of questions with hints and answer checking, and to run the timed simulators.

Start practising free

Frequently asked questions

What is the law of total probability?
If events B1, B2, ... partition the sample space, then P(A) is the sum of P(A given Bi) times P(Bi). The same decomposition works for expectations, which is usually the more useful form in interviews.
How do I solve expected-value problems with recursion?
Condition on the first step. If the remaining problem is identical to the original, you get an equation in the answer itself - for example E = 1/2(1) + 1/2(1 + E) gives E = 2 for the expected flips to the first head.