Question: Help with some Matlab Write a program for n loops (n=1e5), to find the values for random dice rolls for 3 dice and find out

Help with some Matlab

Write a program for n loops (n=1e5), to find the values for random dice rolls for 3 dice and find out if 2 or 3 dice have the same value in each roll. (you are not required to save the dice values for all the loops) Define variables to track this for each of the n loops. (You should have 2 variables to keep track if only 2 dice values are the same, or all 3 are). A way of doing this is to ask if dice 1s value (D1) is equal to D2 and D3 in the ath loop, if yes then S3count(a)=1, if not S3count(a)=0.

Commands: a) if D1==D2 && D2==D3 (the && acts as an AND operator) ... %option1 elseif (option to check for 2 dice overlaps you can use || as an OR operator) ... %option2 end this allows a question to be asked, depending on the answer one of two things can occur (option 1 or 2), or more options if elseif is used.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!