Answered step by step
Verified Expert Solution
Question
1 Approved Answer
How would you do this in R? I created a sample using rep_len() for each specified color and number of marbles then combined them into
How would you do this in R? I created a sample using rep_len() for each specified color and number of marbles then combined them into one vector and created a sample set using sample() but I can't figure out how to plot them as asked
There is an urn that has 100 marbles in it: 1 is red, 74 are yellow, 10 are green and 15 are blue. Simulate data to imitate someone drawing a marble from the urn (replacing after each draw), with the color recorded at each draw. (a) Plot the fraction of times a yellow marble is drawn in the first 500 draws. On the x-axis, include the number of draws, and on the y-axis, include the cumulative fraction of yellow draws. Why does this number fluctuate more when the number of draws is smaller? (b) How many draws are needed before the fraction of yellow marbles drawn in the simulated data is close to the probability of drawing a yellow marble? You need to justify how you are defining close and what the optimal number of draws is. (c) Repeat the two steps above for the red marble. What do you notice that is different, and why do you think it is different? There is an urn that has 100 marbles in it: 1 is red, 74 are yellow, 10 are green and 15 are blue. Simulate data to imitate someone drawing a marble from the urn (replacing after each draw), with the color recorded at each draw. (a) Plot the fraction of times a yellow marble is drawn in the first 500 draws. On the x-axis, include the number of draws, and on the y-axis, include the cumulative fraction of yellow draws. Why does this number fluctuate more when the number of draws is smaller? (b) How many draws are needed before the fraction of yellow marbles drawn in the simulated data is close to the probability of drawing a yellow marble? You need to justify how you are defining close and what the optimal number of draws is. (c) Repeat the two steps above for the red marble. What do you notice that is different, and why do you think it is differentStep 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