← Statistics

Probability

Conditional Probability & Independence

So far we looked at the probability of a single event, and at independent events such as two coin tosses. But in real data, one thing happening often changes how likely another thing is. Conditional probability is the tool for that.

Independent vs dependent events

Two events are independent if one happening does not change the probability of the other. Two coin tosses are the classic case: getting heads first tells you nothing about the second toss.

Two events are dependent if the first one does change the probability of the second. Think of a customer who first has to open a marketing email before they can click the link inside it. The second event is conditional on the first.

Independent

No influence

The first event does not change the probability of the second.

Example: two coin tosses

Dependent

One shapes the other

The first event changes the probability of the second.

Example: open an email, then click

The conditional probability formula

The notation P(B | A) is read as "the probability of B given A". The vertical bar means "given that": we assume A has already happened and ask how likely B is under that condition. For two dependent events:

P(A and B) = P(A) × P(B | A)

In words: the probability that both happen equals the probability of A, times the probability of B once A has happened. The same equation can be rearranged to solve for the conditional probability:

P(B | A) = P(A and B) ÷ P(A)

These are two views of one equation. Use whichever fits the information you have: the first when you know P(B | A) and want the probability of both, the second when you know the probability of both and want to isolate the condition.

Two overlapping circles A and B with the overlap highlighted; P of B given A is the overlap divided by all of A
Chart 1 Conditioning on A means we only look inside circle A and ask which share of it is also B.

Independence is a special case

If A and B are independent, knowing A tells us nothing about B, so P(B | A) = P(B). The formula then becomes P(A and B) = P(A) × P(B), which is exactly the multiplication rule from Probability Basics.

Example: drawing two hearts

Draw two cards from a standard deck of 52, one after the other, and keep the first card out of the deck. What is the probability that both are hearts?

The second probability is lower than the first, which is what makes the events dependent. Putting it together:

P(2 hearts) = 13/52 × 12/51 = 1/17 ≈ 5.9%

Probability tree for two draws from a deck: 13 over 52 for a heart on the first draw, then 12 over 51 for a heart on the second, giving 1 over 17
Chart 2 Because the first heart stays out of the deck, the odds of the second draw change.

And what if you put the first card back and shuffle? Then the deck is full again, the second draw is 13/52 once more, and the two draws are independent.

Bar chart: the chance of a heart on the second draw is 25 percent if the first card is put back, and about 23.5 percent if it is kept out
Chart 3 The same question, two ways of drawing. Only when the first card stays out does the second probability change.

Example: an email campaign

Imagine you work in e-commerce. Past data shows that 30% of customers open a promotional email, and that 10% of the customers who open it go on to buy. Buying happens after opening, so it depends on it.

P(open and buy) = P(open) × P(buy | open) = 0.30 × 0.10 = 0.03

So 3% of all customers both open the email and buy. Going the other way works too: if you only knew that 3% of customers open and buy, and that 30% open, then P(buy | open) = 0.03 ÷ 0.30 = 10%.

Of 1,000 customers, 300 open the email; of those 300, 30 buy, which is 10 percent of openers and 3 percent of all customers
Chart 4 Illustrative numbers. The condition shrinks the group we look at: from all customers to only those who opened.

Don't mix up the two directions

P(B | A) and P(A | B) are different questions. "Of the customers who opened, how many bought?" is not the same as "of the customers who bought, how many opened?" The condition always decides which group you start from.

Summary of the formulas

SituationFormula
Both events happen (dependent)P(A and B) = P(A) × P(B | A)
Probability of B given AP(B | A) = P(A and B) ÷ P(A)
Independent eventsP(B | A) = P(B), so P(A and B) = P(A) × P(B)

Key takeaway

Conditional probability describes how likely an event is once we know that another one has happened. When events are dependent, the second probability changes, so we multiply P(A) by P(B | A). In business, this is how analysts estimate things like the impact of a campaign on sales, which helps stakeholders decide where to invest.