We need to load the ggplot2 package first.
library(ggplot2)
Solve the following problems to check on your understanding of the previous discussion. Include a figure of the shaded area under the normal curve when making your solution to aid in your analysis. Use the proper notations for the probabilities. As labelled, use this to practice solving problems involving the standard normal distribution.
\(~\)
Problem 1: Find the area under the normal curve to the left of \(๐ง=1.34\).
First, we illustrate the area required under the standard normal distribution:
z <- seq(from = -4, to = +4, length.out = 1000)
normal <- data.frame(x = z, y = dnorm(z, mean = 0, sd = 1))
stdnormal <- ggplot(normal, aes(x,y)) + geom_line()+ labs(title = "Standard Normal Distribution", y = "Density", x = "Z")
stdnormal+geom_ribbon(data = subset(normal, z < 1.34), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
Now, the area under the standard normal curve which is to the left of \(z = 1.34\).
pnorm(1.34)
## [1] 0.9098773
The area under the normal curve to the left of \(z=1.34\) is 0.9099.
\(~\)
Problem 2: Find the area under the normal curve to the right of \(๐ง =โ0.52\).
We illustrate the required area under the standard normal curve. Since the codes to generate a random variable z and create the standard normal curve were already executed in the previous problem, we just need to run the necessary script to shade the area required.
stdnormal+geom_ribbon(data = subset(normal, z > -0.52), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
To determine the required area:
pnorm(-0.52, lower.tail = FALSE)
## [1] 0.6984682
The area under the standard normal curve to the right of \(z = -0.52\) is 0.6985.
\(~\)
Problem 3: Find the area between \(๐ง = โ1.3\) and \(๐ง = 2.4\).
We shade the area required under the standard normal curve:
stdnormal+geom_ribbon(data = subset(normal, z > -1.3 & z < 2.4), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
The required area is:
pnorm(2.4)-pnorm(-1.3)
## [1] 0.895002
The area under the standard normal curve which is between \(z = -1.3\) and \(z = 2.4\) is 0.8950.
\(~\)
Problem 4: Find the \(๐ง\)-score when the area to the left of it is 0.8621.
Presenting the given area to the left of the unknown \(z\)-score:
stdnormal+geom_ribbon(data = subset(normal, z < qnorm(0.8621)), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
Now, the unknown \(z\)-score value is:
qnorm(0.8621)
## [1] 1.089803
The unknown \(z\)-score value with corresponding area to the left of 0.8621, under the standard normal curve, is 1.0898.
\(~\)
Problem 5: Find the ๐ง-score when the area to the right of ๐ง is 0.1230.
stdnormal+geom_ribbon(data = subset(normal, z > qnorm(0.1230, lower.tail = FALSE)), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
Now, the unknown \(z\)-score value is:
qnorm(0.1230, lower.tail = FALSE)
## [1] 1.16012
The unknown \(z\)-score value with corresponding area to the right of 0.1230, under the standard normal curve,is 1.1602.
\(~\)
Problem 6: Find the \(๐ง\)-score when the area from \(๐ง=0\) to \(๐ง\) is 0.3770.
For this problem, there are two answers since the unknown \(z\) value could be one which is lower than \(z = 0\) or one which is higher. We can only consider one of these two possibilities and just simply apply one of the properties of the standard normal curve and that is it being symmetric about the mean, 0. Let us take into consideration a positive unknwon \(z\) value. if the area from \(z = 0\) up to this unknwon \(z\) value is \(0.3770\), then the area beyond this unknown \(z\) value would be \(0.50 - 0.3770 = 0.123\). We can now use this information to present the area bounded by \(z = 0\) and this unknown \(z\) value under the standard normal curve.
stdnormal+geom_ribbon(data = subset(normal, z > 0 & z < qnorm(0.123, lower.tail = FALSE)), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
Now, the unknown \(z\)-score value is:
qnorm(1-(0.5+0.3770), lower.tail = FALSE)
## [1] 1.16012
The unknown \(z\)-score when the area from \(z = 0\) to \(z\) is \(+1.16012\) or \(-1.16012\).
\(~\)
Problem 7: For some of the following problems, may we just disregard the illustrations for you can always refer to the previous solutions on how the given area was illustrated as a shaded portion under the standard normal curve.
qnorm(0.01, lower.tail = FALSE)
## [1] 2.326348
The unknown \(z\) score value is \(2.326348\).
\(~\)
qnorm(0.01, lower.tail = TRUE)
## [1] -2.326348
The unknown \(z\) score value is \(-2.326348\).
\(~\)
qnorm(0.05, lower.tail = FALSE)
## [1] 1.644854
The unknown \(z\) score value is \(1.644854\).
\(~\)
qnorm(0.05, lower.tail = TRUE)
## [1] -1.644854
The unknown \(z\) score value is \(-1.644854\).
\(~\)
For this, the \(z\) values are symmetric values about the mean which implies that one is the additive inverse of the other. With this in mind, we can just focus on one \(z\) value, either the negative or the positive. If we consider the negative \(z\) value, we focus now on having an area of 0.05 before it while if we consider the positive \(z\) value, we consider an area of 0.05 beyond it. These areas (below the negative \(z\) and above the positive \(z\) values) covers the 0.10 excess portion under the standard normal curve which is not covered by the given area of 0.90.
stdnormal+geom_ribbon(data = subset(normal, z > qnorm(0.05, lower.tail = TRUE) & z < qnorm(0.05, lower.tail = FALSE)), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
Now, solving for the negative \(z\) value:
qnorm(0.05, lower.tail = TRUE)
## [1] -1.644854
**The \(z\) values are \(-1.644854\) and \(+1.644854\).
To check this obtained result, we can reverse the process. We now determine the area between these two \(z\) values:
pnorm(1.644854)-pnorm(-1.644854)
## [1] 0.9000001
**Here, we can see that the area between \(z = -1.644854\) and \(z = 1.644854\) is \(0.90\).
\(~\)
This is similar to letter e. the excess area which is not covered is \(0.01\). We divide this equally between the tails of the standard normal distribution and we have \(0.005\).
stdnormal+geom_ribbon(data = subset(normal, z > qnorm(0.005, lower.tail = TRUE) & z < qnorm(0.005, lower.tail = FALSE)), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
Now, for the \(z\) values:
qnorm(0.005, lower.tail = TRUE)
## [1] -2.575829
The \(z\) values are \(-2.575829\) and \(+2.575829\).
\(~\)
Problem 8: Evaluate the following: For these problems, note that when the standard normal random variable \(Z\) assumes exactly one of its possible values, the corresponding probability is \(0\), i.e., \(P(Z=z) = 0\).
stdnormal+geom_ribbon(data = subset(normal, z > -0.82 & z < 1.30), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
pnorm(1.30)-pnorm(-0.82)
## [1] 0.6970915
The probability of a \(z\) value being greater than or equal to \(-0.82\) but lesser than \(1.30\) is \(0.6970915\).
\(~\)
stdnormal+geom_ribbon(data = subset(normal, z > -2.60 & z < -0.55), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
pnorm(-0.55)-pnorm(-2.60)
## [1] 0.2864985
The probability of a \(z\) value being greater than \(-2.60\) but lesser than or equal to \(-0.55\) is \(0.2864985\).
\(~\)
stdnormal+geom_ribbon(data = subset(normal, z > 1.07 & z < 2.81), aes(ymax = y), ymin = 0, fill = "blue", alpha = 0.3)
pnorm(2.81)-pnorm(1.07)
## [1] 0.1398326
The probability of a \(z\) value being greater than or equal to \(1.07\) but lesser than or equal to \(2.81\) is \(0.1398326\).