Atividade 8: Distribuição na Normal
library(RcmdrMisc)
Z ~ N(0,1)
Pr(-1<Z<2,1) = 0.8234
Pr (-1-0/1) < (x-u/o) < (2,1-0/1)
Pr (-1 < z < 2,1)
x = seq(-3.291, 3.291, length.out=1000)
plotDistr(x, dnorm(x, mean=0, sd=1), cdf=FALSE,
regions=list(c(-1,0), c(0,2.1)), col=c('purple','green'),
legend=FALSE)

pnorm(2.1) - pnorm(-1)
## [1] 0.8234803
Pr(-0,87<Z<1,54) = 0.1303
Pr (-0,87-0/1) < (x-u/o) < (1,54-0/1)
Pr (-0,87 < z < 1,54)
x = seq(-3.291, 3.291, length.out=1000)
plotDistr(x, dnorm(x, mean=0, sd=1), cdf=FALSE,
regions=list(c(-0.87,0), c(0,1.54)), col=c('purple','green'),
legend=FALSE)

pnorm(1.54) - pnorm(-0.87)
## [1] 0.7460696
Pr(Z=1,54)
Pr(1,54-0/1) = 0.9382
x = seq(-3.291, 3.291, length.out=1000)
plotDistr(x, dnorm(x, mean=0, sd=1), cdf=FALSE,
regions=list(c(0,1.54)), col=c('purple'),
legend=FALSE)

pnorm(1.54)
## [1] 0.9382198
Pr(Z>2,5)
Pr(x-0/1) > (2,5-0/1) = 0.9973
x = seq(-3.291, 3.291, length.out=1000)
plotDistr(x, dnorm(x, mean=0, sd=1), cdf=FALSE,
regions=list(c(2.5,3)), col=c('green'),
legend=FALSE)

pnorm(3) - pnorm(2,5)
## [1] 0.9973002
X ~ N(500,300)
Pr(X<500)
Pr(x-500/300) < (500-500/300) =
x = seq(-3.291, 3.291, length.out=1000)
plotDistr(x, dnorm(x, mean=0, sd=1), cdf=FALSE,
regions=list(c(0,500)), col=c('green'),
legend=FALSE)

pnorm(3)
## [1] 0.9986501
Pr(400<X<710) = 0.3873
Pr(400-500/300) < (x-u/o) < (710-500/300)
Pr(-100/300 < x < 210/300)
Pr(-0.33) < x < (0.7)
x = seq(-3.291, 3.291, length.out=1000)
plotDistr(x, dnorm(x, mean=0, sd=1), cdf=FALSE,
regions=list(c(-0.33,0), c(0,0.7)), col=c('purple','green'),
legend=FALSE)

pnorm(0.7) - pnorm(-0.33)
## [1] 0.3873364
Pr(330<X<450) = 0.1487
Pr(330-500/300) < x < (450-500/300)
Pr(330-500/300) < x < (450-500/300)
Pr(-170/300) < x < (-50/300)
Pr (-0.16) < x < (-0.56)
x = seq(-3.291, 3.291, length.out=1000)
plotDistr(x, dnorm(x, mean=0, sd=1), cdf=FALSE,
regions=list(c(-0.56,0), c(-0.16,0)), col=c('purple','green'),
legend=FALSE)

pnorm(-0.56) - pnorm(-0.16)
## [1] -0.1487008
Y ~ N(100,20)
Pr(50<Y<70) = -0.0605
Pr(50-100/20) < y < (70-100/20)
Pr(-50/20) < y < (-30/20)
Pr(-2,5) < y < (-1.5)
x = seq(-3.291, 3.291, length.out=1000)
plotDistr(x, dnorm(x, mean=0, sd=1), cdf=FALSE,
regions=list(c(-2.5,0), c(-1.5,0)), col=c('purple','green'),
legend=FALSE)

pnorm(-2.5) - pnorm(-1.5)
## [1] -0.06059754
Pr(105<Y<110) = 0.0927
Pr(105-100/20) < y < (110-100/20)
Pr(5/20) < y < (10/20)
Pr(0.25) < y < (0.5)
x = seq(-3.291, 3.291, length.out=1000)
plotDistr(x, dnorm(x, mean=0, sd=1), cdf=FALSE,
regions=list(c(0, 0.5), c(0, 0.25)), col=c('purple','green'),
legend=FALSE)

pnorm(0.5) - pnorm(0.25)
## [1] 0.09275614
Pr(Y>75) = 0.8930
Pr(y > 75-100/20)
Pr(y > -25/20)
Pr(y > -1.25)
x = seq(-3.291, 3.291, length.out=1000)
plotDistr(x, dnorm(x, mean=0, sd=1), cdf=FALSE,
regions=list(c(-1.25, 3)), col=c('purple','green'),
legend=FALSE)

pnorm(3) - pnorm(-1.25)
## [1] 0.8930003