# A tibble: 6 × 6
vs game quarter time description shot
<fct> <int> <fct> <fct> <fct> <chr>
1 ORL 1 1 9:47 Kobe Bryant makes 4-foot two point shot H
2 ORL 1 1 9:07 Kobe Bryant misses jumper M
3 ORL 1 1 8:11 Kobe Bryant misses 7-foot jumper M
4 ORL 1 1 7:41 Kobe Bryant makes 16-foot jumper (Derek Fishe… H
5 ORL 1 1 7:03 Kobe Bryant makes driving layup H
6 ORL 1 1 6:01 Kobe Bryant misses jumper M
#Exercise 1 What does a streak length of 1 mean, i.e. how many hits and misses are in a streak of 1? What about a streak length of 0?
A streak of one is 1 hit followed by a miss meaning there is 1 hit and 1 miss in a streak of one. A streak of zero is when a miss follows another miss.
#Exercise 2 Describe the distribution of Kobe’s streak lengths from the 2009 NBA finals. What was his typical streak length? How long was his longest streak of baskets? Make sure to include the accompanying plot in your answer.
The most common streak length was 0, the longest streak was 4 baskets in a row.
#Exercise 3 In your simulation of flipping the unfair coin 100 times, how many flips came up heads? Include the code for sampling the unfair coin in your response. Since the markdown file will run the code, and generate a new sample each time you Knit it, you should also “set a seed” before you sample. Read more about setting a seed below.
In the unfair simulation there were 22 heads out of 100 flips.
What change needs to be made to the sample function so that it reflects a shooting percentage of 45%? Make this adjustment, then run a simulation to sample 133 shots. Assign the output of this simulation to a new object called sim_basket.
Within the sample function the code required for a shooting percentage is prob = c(0.45, 0.55) after “replace = TRUE”
Describe the distribution of streak lengths. What is the typical streak length for this simulated independent shooter with a 45% shooting percentage? How long is the player’s longest streak of baskets in 133 shots? Make sure to include a plot in your answer.
The distribution of the streaks is right skewed with the majority of streaks being 0.
boxplot(sim_streak, horizontal =TRUE)
#Exercise 7
If you were to run the simulation of the independent shooter a second time, how would you expect its streak distribution to compare to the distribution from the question above? Exactly the same? Somewhat similar? Totally different? Explain your reasoning.
It would be somewhat similar, due to random variance the distribution would not be exactly the same but it would not be totally different. This is due to the fact that hitting a high streak is an extremely low probability as opposed to a low streak which has a higher chance of happening.
#Exercise 8
How does Kobe Bryant’s distribution of streak lengths compare to the distribution of streak lengths for the simulated shooter? Using this comparison, do you have evidence that the hot hand model fits Kobe’s shooting patterns? Explain.
boxplot(kobe_streak, horizontal =TRUE)
boxplot(sim_streak, horizontal =TRUE)
The distribution of streak lengths between both the simulation and the Kobe Bryant data is similar. They both are left-skewed with a majority of the streaks being 0 or 1. This shows that Kobe’s shooting pattern is very similar to the independent shooting data and that the hot hand model doesn’t fit because there were a lot of short(0 or 1) streaks and only a few times where the streak went above 2.