The following 3 videos (run times are about 5 minutes each) will help you with your Blackboard homework on this unit.
Please scroll down past these homework videos for an in depth explanation of the Normal Distribution.
The Normal Distribution
Here is a typical normal distribution question, like what you might see on a quiz.
Question 2.3. According to data from the National Health Survey, the mean weight of adult males (men) is 170 pounds with a standard deviation of 30 pounds. Assuming this is true, find the probability that a randomly selected adult male will weigh between 180 and 190 pounds.
The Solution to Question 2.3 is (far) below.
The rest of this webpage is devoted to understanding the normal distribution and how to solve questions like the one above.
Normal Distributions are determined by their mean and standard deviation.
The normal distribution is perhaps the most important distribution in statistics.
Just like there are lots of different circles (all of which are called circles) and there are lots of different rectangles (all of which are called rectangles), there lots of different normal distributions.
Circles are determined by one parameter, e.g., radius.
Rectangles are determined by two parameters, e.g., width and height.
Normal distributions are like rectangles in that they are determined by two parameters, their mean $\mu$ and standard deviation $\sigma$.
Notation. We write
$x$ is $N(\mu_x, \sigma_x)$
or
$x \sim N(\mu_x, \sigma_x)$
to indicate that $x$ is a random variable that is normally distributed with mean $\mu_x$ and standard deviation $\sigma_x$. The first number is always $\mu$ and the second number is always $\sigma$. See 1 for more about $\mu$ and $\sigma$.
Example 1. $x$ is $N(7, 2)$ means that $x$ is the normally distributed random variable having a mean $\mu_x = 7$ and a standard deviation $\sigma_x = 2$.
Example 2. $x \sim N(-9.123, 0.3)$ means that $x$ is the normally distributed random variable having a mean $\mu_x = -9.123$ and a standard deviation $\sigma_x = 0.3$.
Pictures of the Normal Distribution and PDF’s
When we draw a picture of a normal distribution, we are drawing the picture of its probability density function (PDF). The important thing to remember about all PDF’s is that the area under the PDF gives the probability. This is true for all PDF’s, not just the ones for normally distributed random variables. See Figure below:
Very Important Notes about
All Continuous Random Variables and PDF’s
- The total area under every PDF is always 1. That is because the $P(-\infty < x < \infty) = 1$
- A continuous random variable $x$ is a random variable whose PDF is a continuous function (you can draw the PDF without taking your pen off the paper). Examples include height and weight.
- The normal distribution is an example of a continuous distribution.
- The binomial distribution is an example of distribution which is not continuous. If $x$ is binomially distributed, $x$ can only equal the values $0, 1, \dots, n$. As a result, we say that the binomial distribution is discrete.
- For a continuous random variable $x$ the probability that $x$ equals any particular value is always 0. In other words, $P(x = a) = 0$ for all $a$, if $x$ has a continuous distribution. The reason for this is simple. Area is probability. The area of the region over a single point is always 0 because the region over a single point is a thin one dimensional line.
- The above implies, if $x$ is a continuous random variable then $P(x \leq b) = P(x < b)$ and $P(x \geq a) = P(x > a)$
- By the complement principal, and the above, if $x$ is a continuous random variable, then $$P(x > a) = 1 – P(x < a)$$ For example, if $x$ is a random variable that measures weight, and 20% of the population weight’s is less than 40 kg, then 80% of the population’s weight will be more than 40 kg.
Comparing two normal distributions
The following Figure shows the PDF’s for two normal distributions. Both with the same mean $\mu = 18$ but one with $\sigma = 0.25$ and one with $\sigma = 2$.
In the above Figure notice that as $\sigma$ increases from 0.25 to 2 the PDF gets wider and shorter.
There are two ways to think about this:
- The area under the PDF is the probability. The total area under a PDF must always be 1. So, if a PDF gets “wider”, it has to get “shorter”.
- Recall that the standard deviation $\sigma_x$ measures the average variation in the population. So, as $\sigma_x$ increases, the variation in the population increases, so the distribution of $x$ becomes less narrow, more spread out.
Why the normal distribution is so important
- Many distributions in nature are approximately normally distributed. For example, heights and weights of plants and animals are approximately normally distributed. More generally, any property, whose value is determined by many processes, will often be approximately normally distributed.
- As we will learn in the unit on the Central Limit Theorem, even if a random variable $x$ is not normally distributed, if we fix the sample size $n$, then $\bar{x}$ will be will be approximately normal, provided $n$ is large enough.
Elementary properties of normal distributions
Each normal distribution is symmetric about its mean. Moreover its mean, median, and mode all are the same value. If a population is normally distributed, approximately 95% of the population will be within 2 standard deviations of the mean.
Drawing the Normal Distribution
It is important to be able to quickly sketch the probability density function (PDF) of the random variable $x$ if $x$ is $N(\mu_x, \sigma_x)$.
Question 1. Draw the PDF for $x \sim N(30, 5)$.
Note: $x \sim N(30, 5)$ and $x$ is $N(30, 5)$ mean the same exact thing.
Solution to Question 1.
The above Figure shows $x \sim N(30, 5)$ and is the answer to Question 1.
The following 1 minute long video shows how to do Question 1.
The first number in $N(30, 5)$ is $30$, so that the population mean of $x = \mu_x = 30$.
For normal distributions, the mean, the median, and the mode are the same. So, the “middle” of the PDF is at 30.
The second number in $N(30, 5)$ is 5, so the population standard deviation of $x = \sigma_x = 5$.
When we draw the horizontal axis (for the random variable’s values) we should indicate the mean, which is $\mu_x$ and two standard deviations below and two standard deviations above the mean:
$\mu_x – 2 \sigma_x = 30 – 5 – 5 = 20$
(two standard deviations below the mean)
$\mu_x – \sigma_x = 30 – 5 = 25$
(one standard deviation below the mean)
$\mu_x = 30$
(the mean, median, and mode: all the same)
$\mu_x + \sigma_x = 30 + 5 = 35$
(one standard deviation above the mean)
$\mu_x + 2 \sigma_x = 30 + 5 + 5 = 40$
(two standard deviations above the mean)
Then we draw the PDF like a hill as shown in the figure above. Don’t worry about putting tick marks on the y axis.
We can also have R draw the PDF for $x \sim N(30, 5)$:
The above Figure is R’s solution to Question 1.
The PDF for $x$ is $N(30, 5)$ is drawn in blue.
The x-axis is drawn in red.
Here is the R script used to create the above Figure.
Note: the graph of the PDF output by the following R script will always look like the shape in the above Figure. The only aspect that will change will be the tick marks along the x and y axes. They will depend on what you input for $\mu$ and $\sigma$.
# Draw the PDF of x is N(mu_x, sigma_x) mu_x = 30; # population mean of x sigma_x = 5; # population standard deviation of x #--------------------------------------------------------- # No need to change anything below this line. #--------------------------------------------------------- xvals = seq(mu_x - 2.5*sigma_x, mu_x + 2.5*sigma_x, by = 0.01); pdf = dnorm(x = xvals, mean = mu_x, sd = sigma_x); xtickmarks = seq(mu_x - 2*sigma_x, mu_x + 2*sigma_x,sigma_x); plot(xvals, pdf, type = "l", lwd = 4, ylab = "probability density", xlab = "x", col = "blue", ylim = c(0, max(pdf)), xaxt='n', main = paste("PDF for x is N(", mu_x,",", sigma_x,")") ); axis(side = 1, at = xtickmarks ,labels = T); lines(c(min(xvals), max(xvals)), c(0, 0), col = "red", lwd = 4); # End of Script
You can copy and paste the above R script into an online R compiler such as:
Important Note about drawing the normal distribution.
Notice that R’s graph and our graph (in the answer to Question 1 above) look a little different. It doesn’t matter. What is important is the general shape (which should look like a hill) and the values on the x-axis.
Unless you are drawing two normal distributions in the same graph to compare them, whether you make the hill shorter and wider, or taller and narrower, it doesn’t matter. The reason is that the y axis, which gives the height of the PDF (relative to the x axis) can be arbitrarily scaled (stretched or compressed).
The Normal Distribution is said to be Bell Shaped
When we draw the normal distribution, like in the above Figure, the curvy function which looks like a hill is called the probability density function (PDF) of the distribution.
Statisticians and scientists don’t say “hill shaped,” instead they call the shape “bell shaped”. This is because when this subject was developed bells, like the one shown in the Figure below, were quite common.
The shape of the bell in the above Figure looks a little like the shape of the normal distribution’s PDF. For this reason the normal distribution is said to have a “bell shape“.
The Mathematical Formula for the PDF of the Normal Distribution
If $x$ is $N(\mu_x, \sigma_x)$ the PDF for $x$ is the function
$$f(x) =\frac{1}{\sigma_x \sqrt{2 \pi}}\,\text{e}^{-\dfrac{(x-\mu_x)^2}{2 \sigma_{x}^{2}}}$$
In Mat 150 we won’t be using this complicated formula.
How to Find Probabilities Involving the Normal Distribution
Probability Density Functions (PDF’s) give you probabilities by the following rule:
$P(a < x < b) = $ area of the region under the PDF of $x$ between $a$ and $b$. See Figure below:
So, how do we find the area under the PDF of a normally distributed random variable?
There are two ways.
- The fastest way is to use an application like R.
- The traditional way is to use a table called the “standard normal distribution” look-up table (also called the z table) together with z transformation theorem. We will learn about this method in the next unit.
Method 1. Using R.
If $x \sim N(\mu_x, \sigma_x)$ then
$P(x < b) = \text{pnorm}(b, \mu_x, \sigma_x)$
where “pnorm” is R’s cumulative probability function for the normal distribution.
“pnorm” is an abbreviation of “probability normal distribution”.
Note. Each statistics package will have its own name for the cumulative probability function of the normal distribution but they all work pretty much the same way.
Question 2 0. Suppose $x \sim N(25, 4)$. Find the probability that $x$ is less than 26.5 I.e., find $P(x < 26.5)$
Answer to Question 2.0.
Question 2.0 is solved in the following 2 minute 39 seconds video.
Here is the calculation to solve Question 2.0:
$P(x < 26.5)$
$= \text{pnorm}(26.5, \mu_x = 25, \sigma_x = 4) $
$= 0.6461698$
Running the following command in R finds $P(x < 26.5)$
pnorm(26.5, 25, 4)
A fancier version of the above is:
# P(x < b) if x is N(mu_x, sigma_x) b = 26.5 mu_x = 25 sigma_x = 4 pnorm(b,mu_x, sigma_x) # P(x < b) # End of script
You can copy and paste the above R script into an online R compiler such as:
Question 2.1
If $x \sim N(25, 4)$ find $P(x > 26.5)$
Answer to Question 2.1
Question 2.1 is solved in the following 5 minute video.
Question 2.1 is like Question 2.0, except now we need to find the area on the right. See Figure below (or video above).
By the complement principle we have:
$P(x > 26.5)$
$= 1 – P(x < 26.5)$
$= 1 – \text{pnorm}(26.5, \mu_x = 25, \sigma_x = 4) $
$= 1 – 0.6461698$
$= 0.3538302$
Running the following command in R finds $P(x > 26.5)$
1 - pnorm(26.5, 25, 4)
End of Question 2.1.
$\mathbf{P(a < x < b)}$
Since R’s pnorm function gives us cumulative areas we have the following formula.
$P(a < x < b) = P(x < b) – P(x < a)$
$= \text{pnorm}(b, \mu_x, \sigma_x) – \text{pnorm}(a, \mu_x, \sigma_x)$
Question 2.2
Suppose $x \sim N(100, 10)$. Find $P(93 < x < 114)$.
Answer to Question 2.2
Question 2.2 is solved in the following 5 minute video.
$P(93 < x < 114) $
$= P(x < 114) – P(x < 93)$
$=\text{pnorm}(114, \mu_x = 100, \sigma_x = 10) – \text{pnorm}(93, \mu_x = 100, \sigma_x = 10)$
$= 0.9192433 – 0.2419637$
$= 0.6772797$
The following R script finds $P(x < 114)$ and $P(x < 93)$ and $P(93 < x < 114) $.
# P(a < x < b) if x is N(mu_x, sigma_x) a = 93 b = 114 mu_x = 100 sigma_x = 10 #----------------- no need to change anything below this line pnorm(b, mu_x, sigma_x); pnorm(a, mu_x, sigma_x); pnorm(b, mu_x, sigma_x) - pnorm(a, mu_x, sigma_x); #the above number is P(a < x < b) # End of script
Here is the question from the top of this webpage.
Question 2.3. According to data from the National Health Survey, the mean weight of adult males (men) is 170 pounds with a standard deviation of 30 pounds. Assuming this is true, find the probability that a randomly selected adult male will weigh between 180 and 190 pounds.
Solution to Question 2.3.
Let $x$ be the random variable that gives the weight of adult males (men).
$x \sim N(170, 30)$
$P(180 < x < 190) $
$= P(x < 190) – P(x < 180)$
$=\text{pnorm}(190, \mu_x = 170, \sigma_x = 30) – \text{pnorm}(180, \mu_x = 170, \sigma_x = 30)$
$= 0.7475075 – 0.6305587$
$= 0.1169488$
The following R script solves Question 2.3 and outputs the above Figure.
# P(a < x < b) without using z transformation # Draw PDF of x is N(mu_x, sigma_x) # Shade region corresponding to P(a < x < b) mu_x = 170; # population mean of x sigma_x = 30; # population standard deviation of x a = 180; b = 190; #--------------------------------------------------------- # No need to change anything below this line. #--------------------------------------------------------- Pa = pnorm(a,mu_x, sigma_x ); Pb = pnorm(b,mu_x, sigma_x ) Pab = pnorm(b,mu_x, sigma_x ) - pnorm(a,mu_x, sigma_x ); sds = 3.5; xvals = seq(mu_x - sds*sigma_x, mu_x + sds *sigma_x, by = 0.001); pdf = dnorm(x = xvals, mean = mu_x, sd = sigma_x); xtickmarks = seq(mu_x - 2*sigma_x, mu_x + 2*sigma_x,sigma_x); plot(xvals, pdf, type = "l", lwd = 3, ylab = "probability density", xlab = "x", col = "black", ylim = c(0, max(pdf)), xaxt='n', main = paste("x is N(",mu_x,",",sigma_x,"). ", "P(",a,"< x <",b,") = P(x < ", b,") - P(x < ",a, ") \n \ \ = ", sprintf('%.5f',Pb), " - ", sprintf('%.5f',Pa) , " = " , sprintf('%.4f',Pb - Pa), " " ) ); axis(side = 1, at = xtickmarks ,labels = T); xShade = seq(a, b, by = sigma_x/50); pdfShade = dnorm(x = xShade, mean = mu_x, sd = sigma_x); polygon(c(xShade,rev(xShade)),c(pdfShade,0*rev(pdfShade)),col="grey"); lines(c(min(xvals)- abs(min(xvals)), max(xvals)+ abs(max(xvals))), c(0, 0), col = "black", lwd = 3); lines(c(mu_x,mu_x), c(0,1.1*dnorm(mu_x, mu_x, sigma_x)), lty = "dashed"); pnorm(b,mu_x, sigma_x ) - pnorm(a,mu_x, sigma_x ) # above numer is P(a < x < b) # End of script
You can copy and paste the above R script into
The traditional way of finding normal distribution probabilities uses the standard normal distribution look-up table instead of R. For details see unit 12.
- Notation $\mu$ and $\sigma$. The symbol $\mu$ (pronounced “mu”) represents the “population mean” and the symbol $\sigma$ (pronounced “sigma”) represents the “population standard deviation”. The mean $\mu$ can be any number, negative, positive, or zero. But the standard deviation $\sigma$ is always a non-negative number. If $x$ is a random variable we will often write $\mu_x$ or $\sigma_x$ to indicate that we are talking about the “population mean of $x$” or the “population standard deviation of $x$”.