1. Home
  2. Explore
  3. Statistics
  4. Normal Distributions and the Empirical Rule

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Normal Distributions and the Empirical Rule

Speaker 1Speaker 2

Normal Distributions and the Empirical Rule

14:16
0:00-14:16
  1. Maria

    Welcome back. Today we’ll connect several ideas: normal distributions, probability density functions, the Central Limit Theorem, and Monte Carlo simulation. The common thread is learning how to reason about uncertainty—and how to estimate quantities even when we can’t solve them neatly by hand.

  2. Hope

    Let’s begin with the Empirical Rule. It relies on two assumptions about estimation errors: their mean is zero, and their distribution is normal. A normal distribution is also called a Gaussian distribution, after the astronomer Carl Gauss. Those assumptions matter because the Empirical Rule describes what fraction of values lie within certain distances of the mean.

  3. Maria

    Python can generate Gaussian random values with the built-in `random.gauss` function. You provide the mean, often written mu, and the standard deviation, often written sigma. For example, `random.gauss(0, 100)` generates values centered around zero with a standard deviation of 100. Each call will generally give you a different value.

  4. Hope

    If we generate many values and make a histogram, we get a discrete approximation to the Gaussian curve. It won’t look perfectly smooth, because we have a finite number of randomly generated observations. But we should see a peak near the mean, with the frequencies tapering off on either side.

  5. Maria

    The histogram’s `weights` option can change what its vertical axis means. Without weights, each observation counts as one, so a bin’s height is the number of observations in it. If every observation instead gets a weight of one divided by the total number of observations, the bin height represents a fraction of the sample. That makes the vertical axis easier to interpret as relative frequency.

  6. Hope

    And some plotting functions return useful values in addition to drawing a picture. For a histogram, the returned tuple includes the counts or weighted values for the bins, as well as the graphical patches. Keeping those values lets us calculate things like the fraction of observations that fall in a chosen range.

  7. Maria

    For a Gaussian with mean zero and standard deviation 100, a range of 200 around the mean means from minus 200 to plus 200. Since 200 divided by 100 is two, that range is two standard deviations on each side. The Empirical Rule says roughly 95 percent should fall within two standard deviations.

  8. Hope

    In a finite simulated sample, the observed fraction won’t be exactly 95 percent. It may be a little higher or lower. The more precise normal-distribution figure is associated with 1.96 standard deviations, rather than exactly two, so a result slightly above 95 percent within two standard deviations is quite plausible.

  9. Maria

    Now let’s clarify what a probability density function, or PDF, tells us. It describes a curve over possible values of a random variable. The probability that the variable falls between two values is represented by the area under the curve between those values—not by the height at one point.

  10. Hope

    That distinction can be surprising. A PDF’s height is not necessarily a probability, and it can even be greater than one. For a continuous variable, the probability of landing on one exact point is zero. To get a probability, we need a range, and we find the area over that range.

  11. Maria

    Mathematically, a PDF is the derivative of the cumulative distribution function. The cumulative distribution tells us the probability of being at or below a value; the density describes how quickly that cumulative probability changes. Integrating the density over an interval gives the probability of landing in that interval.

  12. Hope

    For a normal distribution, the PDF has a particular formula involving the mean and standard deviation. In code, we can implement that formula as a function of x, mu, and sigma. That calculation is deterministic: given those inputs, it returns a density value. It does not generate a random observation.

  13. Maria

    To draw the curve, choose a sequence of x-values—for example, from minus four to four for the standard normal distribution, where mu is zero and sigma is one. Calculate the PDF at each x and plot the resulting pairs. With x-values close together, the connected points look like a smooth bell curve.

  14. Hope

    Those x-axis values are the values we chose to examine, but the y-axis values are densities, not probabilities. A narrow normal distribution can have a very tall peak—if sigma is small, the height can exceed one by a lot. The meaningful probability is still the area under the curve across a range.

  15. Maria

    We can approximate that area numerically with `scipy.integrate.quad`. It takes the function to integrate, a lower limit, and an upper limit. If the function has additional arguments that we want to hold fixed, we can provide them as a tuple in the optional fourth argument.

  16. Hope

    For example, if our Gaussian function takes x, mu, and sigma, we integrate over x while keeping mu and sigma fixed. So we pass the Gaussian function, the lower and upper x-limits, and a tuple containing mu and sigma. The function returns a tuple: an estimate of the integral and an estimate of the numerical error.

  17. Maria

    That integral lets us check the Empirical Rule directly. We can integrate a Gaussian from mu minus one, 1.96, or three standard deviations times sigma, to the corresponding upper limit. Repeating that with different means and standard deviations shows that the fractions are governed by the number of standard deviations, not by the particular mu and sigma.

  18. Hope

    Why care so much about normal distributions? Because they show up in many real measurements. Examples include SAT and GRE scores, percentage changes in oil prices, and the distributions of men’s and women’s heights. They aren’t universal, though. A roulette wheel’s individual outcomes, for instance, are uniform: each pocket is equally likely.

  19. Maria

    So the Empirical Rule does not describe every original distribution. A single roulette spin is very far from normal. If you bet a dollar, the return might be a loss of one dollar, or a large gain if the winning pocket comes up; the outcomes between those possibilities don’t form a bell curve.

  20. Hope

    But we often care about the average return over many spins, not the return from one spin. That shift—from individual outcomes to averages—is where the Central Limit Theorem becomes important. It explains why normal distributions can be useful even when the original observations are not normal.

  21. Maria

    Here’s the theorem in everyday terms. Take sufficiently large samples from a population, calculate the mean of each sample, and then look at the distribution of those sample means. Those means will be approximately normally distributed. Their average will be close to the population mean, and their variance will be close to the population variance divided by the sample size.

  22. Hope

    A population is the full set of examples we’re interested in, while a sample is a subset of that population. Each sample contains multiple observations, and each sample has its own mean. The theorem is about the distribution you get from those sample means—not necessarily the distribution of individual observations.

  23. Maria

    A continuous die gives us a useful illustration. Imagine rolling a die that can land on any real number between zero and five, with all values equally likely. One roll has a uniform distribution, not a normal one. But if we repeatedly take samples of rolls and calculate each sample’s mean, the distribution of those means starts to take a bell-shaped form.

  24. Hope

    For one roll, the average is near 2.5, which makes sense for a value drawn uniformly between zero and five. The standard deviation of the individual rolls is about 1.44. If each sample contains 50 rolls, its mean is still near 2.5, but the sample means vary much less than individual rolls do.

  25. Maria

    That’s the striking part: the individual values are uniformly distributed, while the means of groups of 50 are much closer to a normal shape. A simulation with a finite number of samples won’t produce a perfect Gaussian curve, but it can show the trend clearly.

  26. Hope

    The same reasoning helps with roulette. The return from one spin is not normally distributed, but the average return over many spins can be approximately normal. It may not be perfectly normal: if the bet is one dollar, the return can’t be less than minus one dollar, so the distribution is cut off on that side.

  27. Maria

    As the number of spins in each average grows, that cutoff matters less to the main region where most averages fall. For example, losing every one of a thousand bets is much less likely than losing every one of a hundred. The average-return distribution therefore looks more normal as the sample size increases.

  28. Hope

    The practical lesson is that when we estimate a mean using sufficiently large samples, the Central Limit Theorem can justify using the Empirical Rule for confidence intervals—even if the original observations aren’t normal. That’s why normal-based reasoning can work for averages of roulette returns, despite the non-normal outcomes of individual spins.

  29. Maria

    Now for a surprising application: estimating pi with randomness. Pi is the constant relating a circle’s circumference to its diameter, and the area of a circle is pi times the radius squared. People knew those relationships long ago, but finding a good numerical value for pi took much more work.

  30. Hope

    The lecture gives a few historical examples. An Egyptian estimate on the Rhind Papyrus was four times eight-ninths squared, or about 3.16. A biblical description of a circular object implies a value of three. Archimedes used a 96-sided polygon to bound pi between 223 over 71 and 22 over 7.

  31. Maria

    Much later, Buffon and Laplace proposed a Monte Carlo approach. Picture a circle of radius one inscribed in a square with side length two. The square’s area is four, and the circle’s area is pi. If we select random points in the square, the fraction that land inside the circle should approximate the circle’s area divided by the square’s area.

  32. Hope

    So if f is the fraction of sampled points inside the circle, then f is approximately pi divided by four. Rearranging gives pi approximately equal to four times f. The more random points we sample, the more reliable that estimate tends to be.

  33. Maria

    A simulation can generate random x- and y-coordinates in the square and use the Pythagorean theorem to decide whether each point lies inside the circle. A point is inside when its distance from the center is at most one. Count the points inside, divide by the total number sampled, and multiply by four.

  34. Hope

    The key is not to expect every larger run to produce a monotonically better estimate. Randomness means one estimate can be farther from pi than the previous one. But as the number of sampled points increases, the overall trend is toward a better estimate, and the standard deviation of the estimates tends to shrink.

  35. Maria

    That distinction matters: a good-looking answer is not enough. We also want a reason to believe it is reliable. The simulation can report an estimate and a standard deviation, and we can use those to construct a confidence interval—such as an interval based on about 1.96 standard deviations for a 95 percent level.

  36. Hope

    A program can keep doubling the number of points until that interval is narrow enough for a chosen precision. For instance, we might want the estimate within 0.005 of the target with 95 percent confidence. We don’t have to know in advance exactly how many samples will be needed; we can run more until the uncertainty is small enough.

  37. Maria

    But there’s an essential caution. Statistics can tell us about the variability and repeatability of a simulation; they can’t tell us whether the simulation correctly represents the real quantity. If we accidentally use two where the geometry requires four, we might still get a very narrow, statistically consistent interval—around the wrong answer.

  38. Hope

    That’s why we need a sanity check. A confidence interval can be statistically valid for the procedure we coded, while the procedure itself is based on a mistake. We should inspect the model, check the formula, and ask whether the result makes sense before trusting it.

  39. Maria

    The broader Monte Carlo recipe is useful beyond pi. To estimate the area of a region R, choose a larger, easy-to-measure region E that contains it. Generate random points in E, find the fraction that land in R, and multiply that fraction by the area of E.

  40. Hope

    And this idea can estimate integrals, too. If we want the integral of sine of x over a region, we can use random points and compare the relevant fractions or areas. Randomness becomes a practical tool for computing something that is not itself random.

  41. Maria

    So today’s ideas fit together: PDFs turn probability questions into areas, numerical integration approximates those areas, and the Central Limit Theorem explains why averages often behave normally. Monte Carlo methods use random samples to estimate quantities like pi or an integral—and confidence intervals help us describe uncertainty, while sanity checks help us catch a flawed model.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent