What Is Conditional Probability? Examples and Formulas

You roll two dice and want the sum to be 8. Then someone tells you the first die landed on 5. Your odds just changed, and conditional probability is the exact math for how much.

By Petrus Sheya

July 28, 2026 · 7 min read

You roll two dice. What's the probability the sum is 8?

Easy enough, there are 36 equally likely outcomes and 5 of them sum to 8, so it's 5/36.

Now someone peeks at the first die and tells you it's a 5. Does that change anything?

It absolutely does. And figuring out exactly how much it changes, no more, no less, is the entire job of conditional probability.


Probability isn't fixed, it depends on what you know

Here's the shift in thinking. Plain probability answers "out of everything that could happen, how often does this happen?" But the moment you learn something new, "everything that could happen" shrinks.

Once you know the first die is a 5, the other 35 dice-roll combinations are simply gone. They can't happen anymore. You're not looking at a smaller slice of the same world, you're looking at a whole new, smaller world.

That's the entire idea. Everything else is bookkeeping.


Shrinking the room

Picture a bouncer at a door. Every outcome in your sample space wants in, but the bouncer only lets outcomes through that match some condition, call it event BB. Once you're inside, the room only contains outcomes where BB happened.

Now ask: of the people left in the room, what fraction also satisfy some other event AA? That fraction is the conditional probability, written P(AB)P(A \mid B), read "the probability of AA, given BB."

Roll two dice: 36 equally likely outcomes. Green squares are event A, "doubles." Flip the switch and watch every outcome outside event B vanish, only the survivors count anymore.

1,11,21,31,41,51,62,12,22,32,42,52,63,13,23,33,43,53,64,14,24,34,44,54,65,15,25,35,45,55,66,16,26,36,46,56,6
P(A)0.167
P(B)0.417
P(A | B)0.200

Watch what happens when you flip the switch. The full 36-outcome grid is your whole world. Event BB (sum at or above your chosen threshold) is the bouncer's rule. Flip "condition on BB" and everything outside it fades away, only the room's occupants matter now. Event AA ("doubles") was always the same six squares, but its share of the room changes completely depending on how big or small the room is.

Slide the threshold down so BB becomes "sum 2\geq 2", basically everyone gets in, and P(AB)P(A \mid B) barely moves from P(A)P(A). Slide it up to "sum 11\geq 11", the room shrinks to almost nothing, and doubles suddenly make up a much bigger share of what's left.

We write this as:

P(AB)=P(AB)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)}

That's it. The numerator is "how much of the room is both AA and BB." The denominator is "how big is the room." Divide, and you get a fraction within the room, not within the whole original world.

Let's check it against the dice question from the intro. Given the first die is 5, the room has 6 outcomes: (5,1) through (5,6). Only one of them, (5,3), sums to 8. So P(sum=8first=5)=1/6P(\text{sum}=8 \mid \text{first}=5) = 1/6, not 5/36 anymore. Knowing the first die didn't just narrow things down, it changed the answer by a lot.


When new information doesn't matter

But sometimes learning BB changes nothing at all. If I tell you the first coin flip was heads, does that shift your guess about the second flip? No, coins don't remember. That's called independence, and it's the special case where P(AB)=P(A)P(A \mid B) = P(A) exactly.

Drag circle B into circle A. The overlap is P(A ∩ B). Watch P(A | B) below, it's just that overlap measured as a fraction of B alone.

AB≈ independent here: P(A|B) ≈ P(A)
P(A), P(B)0.40, 0.30
P(A ∩ B)0.117
P(A | B)0.389
P(B | A)0.292

Drag circle BB around. The overlap between the two circles is P(AB)P(A \cap B), and P(AB)P(A \mid B) is just that overlap measured as a fraction of BB alone, not of the whole picture. Drag BB far away and the overlap vanishes, so P(AB)=0P(A \mid B) = 0. Drag it fully inside AA and every bit of BB counts toward AA too, so P(AB)=1P(A \mid B) = 1.

Somewhere in between, there's a single spot where dragging BB a little in either direction barely moves P(AB)P(A \mid B) away from the plain, unconditional P(A)P(A). That spot is independence, and it's not that AA and BB have nothing to do with each other geometrically, it's that BB's overlap with AA happens to sit at exactly the "average" rate. Nudge it any further and dependence, positive or negative, shows up immediately.

Formally, AA and BB are independent exactly when

P(AB)=P(A)P(AB)=P(A)P(B)P(A \mid B) = P(A) \quad \Longleftrightarrow \quad P(A \cap B) = P(A) \, P(B)

Both versions say the same thing: knowing BB told you nothing new about AA.


