Question 5.
Explain whether you believe you can accurately use a sample size of 500 to determine
the maximum. What is one problem with using the maximum as your estimator? Use the histogram
above to help answer.
BEGIN QUESTION
name: q4_5
manual: true

1.5
5. Assessing Gary’s Models
Games with Gary
Our friend Gary comes over and asks us to play a game with him. The game
works like this:
We will flip a fair coin 10 times, and if the number of heads is greater than or equal to
5, we win!
Otherwise, Gary wins.
We play the game once and we lose, observing 1 head. We are angry and accuse Gary of cheating!
Gary is adamant, however, that the coin is fair.
Gary’s model claims that there is an equal chance of getting heads or tails, but we do not believe
him. We believe that the coin is clearly rigged, with heads being less likely than tails.
Question 1
Assign
coin_model_probabilities
to a two-item array containing the chance of
heads as the first element and the chance of tails as the second element under Gary’s model. Since
we’re working with probabilities, make sure your values are between 0 and 1.

Question 2
We believe Gary’s model is incorrect. In particular, we believe there to be a smaller chance of heads.
Which of the following statistics can we use during our simulation to test between the model and
our alternative? Assign
statistic_choice
to the correct answer.
1. The distance (absolute value) between the actual number of heads in 10 flips and the expected
number of heads in 10 flips (5)
13

2. The expected number of heads in 10 flips
3. The actual number of heads we get in 10 flips
BEGIN QUESTION
name: q5_2
manual: false
[9]:
statistic_choice
= 3
#SOLUTION
statistic_choice
[9]:
3
Question 3
Define the function
coin_simulation_and_statistic
, which, given a sample size
and an array of model proportions (like the one you created in Question 1), returns the number of
heads in one simulation of flipping the coin under the model specified in
model_proportions
.
Hint:
Think about how you can use the function
sample_proportions
.
BEGIN QUESTION
name: q5_3
manual: false
[14]:
def
coin_simulation_and_statistic
(sample_size, model_proportions):
# BEGIN SOLUTION
simulation
=
sample_proportions(sample_size, model_proportions)
statistic
=
sample_size
*
simulation
.
item(
0
)
return
statistic
# END SOLUTION
coin_simulation_and_statistic(
10
, coin_model_probabilities)
[14]:
5.0