#ejercicio 1.a
x = pnorm(17,mean=16, sd=1)
1-x
## [1] 0.1586553
#ejercicio 1.b
x1= pnorm(16,mean = 16, sd=1)
x2= pnorm(14,mean = 16, sd=1)
x1 - x2
## [1] 0.4772499
#ejercicio 1.c
graf<-seq(14,20,0.001)
coso<-dnorm(graf,mean = 16,sd=1)
plot(graf,coso,lwd = 1,type="s", ylab ="densidad",xlab="jugo",main= "Distribución Normal",col = "violet")
plot of chunk unnamed-chunk-1
#ejercicio 2.a
 dbinom(0:3, size=3, prob = 0.05)
## [1] 0.857375 0.135375 0.007125 0.000125
 #ejercicio 2.b
 histo<-dbinom(0:3, size=3, prob = 0.05)
 barplot(histo, lwd=3,xlab = "Errores",ylab ="p(x)",main="distribución binomial",names.arg = c(0,1,2,3),col = "green" )
plot of chunk unnamed-chunk-1
#ejercicio 2.c
 p<-dbinom(0, size=3, prob = 0.05)
 res<-(1-p)
 res
## [1] 0.142625
#ejercicio 3.a
 ppois(0,1.5,lower.tail = FALSE)
## [1] 0.7768698
#ejercicio 3.b

#ejercicio 4.a
dbinom(14,size = 20,prob = 0.8)
## [1] 0.1090997
#ejercicio 4.b
pbinom(10,20,lower.tail = FALSE,prob = 0.8)
## [1] 0.9974052
#ejercicio 4.c
pbinom(16,20,lower.tail = TRUE,prob = 0.8)
## [1] 0.5885511
#ejercicio 4.d
#media
20*0.8
## [1] 16
#varianza
20*0.8*0.2
## [1] 3.2
#ejercicio 4.e
pdf<-dbinom(0:10, size = 20, prob = 0.2)
plot(pdf,type ="l",lwd = 3, xlab="x",ylab = "PDF",main = "distribucion Binomial",col = "blue")
plot of chunk unnamed-chunk-1
#ejercicio 4.d
cdf<-pbinom(0:20,size=20,prob = 0.2)
plot(cdf,type = "l",lwd =3,xlab="x",ylab = "CDF",main = "distribucion Binomial
",col = "blue")
plot of chunk unnamed-chunk-1
#ejercicio 5.a
dgeom(2,prob=0.2,log =F)
## [1] 0.128
#ejercicio 5.b
dgeom(10,prob=0.2,log =F)
## [1] 0.02147484
#ejercicio 5.c
#esperanza = media
1/0.2
## [1] 5
#ejercicio 5.d
pdf<-dgeom(0:10,prob = 0.2, log=F)
plot(pdf,type ="l",lwd = 3, xlab="x",ylab = "PDF",main = "distribucion Geometrica",col = "orange")
plot of chunk unnamed-chunk-1
cdf<-pgeom(0:10,prob = 0.2, log=F)
plot(cdf,type ="l",lwd = 3, xlab="x",ylab = "CDF",main = "distribucion Geometrica",col = "orange")
plot of chunk unnamed-chunk-1
#ejercicio 6.a
1/((1/2)-(1/3))
## [1] 6
#ejercicio 6.b
func<-function(y){0+6*y*(1-y)+0}
integrate(func,0.4,1)$value
## [1] 0.648
#ejercicio 6.copy paste 6.b
integrate(func,0.4,1)$value
## [1] 0.648
#ejercicio 6.d
integrate(func,0,0.4)$value/integrate(func,0,0.8)$value
## [1] 0.3928571
#ejercicio 6.e
integrate(func,0,0.4)$value/integrate(func,0,0.8)$value
## [1] 0.3928571
#ejercicio 6.f
a<-seq(0,1,0.01)
cdf<-function(y){
  -2*y*y*y+3*y*y
  }
plot(x,cdf(x),type = "l",xlab ="x",ylab = "p(x)",main = "CDF",col = "blue")
plot of chunk unnamed-chunk-1
x<-seq(0,1,0.01)
plot(x,func(x),type='l',xlab = 'x',ylab = 'p(x)',main= "PDF")
plot of chunk unnamed-chunk-1
#ejercicio 7.a
pnorm(450, 400, 20, lower.tail = FALSE, log.p = FALSE)
## [1] 0.006209665
#ejercicio 7.b

b<-seq(380*4,420*4,1)
pdf<-dnorm(b, 400, 20)
cdf<-pnorm(b, 400, 20)
plot(b,pdf,main="PDF",type="l")
plot of chunk unnamed-chunk-1
#ejercicio 7.c
plot(b,cdf,main="CDF",type="l")
plot of chunk unnamed-chunk-1