From standardized test scores and adult heights to manufacturing tolerances and thermal noise, the famous Gaussian Normal Distribution (the "Bell Curve") appears throughout science and statistics:
$$f(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{(x - \mu)^2}{2\sigma^2}}$$
where $\mu$ is the mean (average center) and $\sigma$ is the standard deviation (spread).
The Central Limit Theorem explains why this shape is so universal: whenever many independent random factors are added together, their sum naturally forms a normal distribution!
The area under the normal curve represents probability, and obeys the renowned Empirical Rule (68-95-99.7 Rule):
68.3% of all data falls within $\pm 1\sigma$ of the mean.
95.5% of all data falls within $\pm 2\sigma$ of the mean.
99.7% of all data falls within $\pm 3\sigma$ of the mean.
In this lesson, we use Google Charts' "area" chart type via drawchart(x, y, "area", title, xtitle, ytitle) to shade the continuous probability density under the bell curve! You can also use chart_histogram(data, title, xtitle, ytitle) to automatically group raw data into frequency bins.
drawchart(x,y,"area")
Move the mouse over a dotted box for more information.
Now you try. Compare a narrow bell curve (sigma = 0.8) with a wide one (sigma = 1.6) using plot2!
Type your code here:
See your results here:
The code has ???? for sigma. Replace ???? with 1.0 and click Run to plot the standard normal distribution bell curve!
Notes:
drawchart(x, y, "area", title, xtitle, ytitle) shades the area underneath the curve with a semi-transparent fill.
The peak of the standard normal distribution is at $z = 0$, where $f(0) = \frac{1}{\sqrt{2\pi}} \approx 0.3989$.
Notice that beyond $\pm 3\sigma$, the curve is almost touching zero: fewer than 3 in 1,000 events fall outside this range.
Share your code
Show a friend, family member, or teacher what you've done!