PRACTICE EXERCISE 7-1: The Normal Probability Distribution

library(ggplot2)

PROBLEM 1

Find the area under the normal curve to the left of z=1.34.

pnorm(1.34)
## [1] 0.9098773
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)

The area to the left of z=1.34 is 0.9099.

PROBLEM 2

Find the area under the normal curve to the right of z=-0.52.

pnorm(-0.52,lower.tail = F)
## [1] 0.6984682
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>-0.52),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The area to the right of z=-0.52 is 0.6985.

PROBLEM 3

Find the area between z=-1.3 and z=2.4.

pnorm(2.4)-pnorm(-1.3)
## [1] 0.895002
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.3&z<2.4),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The area between the z value of -1.3 and 2.4 is 0.8950.

PROBLEM 4

Find the z-score when the area to the left of it is 0.8621.

qnorm(0.8621)
## [1] 1.089803
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<qnorm(0.8621)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The value of z, with an area of 0.8621 to the left, is 1.09.

PROBLEM 5

Find the z-score when the area to the right of z is 0.1230.

qnorm(0.1230,lower.tail = F)
## [1] 1.16012
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>qnorm(0.1230,lower.tail = F)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The value of z, with an area of 0.1230 to the right, is 1.16.

PROBLEM 6

Find the z-score when the area from z=0 to z is 0.3770.

qnorm(0.3770+0.50)
## [1] 1.16012
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<qnorm(0.8770)&z>qnorm(0.5)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The value of z, with an area of 0.3770 from z=0, is 1.16.

PROBLEM 7

What z-scores correspond to the following areas under the normal curve?

Problem 7a

Area of 0.01 to the right of a positive z value

qnorm(0.01,lower.tail = F)
## [1] 2.326348
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>qnorm(0.01,lower.tail = F)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The value of z, with an area of 0.01 to the right of a positive z value, is 2.33.

Problem 7b

Area of 0.01 to the left of a negative z value

qnorm(0.01)
## [1] -2.326348
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<qnorm(0.01)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The value of z, with an area of 0.01 to the left of a negative z value, is -2.33.

Problem 7c

Area of 0.05 to the right of a positive z value

qnorm(0.05,lower.tail = F)
## [1] 1.644854
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>qnorm(0.05, lower.tail = F)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The value of z, with an area of 0.05 to the right of a positive z value, is 1.64.

Problem 7d

Area of 0.05 to the left of a negative z value

qnorm(0.05)
## [1] -1.644854
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<qnorm(0.05)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The value of z, with an area of 0.05 to the left of a negative z value, is -1.64.

Problem 7e

Area of 0.90 between the positive and negative values of z

c(qnorm((1-0.9)/2),-qnorm((1-0.9)/2))
## [1] -1.644854  1.644854
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<qnorm(0.05,lower.tail = F)&z>qnorm(0.05)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The values of z, with an area of 0.90 between the positive and negative values of z, are -1.64 and 1.64.

Problem 7f

Area of 0.99 between the positive and negative values of z

c(qnorm((1-0.99)/2),-qnorm((1-0.99)/2))
## [1] -2.575829  2.575829
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<qnorm(0.005,lower.tail = F)&z>qnorm(0.005)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The values of z, with an area of 0.99 between the positive and negative values of z, are -2.58 and 2.58.

PROBLEM 8

Evaluate the following:

Problem 8a

P(-0.82<=z<1.30)

pnorm(1.30)-pnorm(-0.82)
## [1] 0.6970915
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>-0.82&z<1.30),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The probability that a z value is between -0.82 and 1.30 is 0.6971.

Problem 8b

P(-2.60<z<=-0.55)

pnorm(-0.55)-pnorm(-2.60)
## [1] 0.2864985
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>-2.60&z<(-0.55)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The probability that a z value is between -0.55 and -2.60 is 0.2865.

Problem 8c

P(1.07<=z<=-2.81)

pnorm(1.07)-pnorm(-2.81)
## [1] 0.8552133
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.07&z>(-2.81)),aes(ymax=y),ymin=0,fill="blue",alpha=0.3)

The probability that a z value is between -2.81 and 1.07 is 0.8552.