Tutorials › Exam P - Probability › Diagnosing Conditional Distribution Errors

Exam P · Conditional Distributions and Independence · Tutorial 751 of 915

Diagnosing Conditional Distribution Errors

Learn to calculate conditional laws correctly and to identify common errors involving denominators, supports, zero marginal densities, and independence checks.

Intermediate 12 min read

What You'll Learn

  • Select the correct marginal probability or density for a conditional denominator
  • Normalize a conditional density over the support that remains after conditioning
  • Interpret conditional densities at values where the marginal density is zero
  • Check independence across the full joint distribution rather than one selected case
  • Diagnose common incorrect calculations and replace them with valid ones

Why Conditional-Distribution Errors Are Easy to Make

A conditional distribution describes what remains uncertain after information about another variable has been supplied. The calculation is often short; the harder part is identifying the correct denominator and the range over which the conditional distribution can vary. A denominator from the wrong variable, an unchanged support, or a conclusion based on one convenient case can each produce a plausible-looking but incorrect answer.

This tutorial focuses on diagnosing those errors. For discrete variables, conditional probabilities are ratios of joint probabilities to marginal probabilities. For continuous variables, conditional densities are ratios of a joint density to a marginal density, with the conditional support determined by the joint support. Independence requires a complete factorization check, not a single matching value.

Definition: For discrete \(X\) and \(Y\), if \(P(X=x)>0\), then \(P(Y=y\mid X=x)=P(X=x,Y=y)/P(X=x)\). For continuous \(X\) and \(Y\), if \(f_X(x)>0\), a conditional density is \(f_{Y\mid X}(y\mid x)=f_{X,Y}(x,y)/f_X(x)\) on the values of \(y\) compatible with \(x\), and zero elsewhere. The marginal in the denominator must correspond to the variable being conditioned on.

Start With the Conditioning Variable

The notation \(P(Y=y\mid X=x)\) says that \(X=x\) is the given information. Its denominator is therefore \(P(X=x)\), not \(P(Y=y)\). The numerator is the joint probability of both conditions. In a table, the denominator is found by adding the joint probabilities across the row or column corresponding to the conditioned variable.

For continuous variables, the same direction matters: \(f_{Y\mid X}(y\mid x)\) has denominator \(f_X(x)\). A useful check is to integrate the proposed conditional density over its allowed \(y\)-values. The result must be 1 for each \(x\) where the conditional density is defined. Dividing by \(f_Y(y)\) instead would generally produce a different conditional law, namely one for \(X\) given \(Y=y\).

Worked Example: Choosing the Correct Marginal Denominator

A hypothetical quality audit records whether a component was produced on line A or line B and whether it passes inspection. The joint probabilities are shown below. Find the probability that a component passes given that it came from line A, and determine whether line and pass status are independent.

PassFailMarginal
Line A0.200.300.50
Line B0.100.400.50
Marginal0.300.701.00

Method. The condition is “line A,” so use the line A marginal, \(P(\text{A})=0.50\). The joint probability of line A and passing is 0.20. Thus

$$ P(\text{Pass}\mid \text{A})=\frac{P(\text{Pass},\text{A})}{P(\text{A})} =\frac{0.20}{0.50}=0.40. $$

To check independence, compare this conditional probability with the marginal pass probability, \(P(\text{Pass})=0.30\). They differ, so the variables are dependent. Equivalently, the joint probability 0.20 is not the product \(P(\text{A})P(\text{Pass})=(0.50)(0.30)=0.15\).

Common mistake avoided. Dividing 0.20 by 0.30 uses the pass marginal, giving \(2/3\). That answers \(P(\text{A}\mid\text{Pass})\), not \(P(\text{Pass}\mid\text{A})\). The denominator follows the condition after the vertical bar.

Continuous Conditioning Changes the Support

For continuous variables, \(P(X=x)=0\) at an individual point under an ordinary density model. A conditional density at \(X=x\) is therefore not computed by dividing probabilities of point events. Instead, the density ratio \(f_{X,Y}(x,y)/f_X(x)\) gives a conditional density for values \(x\) where \(f_X(x)>0\), with the ratio understood as a conditional law that is defined almost everywhere.

