x=seq(-3,3,length=200)
y=dnorm(x,mean=0,sd=1)
plot(x,y)

plot(x,y,type="l")

x=seq(20,80,length=200)
y=dnorm(x,mean=50,sd=10)
plot(x,y,type="l")

x=seq(-3,3,length=200)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(-3,0,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(-3,x,0),c(0,y,0),col="red")

pnorm(0,mean=0,sd=1)
## [1] 0.5
x=seq(-3,3,length=200)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(-3,1,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(-3,x,1),c(0,y,0),col="red")

pnorm(1,mean=0,sd=1)
## [1] 0.8413
x=seq(-3,3,length=200)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(2,3,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(2,x,3),c(0,y,0),col="red")

1-pnorm(2,mean=0,sd=1)
## [1] 0.02275
x=seq(-3,3,length=200)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(-1,1,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(-1,x,1),c(0,y,0),col="red")

pnorm(1,mean=0,sd=1)-pnorm(-1,mean=0,sd=1)
## [1] 0.6827
x=seq(20,80,length=200)
y=dnorm(x,mean=50,sd=10)
plot(x,y,type="l")
x=seq(30,70,length=100)
y=dnorm(x,mean=50,sd=10)
polygon(c(30,x,70),c(0,y,0),col="red")

pnorm(70,mean=50,sd=10)-pnorm(30,mean=50,sd=10)
## [1] 0.9545
x=seq(-3,3,length=200)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(-3,-0.2533,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(-3,x,-0.2533),c(0,y,0),col="red")
text(-1,0.1,"0.40")

qnorm(0.40,mean=0,sd=1)
## [1] -0.2533
x=seq(-3,3,length=200)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(-3,-0.2533,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(-3,x,-0.2533),c(0,y,0),col="red")
text(-1,0.1,"0.40")
arrows(0.5,0.1,-0.2,0,length=.15)
text(0.5,0.12,"-0.2533")

x=seq(-3,3,length=200)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(0.5244,3,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(0.5244,x,3),c(0,y,0),col="red")
text(1,0.1,"0.30")

qnorm(0.70,mean=0,sd=1)
## [1] 0.5244
x=seq(-3,3,length=200)
y=dnorm(x,mean=0,sd=1)
plot(x,y,type="l")
x=seq(0.5244,3,length=100)
y=dnorm(x,mean=0,sd=1)
polygon(c(0.5244,x,3),c(0,y,0),col="red")
text(1,0.1,"0.30")
arrows(-0.5,0.1,0.45,0,length=.15)
text(-0.5,0.12,"0.5244")

x=seq(15,105,length=200)
y=dnorm(x,mean=60,sd=15)
plot(x,y,type="l",xaxt="n")
axis(1,at=c(15,30,45,60,75,90,105))

x=seq(15,105,length=200)
y=dnorm(x,mean=60,sd=15)
plot(x,y,type="l",xaxt="n")
axis(1,at=c(15,30,45,60,75,90,105))
x=seq(72.62,105,length=100)
y=dnorm(x,mean=60,sd=15)
polygon(c(72.62,x,105),c(0,y,0),col="red")
text(80,0.005,"0.20")

qnorm(0.80,mean=60,sd=15)
## [1] 72.62
x=seq(15,105,length=200)
y=dnorm(x,mean=60,sd=15)
plot(x,y,type="l",xaxt="n")
axis(1,at=c(15,30,45,60,75,90,105))
x=seq(72.62,105,length=100)
y=dnorm(x,mean=60,sd=15)
polygon(c(72.62,x,105),c(0,y,0),col="red")
text(80,0.005,"0.20")
arrows(60,0.004,71.5,0,length=.15)
text(60,0.0055,"72.62")
