Solve following using Program R studio. Please show code andresults. Thank you.
3. Assume that ? is a random variable represents lifetime of acertain type of battery which is exponentially distributed withmean 60 hours. Â
a. Simulate 500 pseudorandom numbers (using set.seed(10)) andassign them to a vector called expran.
b. Calculate average of simulated data and compare it withcorresponding theoretical value.
c. Calculate probability that lifetime is less than 50 hours usingcumulative probability function.
d. Calculate the total lifetime for these 500 simulatedlifetimes.
e. Calculate 80th percentile using quantile function.