The support must also be conditioned on. If the joint density is positive only in a triangular or otherwise restricted region, fixing \(X=x\) leaves only the slice of that region at that \(x\). The conditional density must be zero outside that slice and integrate to 1 within it. Using the full marginal range of \(Y\) without checking the joint support can either include impossible values or give the wrong normalizing constant.

Theorem: If \((X,Y)\) has joint density \(f_{X,Y}\), then \(f_X(x)=\int_{-\infty}^{\infty} f_{X,Y}(x,y)\,dy\). For \(f_X(x)>0\), the conditional density is the joint density divided by \(f_X(x)\), restricted to the \(y\)-values allowed at that \(x\). Its integral over those values is 1.

Why the Conditional-Density Formula Normalizes

The ratio formula is not an arbitrary adjustment. It follows from the marginal-density calculation: the marginal \(f_X(x)\) is the total joint density along the slice with fixed \(x\). Dividing the joint density on that slice by its total makes the conditional density integrate to one.

1
Identify the slice.
For fixed \(x\), let \(S_x\) be the set of \(y\)-values for which the joint density can be positive.
2
Compute the marginal.
Integrate the joint density over the slice: \(f_X(x)=\int_{S_x} f_{X,Y}(x,y)\,dy\).
3
Divide by the slice total.
For \(f_X(x)>0\), integrate the proposed conditional density over the slice: \(\int_{S_x} f_{Y\mid X}(y\mid x)\,dy =\int_{S_x} f_{X,Y}(x,y)/f_X(x)\,dy=1\).

This argument also pinpoints a key limitation. If \(f_X(x)=0\), the ratio is undefined, so it cannot be used at that value. A conditional distribution can be specified in different ways at conditioning values that have probability zero; the density-ratio formula determines it only where the marginal density is positive, up to sets of \(x\)-values of probability zero.

Worked Example: Restricting a Conditional Density to Its Slice

Suppose \((X,Y)\) has joint density \(f_{X,Y}(x,y)=2\) when \(0<y<x<1\), and zero elsewhere. Find the conditional density of \(Y\) given \(X=x\), then find \(P(Y<X/3\mid X=0.6)\).

Method. The joint support is triangular. For fixed \(x\) between 0 and 1, the allowed slice is \(0<y<x\). Integrating over that slice gives the marginal density:

$$ f_X(x)=\int_0^x 2\,dy=2x,\qquad 0<x<1. $$

For any such \(x\), \(f_X(x)>0\). Therefore the conditional density is

$$ f_{Y\mid X}(y\mid x)=\frac{2}{2x}=\frac{1}{x}, \qquad 0<y<x. $$

It is zero outside that interval. The normalization check is \(\int_0^x (1/x)\,dy=1\). At \(x=0.6\), the conditional density is \(1/0.6=5/3\) on \(0<y<0.6\). The event \(Y<X/3\) becomes \(Y<0.2\) under this condition, so

$$ P(Y<X/3\mid X=0.6) =\int_0^{0.2}\frac{5}{3}\,dy =\frac{5}{3}(0.2)=\frac{1}{3}. $$

The result checks: the interval \(0<y<0.2\) is one-third the length of the full conditional interval \(0<y<0.6\), and the conditional density is uniform on that slice.

Common mistake avoided. Using \(0<y<1\) as the conditional support ignores the constraint \(y<x\). At \(x=0.6\), values such as \(y=0.8\) are impossible under the joint model. Also, at \(x=0\), \(f_X(0)=0\), so the density ratio cannot be evaluated there.

One Matching Conditional Law Does Not Prove Independence

Two discrete random variables are independent if their joint probabilities factor into the product of their marginals for every pair of values. For continuous variables, independence requires the joint density to factor as \(f_{X,Y}(x,y)=f_X(x)f_Y(y)\) almost everywhere. An equivalent conditional-law check is that the conditional distribution of one variable equals its marginal distribution for almost every conditioning value with positive marginal density.

These are complete checks. Finding one \(x\) for which a conditional probability matches the corresponding marginal probability does not show that the conditional law is the same for all \(x\). Likewise, checking only one cell of a probability table cannot establish factorization throughout the table. A single failure is enough to disprove independence; a claim of independence needs the full relevant check.

