Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write and test a MATLAB program that simulates the experiment of rolling two die

ID: 671979 • Letter: W

Question

Write and test a MATLAB program that simulates the experiment of rolling two die. Your program should: (a) Define a 6 by 6 matrix. (b) Fill the matrix with elements whose values are aij = i + j. (c) Prompt the user for a number between 2 and 12. Determine the probability that a roll of two die will result in the number that the user has specified. Repeat until the user provides a negative number as input. (d) Simulate experiments that involve rolling two die. Allow the user to specify the number of times die are to be rolled. Keep track of the number of outcomes for each possible combination. (e) Print out matrices that show the relative frequency of each outcome for experiments that simulate 36, 1000 and 10,000 rolls of the die.

Explanation / Answer

table()

for i:= 2:12

Die := table(i, i)

events = rand(36,1);

for j=1:max(size(events))

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote