Intuition What this page is for
The parent note Independence — formal definition gave you the rules. This page throws every kind of case at you: discrete tables, continuous densities, honest traps where the support lies, degenerate constants, limiting behaviour, a word problem, and an exam twist. After this you should never meet an independence question that surprises you.
Before anything, let's state the tests carefully — including the events version we'll need later — so nothing on this page is invoked before it's defined.
Definition The formal test (general → concrete)
General (events form). X and Y are independent iff for all sets A , B ⊆ R ,
P ( X ∈ A , Y ∈ B ) = P ( X ∈ A ) P ( Y ∈ B ) .
This is the master definition (from the parent). Everything below is a special case of it.
Concrete forms. X ⊥ Y iff the joint object equals the product of the two marginals at every point :
Discrete: p X , Y ( x , y ) = p X ( x ) p Y ( y ) for all x , y .
Continuous: f X , Y ( x , y ) = f X ( x ) f Y ( y ) (a.e.).
Definition Symbols used on this page (plain words)
E [ Z ] = the expectation ("long-run average value") of a random variable Z : for a density, E [ Z ] = ∫ z f Z ( z ) d z ; for a table, a probability-weighted sum ∑ z p Z ( z ) . Formal home: Covariance and correlation .
Cov ( X , Y ) = E [ X Y ] − E [ X ] E [ Y ] = the covariance , a single number measuring linear co-movement of X and Y . Formal home: Covariance and correlation .
U ( a , b ) = the Uniform distribution on the interval [ a , b ] : constant density f ( t ) = b − a 1 for a ≤ t ≤ b and 0 elsewhere (every value equally likely). We use U ( − 1 , 1 ) (density 2 1 on [ − 1 , 1 ] ) and U ( 0 , 1 ) (density 1 on [ 0 , 1 ] ).
Common mistake Do NOT overstate the "rectangle" rule
Independence itself is defined purely by the factorisation f X , Y = f X f Y (or the events form) — it does not separately require a rectangular support. The zeros inside f X and f Y can already carve out non-rectangular shapes and still be a genuine product.
The rectangle only appears in the factorisation shortcut : if you spot f X , Y = g ( x ) h ( y ) on a product-shaped support, you may conclude independence without computing marginals . If the support is not a product set, the shortcut is unavailable and you must fall back on the honest test f X , Y = f X f Y .
Two plain-word reminders so nothing here uses an undefined symbol:
The marginal of X is "the distribution of X alone, forgetting Y ." For a table you get it by summing a whole row ; for a density you get it by integrating out the other variable.
The support is just "the set of points where the probability is not zero." Picture it as a shaded shape in the plane.
Every independence question falls into one of these cells. The examples below are labelled by cell so you can see the whole grid is covered.
Cell
Case class
What makes it tricky
Example
A
Discrete table, genuinely independent
must check all cells, not one
Ex 1
B
Discrete table, dependent
one bad cell ruins it
Ex 2
C
Continuous, separable density on a rectangle
density factors → independent
Ex 3
D
Continuous, support couples the variables
density "looks" separable but isn't
Ex 4
E
Degenerate / constant variable
Y takes one value with probability 1
Ex 5
F
Zero-covariance trap
uncorrelated but NOT independent
Ex 6
G
Limiting behaviour
a parameter → boundary flips the answer
Ex 7
H
Real-world word problem
translate words → factorise
Ex 8
I
Exam twist
function of an independent pair
Ex 9
We build one figure for the geometric cases (C, D) so you can see why the support's shape matters. Read the figure as: two shaded regions in the x –y plane . Left = a full unit square shaded blue; a vertical red line at x = 0.35 shows that the allowed y still runs over the entire [ 0 , 1 ] . Right = an orange triangle above the dashed line x = y ; a red line at x = 0.55 shows the allowed y has now been cut down to [ 0.55 , 1 ] . Axes are labelled x (horizontal) and y (vertical), both from 0 to 1 .
The left panel is a rectangle support: for every fixed x the allowed range of y is the same full strip — knowing x tells you nothing about which y are possible. The right panel is a triangle (x ≤ y ): fixing x at the red line chops off everything below it, so knowing x shrinks the possible y . That shrinking is information transfer → dependence.
Worked example Ex 1 · Two fair-ish dice tallies
Joint PMF:
X \ Y
0
1
2
0
0.06
0.15
0.09
1
0.14
0.35
0.21
Are X and Y independent?
Forecast: guess yes or no before reading on. (The rows look suspiciously proportional...)
Step 1 — marginals of X (sum each row).
Why this step? Independence is defined relative to the marginals, so we need them first.
p X ( 0 ) = 0.06 + 0.15 + 0.09 = 0.30 , p X ( 1 ) = 0.14 + 0.35 + 0.21 = 0.70 .
Step 2 — marginals of Y (sum each column).
Why? Same reason, now for the other variable.
p Y ( 0 ) = 0.06 + 0.14 = 0.20 , p Y ( 1 ) = 0.15 + 0.35 = 0.50 , p Y ( 2 ) = 0.09 + 0.21 = 0.30 .
Step 3 — test EVERY cell against p X p Y .
Why every cell? One passing cell is luck; independence must hold everywhere (matrix cell A's whole point).
( 0 , 0 ) : 0.30 ⋅ 0.20 = 0.06 ✅ ( 0 , 1 ) : 0.30 ⋅ 0.50 = 0.15 ✅ ( 0 , 2 ) : 0.30 ⋅ 0.30 = 0.09 ✅
( 1 , 0 ) : 0.70 ⋅ 0.20 = 0.14 ✅ ( 1 , 1 ) : 0.70 ⋅ 0.50 = 0.35 ✅ ( 1 , 2 ) : 0.70 ⋅ 0.30 = 0.21 ✅
Conclusion: all six match → X ⊥ Y .
Verify: the marginals must each sum to 1: 0.30 + 0.70 = 1 and 0.20 + 0.50 + 0.30 = 1 . ✅ And the whole table sums to 1: 0.06 + 0.15 + 0.09 + 0.14 + 0.35 + 0.21 = 1 . ✅
See Joint distribution and marginals for why row/column sums are the marginals.
Worked example Ex 2 · One rebellious cell
X \ Y
0
1
0
0.10
0.30
1
0.30
0.30
Independent?
Forecast: the numbers are "round," so it's tempting to say yes.
Step 1 — marginals. Why? Same as always.
p X ( 0 ) = 0.40 , p X ( 1 ) = 0.60 ; p Y ( 0 ) = 0.40 , p Y ( 1 ) = 0.60 .
Step 2 — test the corner ( 0 , 0 ) . Why start here? If even one cell fails we're done — no need to check the rest.
p X ( 0 ) p Y ( 0 ) = 0.40 ⋅ 0.40 = 0.16 , but the table says 0.10 . 0.16 = 0.10 ✗.
Conclusion: one mismatch is fatal → NOT independent .
Verify: does the table sum to 1? 0.10 + 0.30 + 0.30 + 0.30 = 1 ✅ (so it is a valid PMF — it's just dependent). We can even measure the "gossip": since p X , Y ( 0 , 0 ) < p X ( 0 ) p Y ( 0 ) , seeing X = 0 makes Y = 0 less likely than baseline. See Covariance and correlation .
Worked example Ex 3 · A clean product
f X , Y ( x , y ) = 6 x 2 y on the square [ 0 , 1 ] × [ 0 , 1 ] , and 0 outside.
Forecast: looks like ( stuff in x ) × ( stuff in y ) on a box — probably independent.
Step 1 — confirm it's a valid density (integrates to 1).
Why? If it doesn't integrate to 1 it isn't a density and nothing else matters.
∫ 0 1 ∫ 0 1 6 x 2 y d x d y = 6 ( ∫ 0 1 x 2 d x ) ( ∫ 0 1 y d y ) = 6 ⋅ 3 1 ⋅ 2 1 = 1 ✅
Step 2 — compute the marginals and check they reproduce the joint.
Why this step (not a "rectangle" appeal)? The honest, always-valid test is f X , Y = f X f Y . Integrate out the other variable (note both marginals are 0 outside [ 0 , 1 ] , since the joint is 0 there):
f X ( x ) = ∫ 0 1 6 x 2 y d y = 6 x 2 ⋅ 2 1 = 3 x 2 for 0 ≤ x ≤ 1 (and 0 otherwise), and f Y ( y ) = ∫ 0 1 6 x 2 y d x = 6 y ⋅ 3 1 = 2 y for 0 ≤ y ≤ 1 (and 0 otherwise).
Now multiply: f X ( x ) f Y ( y ) = 3 x 2 ⋅ 2 y = 6 x 2 y = f X , Y for every ( x , y ) in the square — and both sides are 0 outside it. The product rule holds everywhere → independent .
Step 3 — the shortcut, as a cross-check.
Why mention it? Since 6 x 2 y = ( 6 x 2 ) ( y ) splits and the support is the product set [ 0 , 1 ] 2 , the factorisation shortcut also gives independence immediately, without step 2. Both routes agree — but step 2 is the one that always works.
Verify: each marginal integrates to 1: ∫ 0 1 3 x 2 d x = 1 , ∫ 0 1 2 y d y = 1 ✅, and f X f Y reproduces f X , Y as shown ✅.
Worked example Ex 4 · A density that lies
f X , Y ( x , y ) = 8 x y on the triangle 0 ≤ x ≤ y ≤ 1 , else 0 .
Forecast: 8 x y = ( ?) ( ?) splits perfectly... surely independent? Watch the trap.
Step 1 — valid density?
Why? Same sanity gate as before. Integrate over the triangle (for each y , x runs 0 to y ):
∫ 0 1 ∫ 0 y 8 x y d x d y = ∫ 0 1 8 y ⋅ 2 y 2 d y = ∫ 0 1 4 y 3 d y = 1 ✅
Step 2 — look at the support.
Why this step first? The right panel of the figure shows a triangle : fixing x restricts y to [ x , 1 ] . Because the support is not a product set, the factorisation shortcut is unavailable — we cannot read off independence from "8 x y splits." We must run the honest test.
Step 3 — compute the true marginals (integrate out).
Why? To test the product rule honestly we need the real marginals, not the fake split. Both marginals are 0 outside [ 0 , 1 ] (the joint is 0 there):
f X ( x ) = ∫ x 1 8 x y d y = 8 x ⋅ 2 1 − x 2 = 4 x ( 1 − x 2 ) for 0 ≤ x ≤ 1 (else 0 ).
f Y ( y ) = ∫ 0 y 8 x y d x = 8 y ⋅ 2 y 2 = 4 y 3 for 0 ≤ y ≤ 1 (else 0 ).
Step 4 — test.
Why? Independence needs f X , Y = f X f Y everywhere.
f X ( x ) f Y ( y ) = 4 x ( 1 − x 2 ) ⋅ 4 y 3 = 16 x y 3 ( 1 − x 2 ) , which is not 8 x y . → NOT independent.
Verify: each marginal must integrate to 1: ∫ 0 1 4 x ( 1 − x 2 ) d x = 4 ( 2 1 − 4 1 ) = 1 ✅, ∫ 0 1 4 y 3 d y = 1 ✅. Sanity: at ( x , y ) = ( 0.9 , 0.2 ) the joint is 0 (since 0.9 ≤ 0.2 ) but f X ( 0.9 ) f Y ( 0.2 ) = 4 ( 0.9 ) ( 1 − 0.81 ) ⋅ 4 ( 0.008 ) = 0.6840 ⋅ 0.032 = 0 — the product is nonzero where the joint is zero, the classic support failure.
Common mistake The lesson of Cell D
8 x y separates just like 6 x 2 y did — the only difference is the shape of the support. The shortcut is off-limits when the support isn't a product set, so always draw the support and, if in doubt, run the honest test f X , Y = f X f Y .
Worked example Ex 5 · A variable with no randomness
X ∼ U ( 0 , 1 ) and Y = 3 always (a constant). Are X and Y independent?
Forecast: Y never changes — can X tell you anything about a thing that's fixed?
Step 1 — write Y 's distribution. Why? Y has no density (it's not continuous), so we use the events form stated at the top of this page. A constant has P ( Y ∈ B ) = 1 if 3 ∈ B , else 0 .
Step 2 — test the events definition directly.
Why the events form? It's the master definition; both concrete forms are special cases, and here neither the PDF nor PMF form applies cleanly, so we go to the source: P ( X ∈ A , Y ∈ B ) = P ( X ∈ A ) P ( Y ∈ B ) for all A , B .
If 3 ∈ B : LHS = P ( X ∈ A , Y ∈ B ) = P ( X ∈ A ) (because Y ∈ B is certain). RHS = P ( X ∈ A ) ⋅ 1 = P ( X ∈ A ) . ✅
If 3 ∈ / B : LHS = 0 (impossible), RHS = P ( X ∈ A ) ⋅ 0 = 0 . ✅
Conclusion: the factorisation holds for all A , B → independent .
Verify (sanity): a constant carries zero information about anything, so independence is exactly what intuition demands. Every degenerate (a.s.-constant) variable is independent of every other variable.
Worked example Ex 6 · The famous trap
X ∼ U ( − 1 , 1 ) (density 2 1 on [ − 1 , 1 ] ) and Y = X 2 . Show Cov ( X , Y ) = 0 yet X , Y are dependent.
Forecast: Y is literally computed from X , so they can't be independent — but the covariance sensor might read zero.
Step 1 — means. Why? Covariance (defined above as E [ X Y ] − E [ X ] E [ Y ] ) needs E [ X ] , E [ Y ] , E [ X Y ] .
E [ X ] = ∫ − 1 1 x ⋅ 2 1 d x = 0 (odd function, symmetric interval).
E [ Y ] = E [ X 2 ] = ∫ − 1 1 x 2 ⋅ 2 1 d x = 3 1 .
Step 2 — the cross term. Why? Covariance also needs E [ X Y ] , the average of the product.
E [ X Y ] = E [ X ⋅ X 2 ] = E [ X 3 ] = ∫ − 1 1 x 3 ⋅ 2 1 d x = 0 (odd again).
Step 3 — assemble. Why this step? Now that all three pieces are in hand, we plug them into the covariance formula Cov = E [ X Y ] − E [ X ] E [ Y ] to get the single number the "sensor" reports.
Cov = 0 − 0 ⋅ 3 1 = 0 .
Step 4 — but dependent. Why? Independence would need P ( ∣ X ∣ < 0.1 , Y > 0.5 ) = P ( ∣ X ∣ < 0.1 ) P ( Y > 0.5 ) . Yet ∣ X ∣ < 0.1 ⇒ Y = X 2 < 0.01 , so P ( ∣ X ∣ < 0.1 , Y > 0.5 ) = 0 , while both individual probabilities are positive. Product is positive, joint is 0 → not independent.
Verify: Cov = 0 confirmed by Step 3. The moral (see the parent's steel-man and Covariance and correlation ): covariance only senses linear coupling; the ∪ -shaped Y = X 2 is symmetric, so it hides. Independence ⇒ uncorrelated, never the reverse (except Jointly Gaussian random variables ).
Worked example Ex 7 · A knob you can turn
f X , Y ( x , y ) = 1 + θ ( 2 x − 1 ) ( 2 y − 1 ) on [ 0 , 1 ] 2 , with parameter θ ∈ [ − 1 , 1 ] (this is a valid density for those θ ). For which θ are X , Y independent?
Forecast: the "θ ( 2 x − 1 ) ( 2 y − 1 ) " term couples x and y . Guess which single θ kills the coupling.
Step 1 — marginals. Why? Integrate out to find f X , f Y (each 0 outside [ 0 , 1 ] ).
f X ( x ) = ∫ 0 1 [ 1 + θ ( 2 x − 1 ) ( 2 y − 1 ) ] d y = 1 + θ ( 2 x − 1 ) = 0 ∫ 0 1 ( 2 y − 1 ) d y = 1 .
By the same symmetry f Y ( y ) = 1 . So both marginals are Uniform( 0 , 1 ) regardless of θ .
Step 2 — compare joint to product. Why? Independence needs f X , Y = f X f Y = 1 ⋅ 1 = 1 .
We need 1 + θ ( 2 x − 1 ) ( 2 y − 1 ) = 1 for all x , y . The extra term vanishes for all x , y iff θ = 0 .
Step 3 — limiting cases. Why? The matrix's Cell G is about boundary values.
θ → 0 : joint → 1 → independent (the coupling switches off).
θ = + 1 (max): strongest positive coupling — high X favours high Y . Dependent.
θ = − 1 (min): strongest negative coupling — high X favours low Y . Dependent.
Conclusion: independent only at θ = 0 ; every other allowed θ is dependent.
Verify: at θ = 0 , f X , Y = 1 = f X f Y ✅. The covariance also tracks θ : a direct computation gives Cov ( X , Y ) = θ /36 , which is 0 exactly when θ = 0 . Here (unlike Cell F) zero covariance and independence do coincide because the coupling is purely linear.
Worked example Ex 8 · Two machines on the factory floor
Machine A fails on a given day with probability 0.02 ; machine B fails with probability 0.05 . Failures are caused by unrelated internal parts, so we model them as independent. Let X = 1 if A fails (else 0), Y = 1 if B fails (else 0). Find P ( exactly one machine fails today ) .
Forecast: "exactly one" = A fails & B doesn't, OR B fails & A doesn't. Estimate before computing (roughly 0.02 + 0.05 = 0.07 ?).
Step 1 — translate to a joint PMF using independence.
Why? Independence lets us multiply marginals cell-by-cell — that's the entire payoff of the assumption.
p X , Y ( x , y ) = p X ( x ) p Y ( y ) with p X ( 1 ) = 0.02 , p X ( 0 ) = 0.98 ; p Y ( 1 ) = 0.05 , p Y ( 0 ) = 0.95 .
Step 2 — the two "exactly one" cells.
Why these two? "Exactly one" is ( X , Y ) = ( 1 , 0 ) or ( 0 , 1 ) , which are disjoint, so we add.
p ( 1 , 0 ) = 0.02 ⋅ 0.95 = 0.019 ; p ( 0 , 1 ) = 0.98 ⋅ 0.05 = 0.049 .
Step 3 — add. Why add? The two cells are mutually exclusive outcomes, so the probability of "one or the other" is their sum.
P = 0.019 + 0.049 = 0.068 .
Verify: all four cells sum to 1: p ( 1 , 1 ) = 0.02 ⋅ 0.05 = 0.001 , p ( 0 , 0 ) = 0.98 ⋅ 0.95 = 0.931 , and 0.001 + 0.019 + 0.049 + 0.931 = 1 ✅. The answer 0.068 is just under our 0.07 estimate — sensible, since we removed the tiny "both fail" overlap. Compare with the Independence of events version: identical arithmetic, because indicator variables ARE events.
Worked example Ex 9 · Sum and difference
X , Y are independent, each with density f ( t ) = e − t for t > 0 (Exponential(1)). Let S = X + Y . Find the density of S , and comment on whether the two summands stay independent inside S .
Forecast: summing two independent lifetimes — the result should peak at a positive value, not at 0 .
Step 1 — why convolution? Why this tool and not just "multiply"? We're adding independent variables. The density of a sum of independent variables is the convolution of their densities (see Sums of independent random variables — convolution ) — multiplication is for the joint , convolution is for the sum .
Step 2 — set up the convolution.
Why these limits? f S ( s ) = ∫ 0 s f X ( t ) f Y ( s − t ) d t , integrating over all splits t of s with both parts positive: t > 0 and s − t > 0 force t ∈ ( 0 , s ) .
Step 3 — evaluate.
Why? Substitute the exponential densities and simplify the integrand.
f S ( s ) = ∫ 0 s e − t e − ( s − t ) d t = ∫ 0 s e − s d t = s e − s , for s > 0 .
This is a Gamma( 2 , 1 ) density — it rises from 0 , peaks, then decays, exactly as forecast.
Step 4 — the twist. Why ask about the summands? Once you form S = X + Y , knowing S constrains the pair: if S = 2 then X ∈ ( 0 , 2 ) is forced. So X and S are not independent even though X and Y were. New functions of an independent pair need not inherit independence.
Conclusion: f S ( s ) = s e − s for s > 0 (a Gamma( 2 , 1 ) / Erlang density); and S is not independent of its own summand X .
Verify: f S integrates to 1: ∫ 0 ∞ s e − s d s = 1 ✅ (Gamma normalisation). Mean check: E [ S ] = E [ X ] + E [ Y ] = 1 + 1 = 2 , and ∫ 0 ∞ s ⋅ s e − s d s = 2 ✅. Peak of s e − s is at s = 1 (derivative e − s ( 1 − s ) = 0 ), a positive value — matches the forecast.
Recall Which cell does each phrase trigger?
"Support is a triangle" ::: Cell D — dependent; the support couples them and the factorisation shortcut is off-limits, so run the honest test.
"Zero covariance" ::: Cell F — could still be dependent; covariance only sees linear ties.
"One value with probability 1" ::: Cell E — constant is independent of everything (use the events form).
"Sum of independent variables" ::: Cell I — use convolution, and the sum is not independent of its parts.
Mnemonic The safe checklist for ANY independence problem
(1) Compute (or read off) the marginals. (2) Check f X , Y = f X f Y (or p X , Y = p X p Y ) at every point/cell. The rectangle-support shortcut only lets you skip step 1 when the support is a product set — it is a convenience, never an extra requirement.