Professional Documents
Culture Documents
Kaushal Bhadra Comps A1-1 16010122015 14 February 2023 Tutorial-4: R
Kaushal Bhadra Comps A1-1 16010122015 14 February 2023 Tutorial-4: R
CODE
OUTPUT
Q2) If X is Poisson Distribution with mean 35
Write R-program to evaluate and print (i) P(X=0) (ii) P(X≤12) (iii) P(22≤X≤35)
CODE :
m <- 35
d <- dpois(0, m)
e <- ppois(12, m)
f <- ppois(35, m) - ppois(21, m)
cat("For X ~ Poisson(mean = 35):\n")
cat("P(X=0) =", d, "\n")
cat("P(X≤12) =", e, "\n")
cat("P(22≤X≤35) =", f, "\n")
cat("Name & Roll No:Kaushal Bhadra & 16010122015\n")
R Studio Screen
Q3. If X is Uniform Distribution over the range (1,15). Write R-
program to evaluate andprint (i) P(X<9.6) (ii) P(X>5.2) (iii) P(11.2<
X<14.5)
CODE :
R Studio Screen
OUTPUT:
Q5) If X is Normal Distribution with mean 60 and standard deviation 15. Write R-
program to evaluate
Find value of k1 such that P(X<k1) = 0.7. Also find k2 such that P(X>k2) = 0.84
CODE:
d <- pnorm(88, 60, 15)
e <- 1 - pnorm(35, 60, 15)
f <- pnorm(95, 60, 15) - pnorm(70, 60, 15)
k1 <- qnorm(0.7, 60, 15)
k2 <- qnorm(0.16, 60, 15) # 1 - 0.84 = 0.16
cat("For X ~ Normal(mean = 60, sd = 15):\n")
cat("P(X<88) =", d, "\n")
cat("P(X>35) =", e, "\n")
cat("P(70<X<95) =", f, "\n")
cat("Value of k1 such that P(X<k1) = 0.7 is", k1, "\n")
cat("Value of k2 such that P(X>k2) = 0.84 is", k2, "\n")
cat("Name, Roll No, Q No.: Kaushal Bhadra, 16010122015, Q5")
OUTPUT: