Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve in MATLAB 2. Monopoly dice (Siauw & Bayen p.92) Assume you are rolling two six-sided dice, each side having an equal chance of occurring.

Solve in MATLAB

image text in transcribed

2. Monopoly dice (Siauw & Bayen p.92) Assume you are rolling two six-sided dice, each side having an equal chance of occurring. Write a function with first line function [roll] - myMonopolyDice () where roll is the sum of values of the two dice thrown but with the following extra rule: if the two dice rolls are the same, then another roll is made, and the new sum is added to the running total. Rolls stop when the dice rolls are different. The command result randi ( [1 6], 2, 1) will simulate the rolling of two dice. Test Case: rolls - zeros (1,1e5); for k 1: 1e5 rolls (k) - myMonopolyDice; bins -[0.5:30.5] histogram (rolls,bins) xlabel ('Roll Value') ylabel (Number of Occurences') title ('Histogram of Monopoly Dice Rolls) xticks ([1:301) Histogram of Monopoly Dice Rolls 18000 16000 14000 12000 10000 8000 6000 4000 2000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Roll Value Since the process is random, your graph may not look exactly like this. You may also have to extend the horizontal dimension of your graph so the x-axis labels do not overlap. If you only use the plotting statement histogram (rolls), you will see the full extent of the rolls, which may go up to 90

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

8. Demonstrate aspects of assessing group performance

Answered: 1 week ago