Please give all the R-studio coding for all parts. Question 3:(a) Generate a ran
ID: 3303864 • Letter: P
Question
Please give all the R-studio coding for all parts.
Explanation / Answer
> set.seed(3585)
>
> ## a)
> exprobs=rexp(10,1)
> exprobs
[1] 0.65988257 1.04304028 0.04589163 1.28298864 2.46789697 1.99693847
[7] 1.85585207 0.66871055 0.07491813 0.06275139
>
> # b)
>
> newexprobs=rep(exprobs, c(1:10))
> newexprobs
[1] 0.65988257 1.04304028 1.04304028 0.04589163 0.04589163 0.04589163
[7] 1.28298864 1.28298864 1.28298864 1.28298864 2.46789697 2.46789697
[13] 2.46789697 2.46789697 2.46789697 1.99693847 1.99693847 1.99693847
[19] 1.99693847 1.99693847 1.99693847 1.85585207 1.85585207 1.85585207
[25] 1.85585207 1.85585207 1.85585207 1.85585207 0.66871055 0.66871055
[31] 0.66871055 0.66871055 0.66871055 0.66871055 0.66871055 0.66871055
[37] 0.07491813 0.07491813 0.07491813 0.07491813 0.07491813 0.07491813
[43] 0.07491813 0.07491813 0.07491813 0.06275139 0.06275139 0.06275139
[49] 0.06275139 0.06275139 0.06275139 0.06275139 0.06275139 0.06275139
[55] 0.06275139
> # b)
>
> newexprobs=rep(exprobs, c(1:10))
> newexprobs
[1] 0.65988257 1.04304028 1.04304028 0.04589163 0.04589163 0.04589163
[7] 1.28298864 1.28298864 1.28298864 1.28298864 2.46789697 2.46789697
[13] 2.46789697 2.46789697 2.46789697 1.99693847 1.99693847 1.99693847
[19] 1.99693847 1.99693847 1.99693847 1.85585207 1.85585207 1.85585207
[25] 1.85585207 1.85585207 1.85585207 1.85585207 0.66871055 0.66871055
[31] 0.66871055 0.66871055 0.66871055 0.66871055 0.66871055 0.66871055
[37] 0.07491813 0.07491813 0.07491813 0.07491813 0.07491813 0.07491813
[43] 0.07491813 0.07491813 0.07491813 0.06275139 0.06275139 0.06275139
[49] 0.06275139 0.06275139 0.06275139 0.06275139 0.06275139 0.06275139
[55] 0.06275139
>
> # c)
> mean(newexprobs) # mean
[1] 0.9450752
> sd(newexprobs) # standard deviation
[1] 0.8843645
>
> quantile(newexprobs, probs = c(0.25, 0.75))
25% 75%
0.07491813 1.85585207