Professional Documents
Culture Documents
21bme0100 VL2022230502367 Ast03
21bme0100 VL2022230502367 Ast03
STATISTICS LAB
LAB EXPERIMENT-3
Registration 21BME0100
Number:
Date: 21/3/23
a)
Code
p=pbinom(4, 6, 0.95, lower.tail = FALSE)
p
OUTPUT
b)
Code
p=pbinom(4, 6, 0.95) - pbinom(1, 6, 0.95)
p
OUTPUT
c)
Code
x=seq(0,6)
y=dbinom(x, 6, 0.95)
barplot(y, names.arg = x, xlab ="Number of successful missions", ylab "Probability", col = "red", ylim =
c(0, 1))
Output
d)
Code
n=6
p=0.95
q=1-p
mean=n*p
variance= n*p*q
mean
variance
Output
e)
Code
X=seq(0,6)
y =pbinom(x, 6, 0.95)
plot(x, y, type = "s", col = "blue", xlab = "Number of successful missions", ylab = "Cumulative
probability", main = "cumulative dist function of successful missions to the moon")
OUTPUT
a)
Code
p=1-ppois(5, 3)
p
OUTPUT
b)
Code
lambda=3
p=ppois(100, lambda)-ppois(10, lambda)
p
x=seq(0,200)
plot( dpois(x, lambda), type = "h",main = "Poisson Distribution with Mean 3", xlab = "Number of Cells",
ylab = "Probability")
abline(v = 10-0.5, col = "blue", lwd = 2, lty = 2)
abline(v = 100+0.5, col = "blue", lwd = 2, lty = 2)
text(55, 0.02, "P(10 < X < 100)", pos = 3)
Output
a)
Code
p=pbinom(2, 16, 0.05)
p
Output
b)
Code
p=1 - pbinom(3, 16, 0.05)
p
Output
c)
Code
x=seq(0,16)
y=dbinom(x,size=16,0.05)
hist(y)
Output
For Skewness
avg=sum(y)/16
avg
N=16
m2=(1/N)*sum((y-avg)^2)
m2
m3=(1/N)*sum((y-avg)^3)
m3
b1=m3/(m2)^(3/2)
b1
if(b1==0)
{
message(sprintf("Symetric"))
}else
{if(b1>0)
{message(sprintf("Positively Skewed!"))
}else
{
message(sprintf("Negatively Skewed!"))
}}
m4=(1/N)*sum((y-avg)^4)
m4
b2=m4/(m2)^2
b2
if(b2==3)
{
message(sprintf("The graph is Mesokurtic!"))
}
if(b2>3)
{
message(sprintf("The graph is Leptokurtic!"))
}
if(b2<3)
{
message(sprintf("The graph is Platykurtic!"))
Output
a)
Code
p=1 - pnorm(150, 20, 40)
p
Output
b)
Code
p=pnorm(150, 20, 40) - pnorm(100, 20, 40)
p
Output
c)
Code
p=pnorm(90, 20, 40) - pnorm(60, 20, 40)
p
Output
THANK YOU