LessonThis is a lesson restated in new words. Any figure in it is an example from the source, not this desk's record.

A standard normal draw is one number from the bell curve with mean 0 and standard deviation 1. NumPy produces those numbers. A short function of the density formula draws the theoretical bell. SciPy’s cumulative routine turns a cutoff into the chance of landing below it. With enough draws, a smoothed histogram of the samples sits on the theoretical curve.

Why it matters

The formulas for the density and the cumulative function are easy to recite and awkward to check. Sampling makes the empirical rule visible. The rule says about 68 percent of a normal sample should fall within one standard deviation of the mean. For the standard bell, that interval is negative 1 to positive 1. A plot of the density should be the familiar bell. A plot of the cumulative function should be an S that starts near 0 and rises toward 1. If your code does not do those three things, the code is wrong before any finance use begins.

The idea in plain words

numpy.random.randn returns one standard normal draw. Call it again and you get a different number. That is the point of a random sample. To see the shape, the lecture builds a list of 10,000 such draws, one append per pass. A counter then walks the list and adds one whenever a draw is between negative 1 and 1, including the endpoints. The count in that run was 6,860. With 10,000 draws, 68 percent would be 6,800. The gap is ordinary sample noise.

The density height for a standard normal simplifies because the mean is 0 and the standard deviation is 1. One factor is 1 over the square root of 2 pi. The other is e to the power of negative one-half times x squared. Their product is the height. The lecture codes those factors separately and multiplies them. A line of 10,000 evenly spaced x values from negative 4 to 4, passed through that function and drawn with a Seaborn line plot, produces the bell.

The samples have their own shape. A kernel density plot of the 10,000 draws already resembles the theoretical bell. Raising the sample to 100,000, and extending the axis from about negative 6 to 6, makes the match tighter. The lecture’s moral is convergence: more draws, closer to the curve you wrote from the formula. The theoretical line and the sample line are different objects. One is the model. The other is a finite experiment.

The cumulative function is the integral of the density from negative infinity up to x. Rather than discretize that integral, the lecture imports norm from scipy.stats and calls norm.cdf. At 0, the midpoint of a symmetric standard bell, the result is one half. Half the probability sits below the mean and half above. Calling the same function on every point of the x grid produces a rising S, from near 0 on the far left to near 1 on the far right. Each y value is the area under the bell to the left of that x. By the time x is far into the right tail, almost all of the probability has been included, which is why the S flattens toward 1.

How to use it

Start with a single randn call so you trust the generator, then scale up to a list or an array large enough to count. For the one-sigma check, count the share inside negative 1 to 1 and compare it with about 0.68. Do not require an exact 6,800. Require a count in the neighborhood, and require that a fresh sample moves rather than repeats the old count digit for digit.

What usually goes wrong

People treat 6,860 as a constant. It was one sample of 10,000. Another seed will not reprint it. The check is “near 68 percent,” not “equal to this run.”

Questions people ask

What is a standard normal draw?

It is a draw from a normal curve with mean 0 and with standard deviation and variance both equal to 1. numpy.random.randn returns one such number each time it is called.

How close was the 10,000-draw check?

The lecture counted 6,860 values between negative 1 and 1. The empirical rule points at about 6,800. That is the comparison. It is one sample, not a fixed result.

Why did the cumulative value at zero equal one half?

The standard bell is symmetric around zero, so the area from negative infinity to the mean is half of the total probability. The lecture’s norm.cdf(0) matched that fact.