I listened to this episode of The Life Of The Mind by Steven Pinker and was struck by the claim that "the thing about a Poisson process (a purely random process) is that events seem to cluster."
- I thought that this would be a good opportunity for me to:
- Run an experiment to see how it looks
- Integrate Chart.js into my blog
- Here's what I wanted to learn:
- When random events happen, do they really appear in clusters?
- After many trials, what is the distribution of gaps between events?
You can just click START below to see what happens when there are 100 trials. If you increase the Number of trials slider, the experiment will do more trials, which will eventually lead to more 'accurate' results. If you increase the Number of experiments between snapshots slider, you can proceed through the experiment faster, without waiting for each individual trial, one by one.
The code itself can be found on Github.
Probability of event
0.50
Experiment Controls
Number of trials
100
Number of experiments between snapshots
1
Number of milliseconds between trials
0
Progress
Each blue blip represents the event happened. Notice:
- Even with low probability events, the events still often appear in clusters.
- Even with high probability events, the events sometimes appear far away from each other.
Each bar represents how many times did events happen this close to each other? Notice how (over time) it is obvious that events are most likely to appear close to each other.
The red line represents the expected number of times consecutive events will happen this close together. Notice that (over time) the observed values will approach the expected number.