Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please use an R script to answer the question. Thank you! X is a random variable

ID: 3151843 • Letter: P

Question

Please use an R script to answer the question. Thank you!

X is a random variable with an exponential distribution with parameter lambda =.6 Thus the cdf of X is f(x) =.6 e^-6x for x greaterthanorequalto 0. Using the f(x) above and the R integrate function calculate the expected value of X. Using the dexp function and the R integrate command calculate the expected value of X. Calculate 1/.6. How is this related to the above answers? Calculate the probability that X > 2. Use the pexp function Calculate the probability that X > 1 standard deviation more than its expected value. Copy your R script for the above into the text box here.

Explanation / Answer

#(a)
> e=function(x){x*0.6*exp(-0.6*x)}
> i=integrate(e, 0,Inf)
> i
1.666667 with absolute error < 3.2e-06
> #(b)
> e1=function(x){x*dexp(x,0.6)}
> i1=integrate(e1, 0,Inf)
> i1
1.666667 with absolute error < 3.2e-06
> #(c)
> c=1/0.6
> #(d)
> e2=1-pexp(2,0.6)
> #(e)
> e2=function(x){0.6*exp(-0.6*x)}
> i2=integrate(e2, 1,1.66)
> i2
0.1794577 with absolute error < 2e-15