Probabilities that update as you go

Real situations rarely hand you one clean condition and stop. More often, evidence arrives step by step, and each step changes the odds for the next one.

Think of an urn with red and blue balls. Draw one ball, don't put it back, then draw again. The first draw is unconditional, straight off the composition of the urn. But the second draw depends on what happened first, because the urn's contents actually changed.

Set how many red balls start in the urn, then draw twice without putting the first one back. Watch the second branch's odds shift because of the first draw.

0.500.500.400.600.600.40R,Rp=0.200 · n=0R,Bp=0.300 · n=0B,Rp=0.300 · n=0B,Bp=0.200 · n=0
trials0
P(R,R) theory0.200
P(R,R) observed0.000

Set the starting mix, then draw twice. Notice the numbers labeling the second-level branches aren't fixed, they depend on which first branch you took. Draw a red ball first, and the "second red" branch gets a little less likely, because there's one fewer red ball left to draw. The tree is conditional probability made visible: every branch after the first is a probability given everything above it.

Rearranging the conditional probability formula from earlier gives us the multiplication rule:

P(AB)=P(A)P(BA)P(A \cap B) = P(A) \, P(B \mid A)

Follow any single path through the tree from root to leaf, and multiplying the branch probabilities along the way gives you exactly this. It's the same formula as before, just read in the other direction, instead of dividing to find a conditional probability, we're multiplying conditional probabilities together to find a joint one.

Here's a compact example. Draw two cards from a full deck, no replacement. P(both aces)=P(1st ace)×P(2nd ace1st ace)=452×3510.0045P(\text{both aces}) = P(\text{1st ace}) \times P(\text{2nd ace} \mid \text{1st ace}) = \frac{4}{52} \times \frac{3}{51} \approx 0.0045. Notice the second fraction changed, one ace is already gone.


Testing it on real data

Conditional probability shows up constantly outside of dice and cards, anywhere two things might be related. Does rain make you late for work? Does a symptom actually point to a diagnosis? The tool for checking is the same one we've been building.

200 commutes: rainy vs. dry, late vs. on time. Row and column totals never change, only how they're split. Drag dependence up and watch late arrivals cluster on rainy days.

15Rain, Late45Rain, On time35No rain, Late105No rain, On timeLate | On timeP(Late | Rain) = 0.250P(Late | No rain) = 0.250P(Rain | Late) = 0.300P(Rain | On time) = 0.300P(Late) = 0.250, P(Rain) = 0.300independent: rows match P(Late)
P(Late | Rain)0.250
P(Late | No rain)0.250
gap0.000

This table always has the same row totals and the same column totals, 60 rainy commutes, 140 dry ones, 50 late arrivals, 150 on-time ones, no matter what you do. Only the split inside each row changes as you drag. At dependence 0, the table is arranged so P(LateRain)P(\text{Late} \mid \text{Rain}) and P(LateNo rain)P(\text{Late} \mid \text{No rain}) come out identical, that's independence sitting quietly at one exact configuration among countless possible tables sharing those same totals.

Push the slider up and watch the two conditional probabilities pull apart. The totals never lied to you, only the relationship between the two variables did. This is exactly why you can't judge whether two things are connected just by looking at overall counts, you have to look at the conditional breakdown.


Where this shows up

Medical testing lives on this idea. A test being "95% accurate" isn't the same as "95% chance you're sick if you test positive", those are two different conditional probabilities, P(positivesick)P(\text{positive} \mid \text{sick}) versus P(sickpositive)P(\text{sick} \mid \text{positive}), and mixing them up is one of the most common statistical mistakes people make.

Spam filters compute P(spamthese words)P(\text{spam} \mid \text{these words}) constantly, updating as each word in an email gets processed, exactly like the urn tree updating branch by branch.

Weather forecasts, insurance pricing, A/B tests, search engine rankings, all of it ultimately asks the same question this whole post has been asking: given what we now know, how should our estimate change?


The short version

Conditional probability isn't a different kind of probability, it's ordinary probability measured inside a smaller world, one where you've thrown out everything inconsistent with what you now know.

The formula:

P(AB)=P(AB)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)}

Three things worth keeping. Conditioning shrinks the sample space, it doesn't reweight the old one. Independence is the single special case where the shrinking changes nothing, P(AB)=P(A)P(A \mid B) = P(A). And the multiplication rule, P(AB)=P(A)P(BA)P(A \cap B) = P(A)P(B \mid A), lets you build up joint probabilities one piece of evidence at a time, which is exactly how real evidence actually arrives.

Every time you catch yourself asking "okay, but given that, what are the odds now?", you're already doing conditional probability. The formula just makes it precise.