AI Hints
Statistics & Math for ML · Lesson 29 of 138

Independent Events

Multiply them.

⏱ 2 min read▶ Video at 32:41🎓 Free
Watch this lesson in the Statistics & Math for ML courseWatch on YouTube ↗Full Statistics & Math for ML course

Two events are independent if one happening doesn't change the chance of the other. A coin doesn't remember its last flip. For independent events, the chance of both is the two probabilities multiplied together.

Independent Events
From the video: Independent Events
  • One doesn't affect the other
  • Coins have no memory
  • Both: multiply

Multiply, then check

Two heads in a row is a half times a half, a quarter. Three sixes in a row is a sixth, cubed, which is one in two hundred and sixteen. Let's check the three sixes by simulation. Run it. The simulation agrees.

independent.pypython
import numpy as np

print("two heads:", 0.5 * 0.5)
print("three sixes:", round((1 / 6) ** 3, 5))

rng = np.random.default_rng(2)
rolls = rng.integers(1, 7, size=(1_000_000, 3))
print("simulated:  ", (rolls == 6).all(axis=1).mean().round(5))
Output
two heads: 0.25
three sixes: 0.00463
simulated:   0.00471

The gambler's mistake

After five reds in a row on a roulette wheel, many people bet on black, because black feels due. It isn't. The wheel has no memory, so the chance is exactly the same as always. That's called the gambler's fallacy. But be careful. Many real events aren't independent. Rain today makes rain tomorrow more likely.

keyvalue
IndependentP(A and B) = P(A) × P(B)
Coins, diceno memory
Gambler's fallacyblack isn't 'due'
Real lifeoften not independent

Summary

For independent events, multiply the probabilities to get the chance of both. Next, what happens when events do affect each other.

Key takeaways
  • Independent: multiply
  • Simulation agrees
  • No memory, no 'due'
Next up: Conditional Probability — given that