Question
[20 points] Problem 5 Suppose you roll two fair six-sided dice. Let C be the event that the two rolls are close to one another
[20 points] Problem 5
Suppose you roll two fair six-sided dice. Let C be the event that the two rolls are close to one another in value, in the sense that they're either equal or differ by only 1.
Part A: Compute ()P(C) by hand.
Solution:
Part B: Write a simulation to run many trials (at least 10,000) of the pair of rolls and estimate the value of ()P(C) you calculated in Part A. Does your estimate agree with the exact calculation you did in Part A? If not, try increasing the number of trials in your simulation.
In [ ]:
# Your code here.
Part C: In the in-class notebook associated with Lecture 4 (nb04) we plotted a running estimate of the probability of an event as a function of the number of trials in our simulation. Write code to run at least 10 independent simulations of at least 50,000 trials each to estimate ()P(C) and plot their running estimate curves on the same set of axes. Hint: This is a lot of computation, so try to leverage Numpy as much as possible so that your code doesn't run forever.
In [ ]:
# Your code here.
Part D: Comment on the behavior of the running estimates as the number of trials increases.
Solution:
[20 points] Problem 5 Suppose you roll two fair six-sided dice. Let C be the event that the two rolls are close to one another in value, in the sense that they're either equal or differ by only 1. Part A: Compute P(C) by hand. Solution: Part B: Write a simulation to run many trials (at least 10,000) of the pair of rolls and estimate the value of P(C) you calculated in Part A. Does your estimate agree with the exact calculation you did in Part A? If not, try increasing the number of trials in your simulation. # Your code here. Part C. In the in-class notebook associated with Lecture 4 (nb04) we plotted a running estimate of the probability of an event as a function of the number of trials in our simulation. Write code to run at least 10 independent simulations of at least 50,000 trials each to estimate P(C) and plot their running estimate curves on the same set of axes. Hint: This is a lot of computation, so try to leverage Numpy as much as possible so that your code doesn't run forever. # Your code here. Part D: Comment on the behavior of the running estimates as the number of trials increases. Solution: [20 points] Problem 5 Suppose you roll two fair six-sided dice. Let C be the event that the two rolls are close to one another in value, in the sense that they're either equal or differ by only 1. Part A: Compute P(C) by hand. Solution: Part B: Write a simulation to run many trials (at least 10,000) of the pair of rolls and estimate the value of P(C) you calculated in Part A. Does your estimate agree with the exact calculation you did in Part A? If not, try increasing the number of trials in your simulation. # Your code here. Part C. In the in-class notebook associated with Lecture 4 (nb04) we plotted a running estimate of the probability of an event as a function of the number of trials in our simulation. Write code to run at least 10 independent simulations of at least 50,000 trials each to estimate P(C) and plot their running estimate curves on the same set of axes. Hint: This is a lot of computation, so try to leverage Numpy as much as possible so that your code doesn't run forever. # Your code here. Part D: Comment on the behavior of the running estimates as the number of trials increases. Solution
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