The Normal Distribution

Joel Sanqui (Appalachian State University)

The Gaussian Curve

The Normal (Gaussian) distribution is a continuous probability distribution characterized by its bell-shaped curve.

If \(X \sim N(\mu, \sigma)\), its probability density function (PDF) is:

\[f(x | \mu, \sigma) = \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{1}{2}\left(\frac{x - \mu}{\sigma}\right)^2}\]

  • \(\mu\) (Mean): Locates the center (also the median & mode).
  • \(\sigma\) (Standard Deviation): Controls the spread or scale.

Core Properties & Empirical Rule

  1. Symmetry: Perfectly symmetric around its center \(\mu\).
  2. Inflection Points: Concavity shifts exactly at \(x = \mu \pm \sigma\).
  3. The 68-95-99.7 Rule:
    • About 68% of data falls within \(\mu \pm 1\sigma\)
    • About 95% of data falls within \(\mu \pm 2\sigma\)
    • About 99.7% of data falls within \(\mu \pm 3\sigma\)

Visualizing Parameter Changes

Code
library(ggplot2)

x_vals <- seq(-10, 15, length.out = 500)
df <- data.frame(
  x = rep(x_vals, 4),
  Group = rep(c("N(0,1) - Standard", "N(0,2) - Flatter", "N(5,1) - Shifted", "N(0,0.5) - Taller"), each = 500),
  y = c(dnorm(x_vals, 0, 1), dnorm(x_vals, 0, 2), dnorm(x_vals, 5, 1), dnorm(x_vals, 0, 0.5))
)

ggplot(df, aes(x = x, y = y, color = Group)) +
  geom_line(linewidth = 1) +
  labs(x = "x", y = "Density") +
  theme_minimal() + theme(legend.position = "right")

Figure 1

R Implementation

The Four Core R Functions

Function Name/Purpose Mathematical Meaning
dnorm(x, mu, sd) PDF Height of the curve at \(x\)
pnorm(x, mu, sd) CDF \(P(X \le x)\)
qnorm(p, mu, sd) Quantile \(100 p^{th}\) percentile
rnorm(n, mu, sd) Simulation Generates \(n\) random values

R Examples

Example 1: Finding a Probability (CDF)

If IQ is distributed as \(X \sim N(100, 15)\), find the probability a person scores between 85 and 115:

Code
mu <- 100; sigma <- 15
pnorm(115, mu, sigma) - pnorm(85, mu, sigma)
[1] 0.6826895

Example 2: Finding Percentiles (Quantile)

Find the IQ score that separates the bottom 90% from the top 10%:

Code
qnorm(0.90, mu, sigma)
[1] 119.2233

Standard Normal & Z-Scores

A Normal distribution with mean 0 and standard deviation is called the Standard Normal distribution. A standard normal random variable is usually denoted by \(Z\) and we write \(Z \sim N(0, 1)\).

Any normal variable \(X\) can be standardized using the transformation \[Z = \frac{X - \mu}{\sigma}\]

Historically, areas under a standard normal curve were verified manually via a physical Z-table mapping \(\Phi(z) = P(Z \le z)\) such as https://archive.math.arizona.edu/rsims/ma464/standardnormaltable.pdf.

Example 3: Direct vs Z-score

Let \(X \sim N(50, 5)\). Find \(P(X > 58)\).

  1. Standardize: \(Z = \frac{58 - 50}{5} = 1.6\)
  2. Table/Calculated Value: \(P(Z > 1.6) = 1 - \Phi(1.6)\)
Code
# Direct vs Standardized evaluation
cat("Direct:", 1 - pnorm(58, 50, 5), "\n")
Direct: 0.05479929 
Code
cat("Z-score:", 1 - pnorm(1.6, 0, 1))
Z-score: 0.05479929

Mean and Variance Derivation

  1. Define the Standard Normal Distribution \(Z \sim N(0, 1)\).
  2. Derive \(E[Z] = 0\) using symmetry.
  3. Derive \(Var(Z) = 1\) using integration by parts.
  4. Apply the Expectation and Variance operators to find the mean and variance of \(X = \mu + \sigma Z\).

