Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 6 [R - 16 points]. In this problem, you will conduct an experiment via a reproducible simulation using the probability distribution in problem
Problem 6 [R - 16 points]. In this problem, you will conduct an experiment via a reproducible simulation using the probability distribution in problem 5. In class, we've learned how to use the 'sample() function in order to have R sample from a vector of possible outcome values according to a vector of probabilities for those values. When sampling from the distribution in problem 5, be sure to enter the exact probabilities into your probability vector when using the 'sample() function. Remember that you can always visit the documentation page by typing and running sample in the console! Adjust the figure alignment and figure sizes in your R chunk options to ensure that your plots are reasonably sized. Use headers to label each question part you are answering. Use your student number as your seed for every random sampling below and ensure you choose appropriate graph titles, axis labels, etc. so it is clear to any reader what information is presented in each graph and can easily distinguish between the graphs. A sample rmd template is provided for you to use to help the different parts of the problem. a) (3 points) Sample 15 values from the distribution of Y and store them in a tibble called 'n15'. Plot a fully labeled density histogram of your data in 'n15' using bins of width 1, centred on the integers -4, -1, 3, and 5. (see your R. Lab #1 materials!). b) (3 points) Sample 15.000 values from the distribution of W and store them in a tibble called 'n15k'. Plot a fully labeled density histogram of your data in 'n15k' using bins of width 1, centred on the integers -4, -1.3. and 5. e) (3 points) Compare the simulated histograms in parts (a) and (b). Do both histograms appear to match the probability distribution described by the PMF table in problem 5? Does one histogram appear to be more accurate or closer to the true distribution of Y over the other? Provide a logical explanation for the discrepancy, if it exists. d) (7 points) Now, to your tibble in part (b), add a second column called 'sum'. This column should take 5 randomly generated board game steps and record the sum of the five steps. Do this 15,000 times so you have 15,000 sums in your 'sum' column. Plot a density histogram of this data. How does it compare to the density histogram of the original quantity Y? Comment on any differences in: shape, expected value, and spread.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started