Professional Documents
Culture Documents
Stats Theory Da 2 PDF
Stats Theory Da 2 PDF
DIGITAL ASSIGNMENT - 2
BINOMIAL DISTRIBUTION
23% of all the IT servers in India crash everyday. If 200 servers from
India are selected at random, calculate the following :
a. Sketch the probability mass function.
b. Sketch the cumulative distribution function.
c. Probability that exactly two of them will crash today.
d. Probability that at most 10 of them will crash today.
e. Probability that between 5 to 8 servers (inclusive) will crash
today.
f. Probability that at least 100 servers will crash.
g. Probability that all servers will crash.
h. Probability that no server will crash.
i. Give the Mean of X
j. Give the variance of X.
Solution:
a.
plot(0:200,dbinom(0:200,200,0.23),type='o',xlab='Number of
Servers(X)',ylab='Probability of X servers crashing')
Subham Subhasish Panda - 19BIT0093
DIGITAL ASSIGNMENT - 2
b.
plot(0:200,pbinom(0:200,200,0.23),type='o',xlab='Number of
Servers(X)',ylab='Probability of at most X servers crashing')
Subham Subhasish Panda - 19BIT0093
DIGITAL ASSIGNMENT - 2
c.
#P(X=2)
dbinom(2,200,0.23)
d.
#P(X<=10)
pbinom(q=10,size=200,prob=0.23,lower.tail=T)
e.
#P(5<=X<=8)
sum(dbinom(5:8,200,0.23))
Subham Subhasish Panda - 19BIT0093
DIGITAL ASSIGNMENT - 2
f.
#P(X>=100)
1 - pbinom(q=100,size=200,prob=0.23,lower.tail=F)
g.
#P(X=0)
dbinom(0,200,0.23)
h.
#P(X=200)
dbinom(200,200,0.23)
i.
x=dbinom(0:200,200,0.23)
p=0.23
Subham Subhasish Panda - 19BIT0093
DIGITAL ASSIGNMENT - 2
IEx=sum(x*p)
j.
sum((x-IEx)^2*x)
Subham Subhasish Panda - 19BIT0093
DIGITAL ASSIGNMENT - 2
POISSON DISTRIBUTION
Solution:
Since the probability of success is very low and close to 0, we can apply
poisson distribution.
We have 𝜆 = np = 300*0.02 = 6
a.
plot(0:300,dpois(0:300,6),type='o')
b.
plot(0:300,ppois(0:300,6),type='o')
Subham Subhasish Panda - 19BIT0093
DIGITAL ASSIGNMENT - 2
c.
sum(dpois(3:300,6))
d.
dpois(20,6)
e.
ppois(10,6,lower.tail=T)
Subham Subhasish Panda - 19BIT0093
DIGITAL ASSIGNMENT - 2
f.
dpois(0,6)
g.
dpois(300,6)
h.
x=0:300
p=dpois(x,6)
Ex = sum(x*p)
Subham Subhasish Panda - 19BIT0093
DIGITAL ASSIGNMENT - 2
j.
var = sum((x-Ex)^2*p)