Course contentsShow
← Data Science
Lesson 102 of 2,1453. Probability FoundationsFree lesson

Testing for Independence

Apply the independence criteria to determine if two events are independent using probability calculations and comparisons.

Testing for Independence

You'll learn: How to use probability calculations to check whether two events are truly independent or not.

The Core Idea

In the previous lesson, you learned what independence means: two events are independent when knowing one happened doesn't change the probability of the other. But how do you verify this in practice? You test it using the independence criteria.

Two events A and B are independent if and only if:

P(A and B) = P(A) × P(B)

If this equation holds true, the events are independent. If not, they're dependent.

How to Apply the Test

  1. Calculate P(A) — the probability of event A occurring
  2. Calculate P(B) — the probability of event B occurring
  3. Calculate P(A and B) — the probability both events occur together
  4. Compare: Does P(A and B) equal P(A) × P(B)?

Example

Suppose you flip a coin and roll a die:

  • Event A: coin shows heads → P(A) = 0.5
  • Event B: die shows 4 → P(B) = 1/6 ≈ 0.167

If independent, we expect:

P(A and B) = 0.5 × 0.167 ≈ 0.083

If you actually observe P(heads and 4) = 0.083 in your data or experiment, the events pass the independence test. If you got 0.15 instead, they'd be dependent.

Think of It Like This

It's like checking if two friends make plans separately. If they're independent decision-makers, the chance they both show up equals (chance person A shows) × (chance person B shows). If those numbers don't multiply correctly, one person's decision is influencing the other.

Key Takeaway: Test independence by checking if P(A and B) = P(A) × P(B); equality confirms independence, inequality reveals dependence.