Simulate 1000 rolls of a pair of dice. (Hint: Sounds like a For Loop to me!)
Write a program that simulates a dice roll by picking a random number from 1-6 and then picking a second random number from 1-6.
How many times do you get two 1’s.
What many times do you get two 1’s if you simulate 10,000 rolls of a pair of dice?
Upload your program and type the answer to the two questions. (remember, these are random numbers, so I expect the answers will vary somewhat.)
1 appeared 0 times.
This code can also be written in following way:
Now for 1000 iterations:
1 appeared 175 times.
These are Matlab codes.
Please do rate me and mention doubts, if any, in the comments section.
Get Answers For Free
Most questions answered within 1 hours.