Neural Sync Active
Week 2.3: Independence of Random Variables
Registry Synced
Week 2.3: Independence of Random Variables
873 words
4 min read
Reading compass
Now · 1. Intuition: The Product Condition
Week 2.3: Independence of Random Variables
Prerequisites: Joint PMF (Week 1.1: Joint Probability Mass Function (Joint PMF)), Marginal Distributions (Week 1.2: Marginal Distributions) Cross-links: BSMA1002 (Stats 1) — independence of events Core question: When does knowing one random variable tell us nothing about another?
1. Intuition: The Product Condition
In Stats 1, events A and B are independent if P(A∩B)=P(A)P(B). For random variables, independence means every event involving X alone is independent of every event involving Y alone.
The practical equivalent: the joint PMF factorises into the product of the marginals:
>fXY(x,y)=fX(x)⋅fY(y)for all x,y.>
If this holds, X and Y are independent. If it fails for any (x,y), they are dependent.
2. Formal Definition
>fXY(x,y)=fX(x)⋅fY(y).>Definition (Independence of two RVs) X and Y are independent if for all x∈TX, y∈TY:
>fY∣X=x(y)=fY(y)for all x with fX(x)>0.>Equivalently: the conditional PMF equals the marginal PMF:
>fX1…Xn(t1,…,tn)=i=1∏nfXi(ti).>Definition (Mutual independence of n RVs) X1,…,Xn are mutually independent if for all ti∈TXi:
3. How to Check Independence
Recipe:
- Compute marginal PMFs fX and fY by summing over the other variable.
- For every (x,y) pair, check if fXY(x,y)=fX(x)⋅fY(y).
- If any pair violates this, X and Y are dependent.
Shortcut: If there exists a cell (x,y) where fXY(x,y)=0 but fX(x)>0 and fY(y)>0, then X and Y are dependent.
Examples
| Y\X | 0 | 1 | fY |
|---|---|---|---|
| 0 | 1/4 | 1/4 | 1/2 |
| 1 | 1/4 | 1/4 | 1/2 |
| ** fX ** | 1/2 | 1/2 |
Check: fXY(0,0)=1/4=(1/2)(1/2)=fX(0)fY(0). All 4 cells check out → Independent.
| Y\X | 0 | 1 | fY |
|---|---|---|---|
| 0 | 0 | 1/2 | 1/2 |
| 1 | 1/2 | 0 | 1/2 |
| ** fX ** | 1/2 | 1/2 |
Check: fXY(0,0)=0=(1/2)(1/2)=1/4 → Dependent.
4. Important Properties
If X and Y are independent:
- g(X) and h(Y) are independent for any functions g,h.
- E[XY]=E[X]E[Y]
- Var(X+Y)=Var(X)+Var(Y)
- Cov(X,Y)=0 (but the converse is false!)
- MX+Y(t)=MX(t)⋅MY(t) (moment generating functions multiply) For mutually independent X1,…,Xn:
- Functions of non-overlapping subsets are independent
- Example: g(X1,X2) is independent of h(X3,X4)
5. i.i.d. Random Variables
Definition (i.i.d.) X1,…,Xn are independent and identically distributed (i.i.d.) if:
- They are mutually independent.
- All have the same marginal distribution: fXi=fX. The i.i.d. assumption underlies most of statistical inference — it models repeated independent draws from the same population. Example: Repeated tosses of the same coin produce i.i.d. Bernoulli(p) random variables.
6. Pairwise vs Mutual Independence
Warning: Pairwise independence does NOT imply mutual independence. Example (Even parity): X1,X2,X3 each Uniform{0,1}, but the triple has even parity (sum is even).
| X1 | X2 | X3 | Probability |
|---|---|---|---|
| 0 | 0 | 0 | 1/4 |
| 0 | 1 | 1 | 1/4 |
| 1 | 0 | 1 | 1/4 |
| 1 | 1 | 0 | 1/4 |
- Any pair is independent (check: fX1X2(0,0)=1/4=(1/2)(1/2)).
- But the triple is dependent: fX1X2X3(0,0,1)=0=(1/2)(1/2)(1/2)=1/8.
7. Mermaid: Independence Flowchart
(Diagram)
8. Practice Questions
Q1 (Easy)
Test whether X and Y are independent from the joint PMF below:
| Y\X | 0 | 1 | 2 |
|---|---|---|---|
| 0 | 1/9 | 1/9 | 1/9 |
| 1 | 1/9 | 1/9 | 1/9 |
| 2 | 1/9 | 1/9 | 1/9 |
Full SolutionMarginals: fX(x)=1/3 for x=0,1,2, fY(y)=1/3 for y=0,1,2.fXY(x,y)=1/9=(1/3)(1/3)=fX(x)fY(y) for all 9 cells → Independent.
Q2 (Medium)
For the random 2-digit number (Example 2 in Week 1.1: Joint Probability Mass Function (Joint PMF)), are X and Y independent?
Full SolutionFrom the joint table: fXY(0,0)=1/20, fX(0)=1/10, fY(0)=1/4.fX(0)fY(0)=(1/10)(1/4)=1/40=1/20 → Dependent.Indeed, fXY(1,0)=0 while fX(1)fY(0)=(1/10)(1/4)=1/40 confirms dependence.
Q3 (Hard — Even Parity)
Verify that X1 and X2 are independent in the even parity example, but X1,X2,X3 are not mutually independent.
Full SolutionFrom the table: fX1X2(0,0)=1/4, fX1(0)=1/2, fX2(0)=1/2 → 1/4=(1/2)(1/2) ✓ fX1X2(0,1)=1/4=(1/2)(1/2) ✓ fX1X2(1,0)=1/4=(1/2)(1/2) ✓ fX1X2(1,1)=1/4=(1/2)(1/2) ✓So pairwise independent.But fX1X2X3(0,0,1)=0=(1/2)3=1/8. Not mutually independent.
Next topic: Week 3.1: Expected Value — Expected value of a random variable. Join Discord PreviousWeek 2.2: Sum (Convolution), Min & Max of Random VariablesNextWeek 3.1: Expected Value