Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

7. Discuss the implications of a skill-based pay plan for training.

Answered: 1 week ago

Question

4. Make recommendations on steps to take to melt the glass ceiling.

Answered: 1 week ago