Skip to content
Glacius
ProbabilityConcept reference

Conditional independence

Two events are conditionally independent given a positive-probability event when their conditional joint equals the product of their conditional marginals.

On this page 8 sections
  1. Overview
  2. Understand the idea
  3. Normalize filtered counts by the retained total
  4. Take four equally likely records 00, 01, 10, 11
  5. A closer look
  6. Key takeaway
  7. Sources & further reading
  8. Concept connections

01Understand the idea#

Two events can be independent in a whole population yet dependent after filtering, or the reverse. Conditional independence asks the question again inside a specified retained group. Every probability in the check must describe that same group.

Conditional independence tests independence inside a specified event C. The A rate, B rate and joint rate must all describe that same retained population.

Inside C, the A row totals 0.5 and the B column totals 0.4. Their product 0.2 matches the shared cell, so the events are independent given C.

All displayed probabilities are conditional on a positive-probability event C. Columns are B and not B; rows are A and not A. The cells are 0.2 and 0.3 in the A row, 0.2 and 0.3 in the not-A row. Thus within C, A has probability 0.5, B has probability 0.4, and both have probability 0.2, satisfying the product condition.All displayed probabilities are conditional on a positive-probability event C. Columns are B and not B; rows are A and not A. The cells are 0.2 and 0.3 in the A row, 0.2 and 0.3 in the not-A row. Thus within C, A has probability 0.5, B has probability 0.4, and both have probability 0.2, satisfying the product condition.
Figure 1All displayed probabilities are conditional on a positive-probability event C. Columns are B and not B; rows are A and not A. The cells are 0.2 and 0.3 in the A row, 0.2 and 0.3 in the not-A row. Thus within C, A has probability 0.5, B has probability 0.4, and both have probability 0.2, satisfying the product condition.
Link to this figure ↗Download SVGDownload PNG

Suppose a condition retains 20 records, with 10 showing AA, 8 showing BB, and 4 showing both. Within the retained group, the marginal rates are 10/20=0.510/20=0.5 and 8/20=0.48/20=0.4. Their product 0.2 matches the joint rate 4/20=0.24/20=0.2. Using the original population size for only one rate would mix incompatible quantities.

Compare this with P(ABC)P(A\cap B\mid C):

P(AC)P(BC)P(A\mid C)P(B\mid C)

Require P(C) > 0. A zero rate for A inside C is allowed; it makes both the product and shared rate zero.

Check your reasoning

P(C)=0.5. Within C: A rate 0.6, B rate 0.4, both rate 0.24. Independent given C?

  1. AYes: product 0.24.
  2. BNo: product 0.24.
  3. CYes: product 1.
Show answer and explanation
Yes: product 0.24.

Within C: 0.24 = 0.24.

02Normalize filtered counts by the retained total#

Normalize filtered counts by the retained total. If C keeps 20 uniform records, with A=10, B=8 and both=4, the within-C product 0.5 × 0.4 matches the joint 0.2.

Check your reasoning

Of 80 records, C keeps 20. Within C: A 10, B 8, both 6. Choose uniformly within C. Independent?

  1. AYes: product 0.2.
  2. BNo: product 0.2.
  3. CNo: product 0.9.
Show answer and explanation
No: product 0.2.

Within C: 0.2 ≠ 0.3.

03Take four equally likely records 00, 01, 10, 11#

Take four equally likely records 00, 01, 10, 11. A means first bit 1; B means second bit 1. Overall they are independent. Keep only equal bits: 00, 11. Inside that condition, the joint is 0.5 but the product is 0.25.

Check your reasoning

P(C)=0.2. Within C: A rate 0.5, B rate 0.6, both rate 0.2. “Independent overall, so in C too.” Independent in C?

  1. AYes: product 0.3.
  2. BNo: product 1.1.
  3. CNo: product 0.3.
Show answer and explanation
No: product 0.3.

Within C: 0.3 ≠ 0.2.

04A closer look#

Probabilistic models sometimes assume features are independent after conditioning on a class. That is a modeling assumption to examine, not a consequence of unconditional independence. Filtering can change relationships because it changes which combinations remain possible.

Key takeaway

Use the same condition for every probability in the product check. Overall independence does not automatically survive a filter.

  • Check the product inside the stated condition.

Sources & further reading

  1. [1]

Reference this concept

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

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