Answered step by step
Verified Expert Solution
Question
1 Approved Answer
matlab Problem 2. Rolling a pair of dice Many games involve rolling 2 six sided die: Craps, Monopoly, D & D, etc... The games outcomes
matlab
Problem 2. Rolling a pair of dice Many games involve rolling 2 six sided die: Craps, Monopoly, D & D, etc... The games outcomes are determined by the rolls. For example, in Craps if the combined value of the two dice on a come-out roll equals 2, 3, or 12, then this is "crapping out" and the round is over. If the come-out roll is 7 or 11, the round is also over. What are the probabilities of all sums that can be made from rolling two dice? (Note that the possible sums that can be made from rolling two six sided dice are 2,3,4,5,6,7,8,9,10,11,and 12). This is relatively simple question to answer mathematically in closed form. However, we are not mathematicians and that is no fun anyway. We will use the awesome power of our computers' processors, tons of memory, and the infinite energy supplied by the electrical grid to simulate rolling two dice. 1. Simulate rolling the first die by choosing a random integer between 1 and 6. 2 Simulate rolling the second die by choosing a random integer between 1 and 6. 3. Add the results of the two rolls. 4. Store the counts for each possible sum. 5. Repeat 10000 trials. 6. Compute the probabilities as count/10000 count 260 558 891 1078 1305 1637 1396 1154 850 596 275 probability % 2.6 5.6 8.9 10.8 13.0 16.4 14.0 11.5 8.5 6.0 2.8 Write a script to answer the following questions: a) What is your simulated probability of a losing roll in craps ? (rolling a 2, 3, 7, 11, or 12) ? Type your answer here Modify your simulation to answer the following questions: b) What is the probability of rolling no pairs ? Type your answer here c) What is the probability that at neither of the dice will be 6? Type your answer here Note: I do not have code to check your answers for this problem. 1 % Insert your dice code here 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