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...
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...
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....
You are playing another dice game where you roll just one die--this time, you lose a...
You are playing another dice game where you roll just one die--this time, you lose a point if you roll a 1. You are going to roll the die 60 times. Use that information to answer the remaining questions. A. What are the values of p and q? (Hint: notice this is binomial data, where p is the probability of losing a point and q is the probability of not losing a point.) p =    and q = B....
Two people play a game. Person 1 has a 6 sided dice and must roll 5,...
Two people play a game. Person 1 has a 6 sided dice and must roll 5, then 6, successively. Person 2 also has a 6 sided dice and must roll a 6, then a 6, consecutively. i) An observer says that person 1 and 2 have the same probability of obtaining their respective sequence (1/6*1/6=1/36). The observer also says that on average, they both need to throw the same amount of times in order to get the desired outcome. The...
JAVA: MUST BE DONE IN JAVA Assignment: Write algorithms and programs to play “non-betting” Craps. Craps...
JAVA: MUST BE DONE IN JAVA Assignment: Write algorithms and programs to play “non-betting” Craps. Craps is a game played with a pair of dice. In the game, the shooter (the player with the dice) rolls a pair of dice and the number of spots showing on the two upward faces are added up. If the opening roll (called the “coming out” roll) is a 7 (“natural”) or 11 (“yo-leven”), the shooter immediately wins the game. If the coming out...
Roll a pair of dice (one is red and the other is green). Let A be...
Roll a pair of dice (one is red and the other is green). Let A be the event that the red die is 4 or 5. Let B be the event that the green die is 1. Let C be the event that the dice sum is 7 or 8. Calculate P(A), P(B), P(C) Calculate P(A|C), P(A|B) Are the events A and C independent?                                                                                                                                     (20 points) Suppose box 1 has four black marbles and two white marbles, and box...