Question: Please answer the following question by using R and creating an R script. Thanks. Q2. (15%) The face value X from throwing a loaded die

Please answer the following question by using R and creating an R script. Thanks.

Please answer the following question by using R and creating an R

Q2. (15%) The face value X from throwing a loaded die has the following probability distribution: X 2 3 4 5 6 P (X = x) 1/6 1/6 1/6 0 1/2 a) Please compute the mean and variance of X (Le. E(X) & Var(X)) using R code. b) Write a piece of R function LLN_Die with an argument n to show that as n becomes larger the sample average converges to E(X) in a graph, where n is the number of throws. LL.N.Die = function(n) { #LLN.Dice: Law of Large Number for Throwing a Die #Body of code [ You need to present your function in both word and R script file] c) Show your figure and present the sample average when n reaches 150 [Le., print out the last average number when you apply the function: LLN.Die(n = 150)]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!