Question

3. In this question we simulate the rolling of a die. To do this we use the func- tion runif (1),which returns a randomnumber in the range (0,1). To get a random integer in the range (1,2,3,4,5,6), we use ceiling(6 runif (1)) or if you prefer, sarple(1:6,size-1) will do the same job. (a). Suppose that you are playing the gambling game of the Chevalier de Méré. That is, you are betting that you get at least one six in 4 throws and of a die. Write a program prints out whether you win or lose. that simulates one round of this game Check that your program can produce a different result each time you run (b). Turn the program that you wrote in part (a) into a function sixes, which returns TRUE if you obtain at least one six in n rolls of a fair die, and returns FALSE otherwise. That is, the argument is the number of rolls n, and the value retued is TRUE if you get at least one six and FALSE otherwise How would you give n the default value of 4? EXERCISES 79 (c).Now write a program that uses your function sixes from part (b). to simulate N plays of the game (each time you bet that you get at least 1 six in n rolls of a fair die). Your program should then determine the proportion of times you win the bet. This proportion is an estimate of the probability of getting at least one 6 in n rolls of a fair die Run the program for 4 and N 100, 1000, and 10000, conducting several runs for each N value. How does the variability of your results depend on N? The probability of getting no 6s in n rolls of a fair die is (5/6), so the probability of getting at least one is 1 - (5/6). Modify your program so that it calculates the theoretical probability as well as the simulation estimate and prints the difference between them. How does the accurucy of your results depend on N? You may find the replicate function useful here

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
3. In this question we simulate the rolling of a die. To do this we use...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 3. In this question we simulate the rolling of a die. To do this we use...

    3. In this question we simulate the rolling of a die. To do this we use the func- tion runif (1),which returns a randomnumber in the range (0,1). To get a random integer in the range (1,2,3,4,5,6), we use ceiling(6 runif (1)) or if you prefer, sarple(1:6,size-1) will do the same job. (a). Suppose that you are playing the gambling game of the Chevalier de Méré. That is, you are betting that you get at least one six in 4...

  • Question 3 3 pts Matching problem [Choose] You roll a fair six-sided die 500 times and...

    Question 3 3 pts Matching problem [Choose] You roll a fair six-sided die 500 times and observe a 3 on 90 of the 500 rolls. You estimate the probability of rolling a 3 to be 0.18 Choose) You roll a fair six-sided die 10 times and observe a 3 on all 10 rolls. You bet the probability of rolling a 3 on the next rollis close to O since you have already had 10 3's in a row You assign...

  • In a dice game, you roll a fair die three times, independently. If you don’t roll...

    In a dice game, you roll a fair die three times, independently. If you don’t roll any sixes, you lose 1 dollar. If you roll a six exactly once, you win one dollar. If you roll a six exactly twice, you win two dollars. If you roll a six all three times, you win k dollars. (A) Let k = 3. What is the expected value of the amount you would win by playing this game (rounded to the nearest...

  • Use the "at least once rule to find the probability of getting at least one 4 in six rolls of a single fair die.

    Use the "at least once rule to find the probability of getting at least one 4 in six rolls of a single fair die. The probability is _______ 

  • Write a C PROGRAM that will simulate rolling a die. When rolling a die, one will...

    Write a C PROGRAM that will simulate rolling a die. When rolling a die, one will get a die face value of 1-6. We can use rand function and math ceiling function to get a random number of 1-6 generated. The program will simulating rolling 5 dice simultaneously and store their face values into an array of size 5. The program will keep rolling the dice and print the following: 1. All face values in one line 2. If any...

  • Suppose you physically simulate the random process of rolling a single die. (a) After 10 rolls...

    Suppose you physically simulate the random process of rolling a single die. (a) After 10 rolls of the die, you observe a "one" 2 times. What proportion of the rolls resulted in a "one"? (b) After 20 rolls of the die, you observe a "one" 6 times. What proportion of the rolls resulted in a "one"? (a) The proportion was Simplify your answer. Do not round.)

  • 15. Your friend challenges you to a game. She says that she is going to roll...

    15. Your friend challenges you to a game. She says that she is going to roll 2 6-sided dice. If the first die rolls at least 5, you win if the second die rolls less than 5. If the first die rolls less than 5, you win if the second die rolls at least 5. This seems fair. Is it? (a) What is the probability that you win this game? To incentivize you, your friend says that she will pay...

  • Topic: Probability Suppose you physically simulate the random process of rolling a single die. ​(a) After...

    Topic: Probability Suppose you physically simulate the random process of rolling a single die. ​(a) After 10 rolls of the​ die, you observe a​ "one" 1 times. What proportion of the rolls resulted in a​ "one"? ​(b) After 20 rolls of the​ die, you observe a​ "one" 3 times. What proportion of the rolls resulted in a​ "one"? ​(a) The proportion was _________. (b) The proportion was __________. ​(Simplify your answer. Do not​ round.) Note: I saw the solution posted...

  • Suppose you are rolling a fair four-sided die and a fair six-sided die and you are...

    Suppose you are rolling a fair four-sided die and a fair six-sided die and you are counting the number of ones that come up. What is the probability that both die roll ones? What is the probability that exactly one die rolls a one? What is the probability that neither die rolls a one? What is the expected number of ones? If you did this 1000 times, approximately how many times would you expect that exactly one die would roll...

  • Sally is rolling a fair 6-sided die. What is the probability that it takes 4 rolls...

    Sally is rolling a fair 6-sided die. What is the probability that it takes 4 rolls for her to get a six? 0.5787 0.005 0.5177 0.096 0.1667

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT