Question

Simulate 1000 rolls of a pair of dice. (Hint: Sounds like a For Loop to me!)...

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.)

Homework Answers

Answer #1

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.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
You roll a pair of fair dice repeatedly. Let X denote the number of rolls until...
You roll a pair of fair dice repeatedly. Let X denote the number of rolls until you get two consecutive sums of 8(roll two 8 in a row). Find E[X]
Dice Rolling) Write an application to simulate the rolling of two dice. The application should use...
Dice Rolling) Write an application to simulate the rolling of two dice. The application should use an object of class Random once to roll the first die and again to roll the second die. The sum of the two values should then be calculated. Each die can show an integer value from 1 to 6, so the sum of the values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 being the...
Using Python : consider the following experiment: You roll a pair of fair dice and calculate...
Using Python : consider the following experiment: You roll a pair of fair dice and calculate the sum of the faces. You are interested in the number of rolls it takes until you get a sum of "7". The first time you get a "7" the experiment is considered a "success". You record the number of rolls and you stop the experiment. You repeat the experiment N=100,000 times. Each time you keep track of the number of rolls it takes...
Setup: 3 different people take turns rolling dice. They all get doubles WITHIN 3 ROLLS. NOT...
Setup: 3 different people take turns rolling dice. They all get doubles WITHIN 3 ROLLS. NOT IN A ROW. Each person waits their turn to roll. On each persons turn, they each roll doubles WITHIN 3 ROLLS. GIVEN THE FOLLOWING CONDITIONS: - There is a 25% chance that the dice are loaded so that:  Each die is loaded so that 6 comes up half the time P(6) = .5 for each die. The other numbers (1-5) are equally likely to show...
Classes/ Objects(programming language java ) in software (ATOM) Write a Dice class with three data fields...
Classes/ Objects(programming language java ) in software (ATOM) Write a Dice class with three data fields and appropriate types and permissions diceType numSides sideUp The class should have A 0 argument (default) constructor default values are diceType: d6, numSides: 6, sideUp: randomValue 1 argument constructor for the number of sides default values are diceType: d{numSides}, sideUp: randomValue 2 argument constructor for the number of sides and the diceType appropriate accessors and mutators *theoretical question: can you change the number of...
I need this coded in R: I have a program that simulates a fair dice. The...
I need this coded in R: I have a program that simulates a fair dice. The program rolls a fair coin 100 times and counts the number of 1's. The simulation is repeated 10^5 times and stored the outcomes in x and a histogram is plotted. I need to now draw a bell curve showing normal/gaussian distribution over the histogram. Code I have: dice <- function(n) { sample(c(1:6),n,replace = TRUE) } x<-dice(100) x<-numeric(10^5) for(n in 1:10^5){ x[n]<-sum(dice(100)==1) } hist(x, main="100...
One of the most popular games of chance is a dice game known as “craps”, played...
One of the most popular games of chance is a dice game known as “craps”, played in casinos around the world. Here are the rules of the game: A player rolls two six-sided die, which means he can roll a 1, 2, 3, 4, 5 or 6 on either die. After the dice come to rest they are added together and their sum determines the outcome. If the sum is 7 or 11 on the first roll, the player wins....
For this assignment, design and implement a class to represent a die (singular of "dice"). A...
For this assignment, design and implement a class to represent a die (singular of "dice"). A normal bag of dice for playing Dungeons and Dragons, for example, contains dice with the following numbers of sides: 4, 6, 8, 10, 12, 20, and 100. In this program, the sides (or faces) of the die are numbered, starting with one. The current face value of the die corresponds to the side that is currently facing upward. By default, the face value is...
In an experiment, two fair dice are thrown. (a) If we denote an outcome as the...
In an experiment, two fair dice are thrown. (a) If we denote an outcome as the ordered pair (number of dots on the first die, number of dots on the second die), write down the sample space for the experiment. (So a roll of “1 dot” on the first die and a roll of “3 dots” on the second die would be the ordered pair (1, 3) in the sample space S.) You can think of the first die as...
Bunco is a group dice game that requires no skill. The objective of the game is...
Bunco is a group dice game that requires no skill. The objective of the game is to accumulate points by rolling certain combinations. The game is played with three dice, but we will consider a simpler version involving only two dice. How do you play two dice Bunco? There are six rounds, one for each of the possible outcomes in a die, namely the numbers one through six. Going clockwise, players take turns rolling two dice trying to score points....