Deriving the Mean of \(Z\)

By definition, the expected value \(E[Z]\) is:

\[E[Z] = \int_{-\infty}^{\infty} z \cdot \phi(z) \, dz = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} z e^{-\frac{z^2}{2}} \, dz\]

Proof by Symmetry:

  • The integrand \(g(z) = z e^{-\frac{z^2}{2}}\) is an odd function because: \[g(-z) = (-z) e^{-\frac{(-z)^2}{2}} = -z e^{-\frac{z^2}{2}} = -g(z)\]
  • The integral of an odd function over a symmetric domain \((-\infty, \infty)\) is zero.

\[\mathbf{E[Z] = 0}\]

Deriving the Variance of \(Z\)

Since \(Var(Z) = E[Z^2] - (E[Z])^2\) and \(E[Z] = 0\), we have \(Var(Z) = E[Z^2]\).

\[E[Z^2] = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} z^2 e^{-\frac{z^2}{2}} \, dz\]

We can split \(z^2 e^{-\frac{z^2}{2}}\) into \(z \cdot \left(z e^{-\frac{z^2}{2}}\right)\) to prepare for Integration by Parts (\(\int u \, dv = uv - \int v \, du\)):

\[\begin{aligned} u &= z & \implies du &= dz \\ dv &= z e^{-\frac{z^2}{2}} \, dz & \implies v &= -e^{-\frac{z^2}{2}} \end{aligned}\]

Evaluating the Variance Integral

Applying the integration by parts formula:

\[E[Z^2] = \frac{1}{\sqrt{2\pi}} \left[ \left. -z e^{-\frac{z^2}{2}} \right|_{-\infty}^{\infty} - \int_{-\infty}^{\infty} \left(-e^{-\frac{z^2}{2}}\right) \, dz \right]\]

  1. Boundary term: As \(z \to \pm\infty\), the exponential term dominates \(z\), so \(\left. -z e^{-\frac{z^2}{2}} \right|_{-\infty}^{\infty} = 0\).
  2. Remaining integral: \[E[Z^2] = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} e^{-\frac{z^2}{2}} \, dz\]

Since this matches the total area under a standard normal PDF, it equals \(1\).

\[\mathbf{Var(Z) = E[Z^2] = 1}\]

Linear Transformation to General Normal

Any general normal random variable \(X \sim N(\mu, \sigma^2)\) can be constructed from a standard normal variable \(Z \sim N(0, 1)\) using the transformation:

\[\mathbf{X = \mu + \sigma Z}\]

We will now apply the properties of mathematical expectations to \(X\).

Deriving the Mean of \(X\)

Let \(X = \mu + \sigma Z\). Then

\[\begin{aligned} E[X] &= E[\mu + \sigma Z] \\ &= \mu + \sigma E[Z] \end{aligned}\]

Since we proved \(E[Z] = 0\):

\[\mathbf{E[X] = \mu + \sigma(0) = \mu}\]

Deriving the Variance of \(X\)

\[\begin{aligned} Var(X) &= Var(\mu + \sigma Z) \\ &= \sigma^2 Var(Z) \end{aligned}\]

Since we proved \(Var(Z) = 1\):

\[\mathbf{Var(X) = \sigma^2(1) = \sigma^2}\]

Therefore, we have shown that if \(\mathbf{X \sim N(\mu,\sigma)}\), then \(\mathbf{E(X)=\mu}\) and \(\mathbf{Var(X)=\sigma^2}\).

The Central Limit Theorem (CLT)

The Central Limit Theorem states that the sample mean \(\bar{X}_n\) of \(n\) independent, identically distributed (i.i.d.) random variables with mean \(\mu\) and variance \(\sigma^2\) approaches normality as \(n \to \infty\) (typically \(n \ge 30\)), regardless of the underlying distribution shape:

