Excercises

Excercise 1

A streak of length 1 represents a hit followed by a miss and preceeded by either a miss or nothing. A streak of length 0 represents a miss preceeded by a either a miss or nothing.

Excercise 2

The distribution is right skewed and bounded by 0 and 4. As the number of samples approaches infinity, it should be negative binomial with r of 1, otherwise known as geometric, assuming hot hand theory is false. Kobe’s typical streak was 0-1 makes and his longest was 4 makes.

Excercise 3

outs <- c("heads", "tails")
probs = c(.2,.8)
my_sim <- sample(outs, size = 100, replace = TRUE, prob = probs)
heads <- sum(my_sim == "heads")
sprintf ("Total heads: %s", heads)
## [1] "Total heads: 26"

Excercise 4

set.seed(107)
outs <- c("H", "M")
probs <- c(.45,.55) #We just adjust the probability vector to make it refelct the shooting percentage
sim_basket <- sample(outs, size = 133, replace = TRUE, prob = probs)
sim_basket
##   [1] "M" "M" "M" "M" "M" "M" "M" "H" "M" "M" "M" "M" "M" "M" "M" "H" "H"
##  [18] "H" "H" "M" "M" "M" "M" "M" "H" "H" "H" "H" "H" "H" "H" "M" "H" "M"
##  [35] "M" "M" "H" "H" "H" "M" "H" "M" "M" "H" "M" "M" "M" "H" "H" "M" "H"
##  [52] "H" "H" "M" "H" "H" "M" "M" "M" "H" "M" "H" "H" "H" "H" "M" "H" "H"
##  [69] "M" "H" "H" "H" "M" "H" "H" "H" "M" "M" "M" "M" "M" "M" "H" "M" "M"
##  [86] "M" "H" "H" "M" "H" "H" "M" "M" "H" "H" "M" "M" "M" "H" "H" "H" "H"
## [103] "M" "M" "M" "H" "M" "M" "M" "M" "H" "H" "M" "M" "H" "M" "M" "M" "M"
## [120] "M" "H" "H" "M" "H" "H" "M" "H" "M" "H" "M" "M" "H" "H"

On Your Own

library(ggplot2)
library(DATA606)
## 
## Welcome to CUNY DATA606 Statistics and Probability for Data Analytics 
## This package is designed to support this course. The text book used 
## is OpenIntro Statistics, 3rd Edition. You can read this by typing 
## vignette('os3') or visit www.OpenIntro.org. 
##  
## The getLabs() function will return a list of the labs available. 
##  
## The demo(package='DATA606') will list the demos that are available.
## 
## Attaching package: 'DATA606'
## The following object is masked from 'package:utils':
## 
##     demo
streaks <- data.frame(calc_streak(sim_basket))
colnames(streaks) <- "streak"
ggplot(streaks) + geom_bar(aes(x = streak), fill = "darkgreen")

Question 1

This chart is fairly strongly right skewed. The typical streak is between 0 and 2 makes, but 0s far outweigh 1s and 2s. The longest streak is 7.

Question 2

Without calculating the pmf, I’d say a second simulation should look somewhat similar, but given that 133 isn’t that many samples, there is a significant amount of variability. The count of 1s and 2s looks a little low in this particular example.

Question 3

This chart resembles Kobe’s chart, as it is right skewed. However, there is a sharper drop-off between 0 and 1, and a differently shaped tail. If anything, this independant shooter’s streaks fit the pattern of a hot hand, with more streaks of 4+. There is definietley not sufficient evidence here to say anything about the hot hand model.