TwiddleLab / Math / Probability by Simulation
Independent or Not?
What you will learn
- Events are independent when one tells you nothing about the other. A coin has no memory: after five tails, heads is still 1/2.
- Taking things out without putting them back changes what is left, so the next draw depends on the last.
- The bigger the bag, the less one draw matters.
How the lesson goes
Five tails in a row. Is heads due now?
Drag the pin to the chance that the next flip lands heads.
A coin and a candy bag.
Suppose tails keeps coming, and reds keep coming out of the bag. Press each button 3 times and watch the bars.
Test it: 10 000 flips.
Every time five tails come in a row, the next flip is counted. Is heads more likely there?
Independent, or not
Two events are independent when one happening does not change the chance of the other. Coin flips are independent.
Drawing without replacement (not putting it back) changes what is left. The next draw depends on the last one.
Feeling that heads is due after tails has a name: the gambler's fallacy.
Make a bag that almost forgets.
Half the candies are red, and one red is already out. Turn the dial until that changes the chance of red by less than 1 point.
After one red is out of a bag of n, the chance of red is (n/2 − 1)/(n − 1). It moves from 50% by 1/(2(n − 1)), which is under 1 point once n − 1 is over 50.
Game: card counter.
10 cards, 4 of them gold. Before each card, tap the pile it will be. Get 8 smart picks to win. The goldfish just guesses.
Without replacement, the deck changes after every card. Betting on the bigger pile left gives the best chance each time.
Words have memory too.
A toy language model counts which word comes next. Tap a word to use the words from there to the blank. Make "mat" more likely than 50%.
If words were independent, the words before would not change the bars. They do, a lot, so a model that uses context guesses far better.
Memory or no memory?
Drag each pair into the machine it belongs to.
Independent pairs can't affect each other. Drawing without putting back, weather spells and sentences all carry memory from one to the next.
Your big bag against a small one.
Take three reds out of both.
Previous lesson: And, Or: Overlaps Count Once · Next lesson: Trees of Chance · Part of the course: Probability by Simulation
Lessons are interactive and need JavaScript. Turn it on to play them.