\[\bar{X}_n \xrightarrow{d} N\left(\mu, \frac{\sigma}{\sqrt{n}}\right)\] The Central Limit Theorem (CLT) is the backbone of modern statistics. Many statistical procedures are based on this result.

The Three Rules of CLT

It states that if you take sufficiently large random samples from any population, the distribution of the sample means will look like a Normal distribution—regardless of the shape of the original population.

  1. Center: The mean of the sample means (\(\mu_{\bar{x}}\)) equals the population mean (\(\mu\)).
  2. Spread: The standard deviation shrinks as sample size \(n\) grows: \(\sigma_{\bar{x}} = \frac{\sigma}{\sqrt{n}}\).
  3. Shape: Becomes more bell-shaped as sample size \(n\) grows (\(n \ge 30\)).

CLT at work

Imagine a factory that manufactures 6-sided gaming dice. A perfect die has a Uniform Distribution—every number from 1 to 6 has an exact \(\frac{1}{6}\) chance of appearing.

  • Population Mean (\(\mu\)): \(3.5\)
  • Population Standard Deviation (\(\sigma\)): \(1.71\)

If we roll a single die 10,000 times, the graph looks flat. There is absolutely no bell curve here.

The Experiment: Sampling Averages

Now, instead of tracking single rolls, the quality control manager samples the dice in groups.

Case A: Samples of size \(n = 4\)

The manager rolls 4 dice at a time and records only the average of those 4 dice. They repeat this 1,000 times. * Result: The distribution is no longer flat! It peaks at 3.5 and starts looking like a rough triangle.

Case B: Samples of size \(n = 30\)

The manager rolls 30 dice at a time and records the average. They repeat this 1,000 times. * Result: A beautiful, smooth, symmetric Normal distribution curve emerges.

Visualizing the Transformation

Observe how the distribution of the sample mean (\(\bar{X}\)) changes as the sample size (\(n\)) increases:

Sample Size (\(n\)) Underlying Distribution Shape \(\frac{\sigma}{\sqrt{n}}\)
\(n = 1\) (Single rolls) Completely Flat (Uniform) \(1.71\)
\(n = 4\) Skewed / Triangular \(0.86\)
\(n = 30\) Perfectly Normal Curve \(0.31\)

Critical Takeaway

As \(n\) grows, the distribution narrows (the spread shrinks), making the sample average highly predictable!

R Simulation Code

We start by building our data matrices and pulling random samples using the base R sample() function.

Code
library(ggplot2)
library(patchwork)

set.seed(42)
num_simulations <- 10000
die_outcomes <- 1:6

# 1. Simulate single rolls (n = 1)
data_n1 <- data.frame(mean = sample(die_outcomes, num_simulations, replace = TRUE))

# 2. Simulate rolling 4 dice and averaging them (n = 4)
matrix_n4 <- matrix(sample(die_outcomes, num_simulations * 4, replace = TRUE), ncol = 4)
data_n4 <- data.frame(mean = rowMeans(matrix_n4))

# 3. Simulate rolling 30 dice and averaging them (n = 30)
matrix_n30 <- matrix(sample(die_outcomes, num_simulations * 30, replace = TRUE), ncol = 30)
data_n30 <- data.frame(mean = rowMeans(matrix_n30))

Visual Transformation Plots

Code
theme_clt <- theme_minimal() + 
  theme(plot.title = element_text(size = 12, face = "bold", hjust = 0.5),
        panel.grid.minor = element_blank())

p1 <- ggplot(data_n1, aes(x = mean)) +
  geom_histogram(aes(y = after_stat(density)), binwidth = 1, fill = "skyblue", color = "black", center = 0) +
  scale_x_continuous(breaks = 1:6, limits = c(0.5, 6.5)) +
  geom_vline(xintercept = 3.5, color = "red", linetype = "dashed", linewidth = 1) +
  labs(title = "Single Rolls (n=1)\nShape: Flat (Uniform)", x = "Outcome", y = "Density") +
  theme_clt

