Exercise 1

  1. A streak of 1 means he made a shot and missed. This has to also be preceded by a miss.
  2. A streak of 0 means he missed that was also preceded by a miss.

Exercise 2

#Exercise 2

kobe_streak <- calc_streak(kobe_basket$shot)
ggplot(data = kobe_streak, aes(x = length)) +
    geom_bar()

 print(mean(kobe_streak[,1])) 
## [1] 0.7631579

The distribution seems to be skewed to the right. The typical streak length would be an average of the streak lengths which is .76.

Exercise 3

set.seed(232332)
outcomes <- c("heads", "tails")

sim_unfair_coin <- sample(outcomes, size = 100, replace = TRUE, prob = c(0.2, 0.8))
table(sim_unfair_coin)
## sim_unfair_coin
## heads tails 
##    23    77

There were 23 heads in my trial.

Exercise 4

shot_outcomes <- c("H", "M")
sim_basket <- sample(shot_outcomes, size = 133, replace = TRUE,prob = c(0.45, 0.55))

In order to reflect the same shooting percentage, we need to change the probabilities to .45 to hits.

Exercise 5

sim_streak = calc_streak(sim_basket)

Exercise 6

ggplot(data = sim_streak, aes(x = length)) +
    geom_bar()

 print(mean(sim_streak[,1])) 
## [1] 0.6962025

The streak lengths are somewhat similar in that they are both right skewed. The longest streak of baskets in 133 shots is 5.

Exercise 7

If i were to run the simulation the second time, it would be the same considering the same seed was used. Otherwise, I would expect it to be somewhat similar. Just like the coin tosses, we had similar results with slight deviations.

Exercise 8

Kobe Bryant’s distribution of streak lengths were somewhat similar to the streak lengths of the sim. The average of their streaks were slightly higher in Kobe’s case by 7%. It seems like that is significant enough to me to consider that the hot hand model fits to some extent though more trials would have to be needed and more data collected.