Skip to content
Glacius
ProbabilityConcept reference

Conditional probability

Conditional probability within a positive-probability event is intersection probability divided by conditioning probability.

On this page 8 sections
  1. Overview
  2. New information changes which outcomes are relevant
  3. A closer look
  4. A closer look
  5. A classifier’s error rate within one subgroup is a conditional rate
  6. Key takeaway
  7. Sources & further reading
  8. Concept connections

01New information changes which outcomes are relevant#

New information changes which outcomes are relevant. Conditional probability measures the share of an event inside the population retained by a condition. The vertical bar in P(AB)P(A\mid B) means “given BB”; the event after the bar chooses the denominator.

Conditional probability asks for the chance of A within event B. Keep only B’s outcomes; B becomes the whole you compare against.

B contains masses 0.2 and 0.3, so its total is 0.5. A selects the first outcome. Its share within B is 0.2 / 0.5 = 0.4.

Original masses are u=.2,v=.3,w=.5. Condition B keeps u and v, total .5. Dividing those retained masses by .5 gives conditional masses .4 and .6; w is excluded.Original masses are u=.2,v=.3,w=.5. Condition B keeps u and v, total .5. Dividing those retained masses by .5 gives conditional masses .4 and .6; w is excluded.
Figure 1Original masses are u=.2,v=.3,w=.5. Condition B keeps u and v, total .5. Dividing those retained masses by .5 gives conditional masses .4 and .6; w is excluded.
Link to this figure ↗Download SVGDownload PNG

Among 100 equally weighted records, suppose 40 have property BB, and 12 of those also have AA. After learning BB, compare 12 with 40: 12/40=0.312/40=0.3. Dividing by 100 would give the chance of both properties before conditioning, not the chance of AA among the retained records.

For P(AB)P(A\mid B):

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

The numerator is shared mass. The denominator is B’s mass and must be positive.

Check your reasoning

P(A)=0.5, P(B)=0.8, P(A∩B)=0.4. Find P(A | B).

Show answer and explanation
0.5

0.4 / 0.8 = 0.5.

02A closer look#

For uniform records, divide the number satisfying both conditions by the number satisfying B. For unequal outcome masses, add the retained weights before dividing.

Check your reasoning

Choose one of 50 records uniformly. 20 have B; 15 of those also have A. Given B, find P(A | B).

Show answer and explanation
0.75

Within B, 15 of 20 qualify: 0.75.

03A closer look#

A condition with zero probability gives a zero denominator, so this ratio does not define a conditional probability. A zero numerator with a positive denominator simply gives 0.

Check your reasoning

P(A)=0.5, P(B)=0.4, P(A∩B)=0.1. A learner gives 0.1 for P(A | B). Repair it.

  1. A0.1
  2. B0.2
  3. C0.25
Show answer and explanation
0.25

Divide shared mass by P(B): 0.25.

04A classifier’s error rate within one subgroup is a conditional rate#

A classifier’s error rate within one subgroup is a conditional rate. Comparing subgroup rates requires keeping each subgroup’s denominator straight. These rates describe an association within the specified data; conditioning alone does not establish causation.

Key takeaway

Restrict to the given condition, then compare the shared mass with that condition’s total. The conditioning mass must be positive.

Sources & further reading

  1. [1]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Conditional probability.” Math behind ML. /learn/p-conditional