Roll one die and every face is equally likely, so the distribution is flat. Roll ten dice and add them up.
What shape does the distribution of the sum make, and where does it peak? Sketch your guess before we run anything.
import numpy as npimport matplotlib.pyplot as pltimport scienceplotsplt.style.use(["science", "no-latex"])TEAL ="#009090"die = np.ones(6) /6# a fair die: each face has probability 1/6fig, axes = plt.subplots(1, 4, figsize=(9, 2.4))pmf = die.copy()for ax, k inzip(axes, [1, 2, 3, 10]):whilelen(pmf) <6* k - k +1: # convolve until pmf is the sum of k dice pmf = np.convolve(pmf, die) ax.bar(np.arange(k, 6* k +1), pmf, color=TEAL, width=0.7) ax.set_xlabel(f"Sum of {k} dice"if k >1else"One die")axes[0].set_xticks(np.arange(1, 7))axes[0].set_ylabel("Probability")fig.tight_layout()plt.show()
As we add dice, the distribution changes from flat to triangular and then approaches a bell. From lecture, the expectation of one die is \(\mathbb{E}[X] = 3.5\) and its variance is \(\mathrm{Var}(X) = \frac{35}{12}\). By linearity of expectation, the sum of \(k\) dice has expectation \(3.5k\). Because the dice are independent, every covariance term in the variance of a sum drops out, so the sum has variance \(\frac{35}{12}k\).
The Gaussian prediction for the sum of ten dice is \(\mathcal{N}(35,\ 350/12)\), determined by the expectation and variance from lecture.
Maybe the bell only appears because the die was fair? Below is a heavily loaded die. Compute the loaded die’s expectation and variance, multiply each by \(k\), and use them to predict the bell.
Change the probabilities to anything you like (they just need to sum to 1). Can you design a die that escapes the bell?
For independent copies of a die, the standardized sum approaches a Gaussian distribution (the central limit theorem). The expectation and variance determine the center and width of the unstandardized sum.
Measurement noise is exactly such a sum of many small independent effects. That is why, when we derive the mean squared error loss in the Linear Models unit, our noise model will be the Gaussian.