DESCRIPTION Please keep in mind the OMSI rules. Save your files often. Submit each answer individually and make sure you receive the notification of successful submission. Don't wait till the last moment to submit all answers, as there might be network traffic in the last 5 minutes causing unexpected delay and failure. Remember that clicking CopyQtoA will copy the entire question box to the answer box. In questions involving code which will PARTIALLY be given to you in the question specs, you may need to add new lines. There may not be information given as to where the lines should be inserted. MAKE SURE TO RUN THE R CODE ANSWER IN PROBLEMS THAT INVOLVE R CODE! QUESTION (text answer - 10 pts) In our class discussion of Eqn. (3.38), we said that if statistics were invented today rather than in the pre-computer era, that expression probably would be different. Specify how it would change. QUESTION (text answer - 10 pts) E(X + Y) = E(X) + E(Y) if and only if X and Y are independent random variables. True or False? QUESTION -ext .R -run 'Rscript ./omsi_answer3.R' (R code answer - 10 pts) Say C and F are temperature in Celsius and Fahrenheit, respectively. Suppose Var(F) = 3.2. Find Var(C). QUESTION -ext .R -run 'Rscript ./omsi_answer4.R' (R code answer - 10 pts) In the second library model, Sec. 3.9.2, find Var(B). QUESTION (text answer - 10 pts) I keep tossing a coin. Let N_k denote the number of heads after k tosses, and let R_k denote the proportion of heads among the first k tosses. Which ones of the following are true: (i) Var(N_k) is increasing in k (ii) Var(R_k) is increasing in k (iii) Var(N_k) is decreasing in k (iv) Var(R_k) is decreasing in k (v) none of the above is true QUESTION -ext .R -run 'Rscript ./omsi_answer6.R' (R code answer - 10 pts) Consider independent random variables I and X. I is an indicator random variable with P(I = 1) = p. X has expected value q and variance r. Set Y = IX. Write a function vary(p,q,r) that computes Var(Y), and print the value of vary(0.4,15,6). vary <- function(p,q,r){ VarY <- # fill blank } print(vary(0.4,15,6)) QUESTION (text answer - 10 pts) Let X and Y be two indicator random variables with nonzero expectations. Write true or false for each of the statements below: (i) It is mathematically possible to have E((X+Y)^4) = 16 (ii) It is mathematically possible to have E((X-Y)^3) = -1 QUESTION -ext .R -run 'Rscript ./omsi_answer8.R' (R code answer - 10 pts) I and J are two indicator random variables. If E(I+J) = 0.8 and E((I-J)^2) = 0.5, what is E((I+J)^3)? (Hint: If W is an indicator variable, then W^k = W for any k > 0.) QUESTION -ext .R -run 'Rscript ./omsi_answer9.R' (R code answer - 10 pts) Consider the bus ridership example, Sec. 2.11. Write simulation code to find the variance of the number of passengers that alight at the 2nd stop. varalight <- function(nreps) { # modify this code below, from Sec. 2.14.8, or write your own code nstops <- 10 count <- 0 for (i in 1:nreps) { passengers <- 0 for (j in 1:nstops) { if (passengers > 0) for (k in 1:passengers) if (runif(1) < 0.2) passengers <- passengers - 1 newpass <- sample(0:2,1,prob=c(0.5,0.4,0.1)) passengers <- passengers + newpass } if (passengers == 0) count <- count + 1 } return(count/nreps) } set.seed(9999); print(varalight(10000)) QUESTION -ext .R -run 'Rscript ./omsi_answer10.R' (R code answer - 10 pts) Consider the board game, Sec. 2.10. Write simulation code to find ET, where T is the number of times we reach or pass 0 during the first m turns. et <- function(m,nreps) { # modify this code below, from Sec. 2.14.9, or write your own code count4 <- 0 countbonusgiven4 <- 0 for (i in 1:nreps) { position <- sample(1:6,1) if (position == 3) { bonus <- TRUE position <- (position + sample(1:6,1)) %% 8 } else bonus <- FALSE if (position == 4) { count4 <- count4 + 1 if (bonus) countbonusgiven4 <- countbonusgiven4 + 1 } } return(countbonusgiven4/count4) } set.seed(9999); print(et(3,10000))