p2 <- ggplot(data_n4, aes(x = mean)) +
  geom_histogram(aes(y = after_stat(density)), bins = 20, fill = "salmon", color = "black") +
  geom_density(color = "darkred", linewidth = 0.8) +
  scale_x_continuous(limits = c(0.5, 6.5)) +
  geom_vline(xintercept = 3.5, color = "red", linetype = "dashed", linewidth = 1) +
  labs(title = "Average of 4 Dice (n=4)\nShape: Triangular", x = "Sample Mean", y = "") +
  theme_clt

p3 <- ggplot(data_n30, aes(x = mean)) +
  geom_histogram(aes(y = after_stat(density)), bins = 20, fill = "lightgreen", color = "black") +
  geom_density(color = "darkgreen", linewidth = 0.8) +
  scale_x_continuous(limits = c(0.5, 6.5)) +
  geom_vline(xintercept = 3.5, color = "red", linetype = "dashed", linewidth = 1) +
  labs(title = "Average of 30 Dice (n=30)\nShape: Normal Curve", x = "Sample Mean", y = "") +
  theme_clt

p1 + p2 + p3 + plot_annotation(title = "The Central Limit Theorem: Rolling Fair Dice",
                  theme = theme(plot.title = element_text(size = 16, face = "bold", hjust = 0.5)))

Calculating Probabilities with CLT

Example 4:

If a supervisor rolls 36 random dice, what is the probability that the average outcome is greater than 3.8?

Step 1: Identify the parameters

  • Given population parameters: \(\mu = 3.5\), \(\sigma = 1.71\)
  • Sample size: \(n = 36\)
  • Calculate the standard deviation (\(\sigma_{\bar{x}}\)): \[\sigma_{\bar{x}} = \frac{\sigma}{\sqrt{n}} = \frac{1.71}{\sqrt{36}} = \frac{1.71}{6} = \mathbf{0.285}\]

Solving Using Standard Scores (\(Z\))

Because \(n \ge 30\), the CLT guarantees that the sample mean behaves normally: \(\bar{X} \sim N(3.5, 0.285)\).

We want to find \(P(\bar{X} > 3.8)\). Let’s convert \(3.8\) into a standard \(Z\)-score:

\[Z = \frac{\bar{X} - \mu}{\sigma_{\bar{x}}} = \frac{3.8 - 3.5}{0.285} = \frac{0.3}{0.285} = \mathbf{1.05}\]

Finding the Area under the Curve

  • From standard normal tables: \(P(Z \le 1.05) = 0.8531\)
  • We want the area greater than 3.8: \(P(Z > 1.05) = 1 - 0.8531 = \mathbf{0.1469}\)

Alternatively, a more accurate answer using R is given by

Code
1-pnorm(3.8,3.5,.285)
[1] 0.1462549

Conclusion: There is roughly a 14.63% chance that a random sample of 36 dice will yield an average outcome above 3.8.

Normal Distribution Approximations to Discrete Distributions

Binomial Approximation

When \(n\) is sufficiently large (\(np \ge 10\) and \(n(1-p) \ge 10\)), a Binomial distribution can be approximated by \(N(np, np(1-p))\). We apply a continuity correction of \(\pm 0.5\) when mapping discrete values to the continuous curve.

Code
n_b <- 30; p_b <- 0.4
ggplot(data.frame(k = 0:n_b), aes(x = k)) +
  geom_col(aes(y = dbinom(k, n_b, p_b)), fill = "skyblue", alpha = 0.7) +
  stat_function(fun = dnorm, args = list(mean = n_b*p_b, sd = sqrt(n_b*p_b*(1-p_b))), color = "darkred", linewidth = 1) +
  theme_minimal() + labs(y = "Probability")+ggtitle("Normal approximation to Binomial(30,0.4)")

Figure 2

Poisson Approximation

When the event rate \(\lambda\) is large (\(\lambda > 10\)), a Poisson distribution simplifies well to a normal model: \(N(\lambda, \lambda)\).

