DESCRIPTION Students: Please keep in mind the OMSI rules. Save your files often, make sure OMSI fills your entire screen at all times, etc. 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 add new lines. There may not be information given as to where the lines should be inserted. If a question includes test code, make sure to include it in your submission. Do not simplify R expressions. If your answer is wrong but largely corrected, the full expressions may show that you deserve partial credit. Do not answer any question with simulation code unless this is specified. MAKE SURE TO RUN THE CODE IN PROBLEMS INVOLVING CODE! Hit the OMSI Submit and Run button. QUESTION (Text answer, 25 pts.) In our class discussion of the "Pythagorean Theorem" for variance, we gave an explanation for the need for the second term in the formula. The (hypothetical) example consists of a situation involving finding the variance in weight among all UCD students. Explain. QUESTION -ext .R -run 'Rscript omsi_answer2.R' (R code answer, 20 pts.) Say X has a binomial distribution with n = 2 trials and success probability p = 0.2. Find E(X | X <= 1). QUESTION -ext .R -run 'Rscript omsi_answer3.R' (R code answer, 30 pts.) Consider the "trick coins" example, pp.103ff of PSB. Let N denote the number of heads in the first two tosses. Find EN and Var(N). Your code must print these two quantities as a two-element vector, i.e. final line of code should be print(c(eN,varN)) QUESTION -ext .R -run 'Rscript omsi_answer4.R' (R code answer, 25 pts.) In data from a subset of an old census, there were six occupations. The R vectors below give the within-occupation wage means, wage variances and proportions of the six occupations: means <- c(50396.47,51373.53,68797.72,53639.86,67019.26,69494.44) vars <- c(2314077046,1822538680,2357274094,1576480779,3312502360,2732145307) props <- c(0.22857143,0.22389248,0.33947237,0.02493778,0.03992036,0.14320557) For example, the third occupation made up about 34% of the total rows in the dataset, and the mean wage and variance of wage in that occupation were 68797.72 and 2357274094, respectively. Find and print the variance of wage in the entire dataset.