Question: Write a matlab script that will simulate the roll of a 6-sided die. (a) Use the random function rand to simulate the roll of the
Write a matlab script that will simulate the roll of a 6-sided die. (a) Use the random function rand to simulate the roll of the dice ie roll is a randomly selected integer between 1 and 6. Use the ceil function to round up to the next highest integer. (b) Set a number between 1 and 6 (c) Simulate a specified number of rolls (ie n=5 or 20 or 10^6) using a for loop (d) Count the number of times the roll matches your number (e) Check the odds. Was the chosen number rolled 1/6 of the time? (f) Calculate the percent difference in the actual odds versus the expected odds. (count-n/6)/(n/6)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
