You are on page 1of 3

COMANDOS EN R SEMANA 11

# DISTRIBUCIÓN BINOMIAL

x=c(0,1,2,3,4,5, 6,7,8,9,10,11,12)

dbinom(x,5,0.5)

# P(x<=2)

dbinom(x=0:2,12,0.2)

P=dbinom(x,12,0.2)

pbinom(2,12,0.2)

cbind(x,P)

pbinom(q=2,12,0.2)

F=pbinom(x,12,0.2)

cbind(x,P,F)

# P(x>=2)

pbinom(1,12,0.2, lower.tail = FALSE)

# P(x>2) & P(x<=2)

pbinom(2,5,0.5, lower.tail = TRUE)

pbinom(2,5,0.5)

pbinom(3,5,0.5, lower.tail = FALSE)

install.packages("distr")

library(distr)

x = Binom(4, 0.8); d(x)(2)

# DESARROLLADO POR BARUC


#DESARROLLADO (MODIFICADO)PARA EL CASO

dbinom(2,12,0.2)

pbinom(2,12,0.2)

pbinom(1,12,0.2, lower.tail = FALSE)

# DISTRIBUCIÓN POISSON

# 100 HORAS == PROMEDIO 8

# variable aleatoria == λ = (x)=8

# Falle 1 en 25 hrs

100/25

8/4

dpois(1, 2)

# Fallen no mas de 2 en 50 hrs

p(x<=2)

100/50

8/2

ppois(2, 4)

# Fallen al menos 10 en 125 hrs

100/125

8/0.8

1-ppois(9, 10)

ppois(9, 10,lower.tail = FALSE)

dpois(2, 3)
#DESARROLLADO POR ASTRID

dpois(2, 3)

ppois(1, 3)

# P(x>2)

ppois(2, 3, lower.tail = FALSE )

You might also like