Question
Question:1 You are playing a game where a fair die is rolled fifirst and then a fair coin is tossed a number of times equal
Question:1
You are playing a game where a fair die is rolled fifirst and then a fair coin is tossed a number of
times equal to the face of the die (e.g. if the die shows three, the coin is tossed three times, and this
combination is considered as one game).
a)[1 point] Let X be the number of heads(H) you can get in any game.
Write down the probability mass function of X. (this part is not a simulation question. Calculate
ALL the probabilities and produce a table that represents the pmf)
Calculate E[X] using your pmf.
b)[1 point] Write an R code that will simulate this game 100,000 times.
save the outputs from your simulation(no need to print the outputs).
Use these outputs to calculate an estimate of E[X].
c)[1 point] Suppose you are told that if the number on the die is odd you get a dollar value equivalent
to the corresponding X value(e.g. the die shows three, the coin is tossed three times, if there are two
heads you get $2).
But if the number on the die is even, you have to pay a dollar value equivalent to X.
Calculate an estimate of your expected gain from each game (You can use numeric calculations
as you have done in part(a) or you can use your simulation from part(b) to answer this question).
Expected output:
(a) Numeric calculations and a pmf table.
(b) R code and just one line of R output giving your estimate.
(c) Either show numeric calculations or R code with one line of output depending on how you
answered it.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started