Explain
Intuition
We want to update our belief about the probability of a coin coming up heads () after observing some coin flips (). Bayes' rule is the mathematical formulation of this "belief updating".
Prior: Starting out with a "uniform prior" means we have no idea whether the coin is biased or not. We think any probability between 0 and 1 is equally likely.
Likelihood: This is what the data tells us. If we flip the coin times and get heads, the likelihood is . The data "pulls" our belief towards the observed proportion of heads.
Normalization: To make sure our new belief (posterior) represents valid probabilities and sums to 1, we divide by the integral of all possibilities. The identity provided is just a mathematical shortcut to calculate this area. We end up with a Beta distribution.
When , we just flipped the coin once.
- If it landed Heads (), our updated belief increases linearly towards . It's more likely now that the coin favors heads.
- If it landed Tails (), our updated belief leans towards .
graph TD
A[Uniform Prior: No assumption] -->|Observe Data D| B(Likelihood matches data shape);
B -->|Normalize area to 1| C[Posterior: Updated belief about pi];