Question

Please use R programming to answer follow questions: Given that X has a normal distribution with...

Please use R programming to answer follow questions:

Given that X has a normal distribution with mean 18 and standard deviation 2.5, find

a. P(X < 15);

b. the value k such that P(X < k) = 0.2236;

c. the value k such that P(X > k) = 0.1814;

d. P(17 < X < 21).

0 0
Add a comment Improve this question Transcribed image text
Answer #1


#Given that X has a normal distribution with mean 18 and standard deviation 2.5,

# a. P(X < 15)

# mean m=18 and sd s=2.5
m <- 18
s <- 2.5
xbar <- 15
z <- (xbar-m)/s
#if z is positive then
if(z>=0)
{
res=pnorm(abs(z))
}
#if z is gegative then
if(z<0)
{
res=pnorm(-abs(z))
}
cat("P(X < 15) = " , res,"\n")

#b. the value k such that P(X < k) = 0.2236

#here p value is 0.2236
p<-0.2236
# z value will be generated
z<-qnorm(p)
# value of k calculation
k<-(z*s+m)
cat("The value of k for [P(X < k) = 0.2236 is ] : " , k,"\n")


#c. the value k such that P(X > k) = 0.1814

#as X>k so here p value will be 1-0.1814
p<-(1-0.1814)
# z value will be generated
z<-qnorm(p)
# value of k calculation
k<-(z*s+m)
cat("The value of k for [P(X > k) = 0.1814 is ] : " , k,"\n")

#d. P(17 < X < 21).

xbar <- 17
# z1 value will be generated
z1<- (xbar-m)/s
xbar <- 21
# z2 value will be generated
z2<- (xbar-m)/s
#if z1 is positive then
if(z1>=0)
{
res1<-pnorm(abs(z1))
}
#if z1 is negative then
if(z1<0)
{
res1<-pnorm(-abs(z1))
}
#if z2 is positive then
if(z2>=0)
{
res2<-pnorm(abs(z2))
}
#if z2 is negative then
if(z2<0)
{
res1<-pnorm(-abs(z2))
}
res=res2-res1
cat("P(17<X<21) = " , res,"\n")


SCREEN SHOT   

OUTPUT
  
  
  

Add a comment
Know the answer?
Add Answer to:
Please use R programming to answer follow questions: Given that X has a normal distribution with...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT