Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB scripts Consider the following script: clear; d= roll_2_dice (10000,100); [freq, prop] = tabulate_2_dice(d) ; disp (freq); disp (prop); This generates the following variables: Where
MATLAB scripts
Consider the following script: clear; d= roll_2_dice (10000,100); [freq, prop] = tabulate_2_dice(d) ; disp (freq); disp (prop); This generates the following variables: Where - d is the simulated dice rolls in a row vector. - freq is a 112 array that contains the frequency of each combination. For example, freq(1) should always be zero, as the minimum combination of rolls is 2 [1+1). You would expect freq(7) to be the highest ( 1/6 of all outcomes). - prop is a 112 array that contains the proportions of each outcome. For example, the outcome of the number seven is shown below. freq(7) ans =1655 prop(7) ans =0.1655 Your task is to implement the functions roll_2_dice and tabulate_2_dice. These are summarised belowStep 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