Code
lam <- 15
ggplot(data.frame(k = 0:30), aes(x = k)) +
  geom_col(aes(y = dpois(k, lam)), fill = "lightgreen", alpha = 0.7) +
  stat_function(fun = dnorm, args = list(mean = lam, sd = sqrt(lam)), color = "purple", linewidth = 1) +
  theme_minimal() + labs(y = "Probability")+ggtitle("Normal approximation to Poisson(15)")

Figure 3

Approximation Examples

Example 5:

A fair coin is flipped \(n = 100\) times. What is the probability of getting at most 45 heads?

Step 1: Verify Parameters & Conditions

  • Success probability: \(p = 0.5\)
  • Check: \(np = 50 \ge 10\) and \(n(1-p) = 50 \ge 10\) (Approximation is safe to use!)

Step 2: Find Normal Parameters

  • Mean (\(\mu\)) = \(np = 100 \times 0.5 = 50\)
  • Variance (\(\sigma^2\)) = \(np(1-p) = 100 \times 0.5 \times 0.5 = 25\)
  • Standard Deviation (\(\sigma\)) = \(\sqrt{25} = 5\)

Step 3: Apply the Correction

We want to find \(P(X \le 45)\).

Because we want to include the discrete value of \(45\) itself, our continuous area under the normal curve must extend to the upper edge of the \(45\) bar:

\[\mathbf{P(X \le 45) \approx P(Y < 45.5)}\]

Step 4: Calculate the probability using R

Code
pnorm(45.5,50,5)
[1] 0.1840601

Accuracy Comparison

Let’s see how well our approximation performed against the true mathematical discrete calculation:

  • Exact Binomial Probability: \(P(X \le 45) = \mathbf{0.184101}\)
  • Normal Approx. (With Correction): \(P(Y < 45.5) = \mathbf{0.184060}\)
  • Normal Approx. (Without Correction): \(P(Y < 45.0) = \mathbf{0.158655}\)

Notice that omitting the continuity correction results in an error of nearly 2.5%, while adding it makes our approximation incredibly accurate!

Example 6: A call center averages \(\lambda = 50\) calls per hour. What is the probability they receive strictly more than 60 calls in an hour?

  • Discrete: \(P(Y \ge 61)\)
  • Continuity Correction: Continuous \(P(X > 60.5)\)
Code
exact <- 1 - ppois(60, lambda = 50)
approx <- 1 - pnorm(60.5, mean = 50, sd = sqrt(50))

cat("Exact Poisson: ", round(exact, 5), "\n")
Exact Poisson:  0.07216 
Code
cat("Normal Approx: ", round(approx, 5), "\n")
Normal Approx:  0.06878 
Code
cat("Error Delta:   ", round(abs(exact - approx), 5))
Error Delta:    0.00338

Summary of Best Practices for Normal Approximations

  1. Always check the conditions first (\(np \ge 10\) and \(n(1-p) \ge 10\) for Binomial and \(\lambda \ge 10\) for Poisson).
  2. Visualize the bars of the discrete distribution to decide whether to add or subtract \(0.5\).
  3. Remember the rule: If the discrete endpoint is included (\(\le, \ge, =\)), expand the interval to swallow that bar. If it is excluded (\(<, >\)), shrink the interval to avoid it.

References

  • More about the Distribution Ross, S. M. (2014). A First Course in Probability (9th ed.). Pearson.

  • Computational Software: R Core Team (2026). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing. Vienna, Austria. Available at https://www.R-project.org/.

About This Presentation

  • Content Design: Developed by the instructor to introduce the Normal Distribution and the Central Limit Theorem and its application in approximating discrete distributions.
  • AI Assistance: Google Gemini was provided with a detailed structural prompt to generate the foundational Quarto layout, technical R code chunks, and mathematical explanations.
  • Verification: All statistical definitions, R code logic, and visualizations were reviewed, verified, and finalized by the instructor for educational accuracy.