1) Consider a game where you role three fair dice and count the total. The dice are eight, ten and twelve sided respectively. (a) Write an R function that will compute one round of this game. Have it return the values of the three dice and their total. Store the dice roles by the number of sides of the dice (smallest to largest). (b) Using the code in (a) write a function that will simulate n rounds of the game. (c) Suppose you win another role if the total of the three dice roles is less than or equal to 14. Write an R function that will compute the proportion of roles that meet this criteria after n rounds.

Algebra & Trigonometry with Analytic Geometry
13th Edition
ISBN:9781133382119
Author:Swokowski
Publisher:Swokowski
Chapter10: Sequences, Series, And Probability
Section10.8: Probability
Problem 32E
icon
Related questions
Question
1) Consider a game where you role three fair dice and count the total. The dice are eight,
ten and twelve sided respectively.
(a) Write an R function that will compute one round of this game. Have it return
the values of the three dice and their total. Store the dice roles by the number of
sides of the dice (smallest to largest).
(b) Using the code in (a) write a function that will simulate n rounds of the game.
(c) Suppose you win another role if the total of the three dice roles is less than or
equal to 14. Write an R function that will compute the proportion of roles that
meet this criteria after n rounds.
(d) Run (c) for n = 1000000. Repeat this five times and look at the results.
(e) What does this tell you about the odds of rolling a total of 14 or less?
(f) Suppose you win $100 if you role triple sevens. Write an R function that will
compute the proportion of roles that meet this criteria after n rounds.
(g) Run (f) for n = 1000000. Repeat this five times and look at the results.
(h) What does this tell you about the odds of rolling triple sevens?
(i) Suppose the game ends if you either role triple sevens or run out of free roles (sum
of dice > 14). Write an R function that returns a 1 if you win and zero otherwise.
(j) Using (i) what do you think are the odds of winning this game?
Submit your R code as ql.R. Also, please label each part (a)-(j) with a comment header
(i.e. # (a)). Use commented text (#) to answer any textual question.
Transcribed Image Text:1) Consider a game where you role three fair dice and count the total. The dice are eight, ten and twelve sided respectively. (a) Write an R function that will compute one round of this game. Have it return the values of the three dice and their total. Store the dice roles by the number of sides of the dice (smallest to largest). (b) Using the code in (a) write a function that will simulate n rounds of the game. (c) Suppose you win another role if the total of the three dice roles is less than or equal to 14. Write an R function that will compute the proportion of roles that meet this criteria after n rounds. (d) Run (c) for n = 1000000. Repeat this five times and look at the results. (e) What does this tell you about the odds of rolling a total of 14 or less? (f) Suppose you win $100 if you role triple sevens. Write an R function that will compute the proportion of roles that meet this criteria after n rounds. (g) Run (f) for n = 1000000. Repeat this five times and look at the results. (h) What does this tell you about the odds of rolling triple sevens? (i) Suppose the game ends if you either role triple sevens or run out of free roles (sum of dice > 14). Write an R function that returns a 1 if you win and zero otherwise. (j) Using (i) what do you think are the odds of winning this game? Submit your R code as ql.R. Also, please label each part (a)-(j) with a comment header (i.e. # (a)). Use commented text (#) to answer any textual question.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
College Algebra
College Algebra
Algebra
ISBN:
9781337282291
Author:
Ron Larson
Publisher:
Cengage Learning