Worked Example: A Matching Row Is Not Enough

Let \(X\) take values 0, 1, and 2, and let \(Y\) take values A and B. Their joint probabilities are:

\(X\)\(Y=\text{A}\)\(Y=\text{B}\)\(P(X=x)\)
00.100.100.20
10.200.100.30
20.200.300.50
Marginal0.500.501.00

Method. First calculate the marginal \(P(Y=\text{A})=0.10+0.20+0.20=0.50\). For the row \(X=0\),

$$ P(Y=\text{A}\mid X=0)=\frac{0.10}{0.20}=0.50=P(Y=\text{A}). $$

This one match does not establish independence. Check \(X=1\):

$$ P(Y=\text{A}\mid X=1)=\frac{0.20}{0.30}=\frac{2}{3}\ne 0.50. $$

The factorization check also fails at \((X=1,Y=\text{A})\): the joint probability is 0.20, whereas the product of marginals is \((0.30)(0.50)=0.15\). Therefore \(X\) and \(Y\) are dependent.

Common mistake avoided. The \(X=0\) row happens to have the same conditional proportions as the marginal distribution of \(Y\). Checking only that row would miss the different proportions in the \(X=1\) row. Independence requires the matching property across all rows with positive probability, not just one.

A Reliable Error-Checking Routine

When a conditional distribution looks suspicious, check the calculation in a fixed order. This makes the source of the error visible before relying on a numerical answer.

  1. Read the condition. In a conditional probability or density, identify the variable to the right of the vertical bar. Its marginal belongs in the denominator.
  2. Find the joint support. Fix the conditioned value and determine which values of the other variable remain possible.
  3. Compute the marginal over that slice. Sum joint probabilities in the discrete case or integrate the joint density over the compatible values in the continuous case.
  4. Normalize and check. A conditional probability distribution must sum to 1; a conditional density must integrate to 1 over its conditional support.
  5. Handle zero denominators explicitly. If the conditioning event has probability zero or the marginal density is zero, do not use a ratio with zero denominator.
  6. Check independence completely. Verify factorization throughout the joint distribution, or compare conditional laws with the marginal law for all relevant conditioning values.

These checks matter because conditional distributions are used to calculate probabilities after information is observed and to test whether a model separates into independent components. A wrong denominator reverses the conditioning direction; a wrong support can assign probability to impossible outcomes; and an incomplete independence check can overlook dependence that is present elsewhere in the model.

Key takeaway: For \(P(Y\mid X)\) or \(f_{Y\mid X}\), use the marginal of \(X\), then restrict the conditional law to values of \(Y\) compatible with the joint support. Do not use the ratio when its denominator is zero, and do not infer independence from one matching case.

Check Your Understanding

For each problem, identify the conditioning variable, respect the conditional support, and check whether the requested conclusion follows from the full information given.

  1. A discrete model has \(P(X=R,Y=1)=0.12\), \(P(X=R,Y=0)=0.28\), \(P(X=S,Y=1)=0.18\), and \(P(X=S,Y=0)=0.42\). Find \(P(Y=1\mid X=S)\), and state whether \(X\) and \(Y\) are independent. (Answer: \(0.3000\); independent.)
  2. The joint density is 2 on \(0<y<x<1\) and zero elsewhere. Find \(P(Y>0.5\mid X=0.8)\). (Answer: \(0.3750\).)
  3. The joint density is 1 on \(0<x<1,\ 0<y<2x\) and zero elsewhere. Find \(P(Y<0.5\mid X=0.5)\). (Answer: \(0.5000\).)
  4. A joint table has probabilities \(P(0,\text{A})=0.15\), \(P(0,\text{B})=0.25\), \(P(1,\text{A})=0.15\), and \(P(1,\text{B})=0.45\). Find \(P(Y=\text{A}\mid X=0)\) and determine whether \(X\) and \(Y\) are independent. (Answer: \(0.3750\); dependent.)
  5. A joint density is 2 on \(0<y<x<1\) and zero elsewhere. Can the ratio formula determine \(f_{Y\mid X}(y\mid 0)\) by dividing by \(f_X(0)\)? (Answer: No; \(f_X(0)=0\), so the ratio is undefined at \(x=0\).)
Clinical Biostats