I’m taking a relatively rare (for the blog) detour into sports statistics. Golden State was a heavy favorite to beat Los Angeles on Sunday (3/6/16), but lost in part due to poor 3-point shooting, hitting a mere 4 of their 30 3-point attempts. This got me wondering just how unlikely that poor of a 3-point performance is.

To get something out of the way before we get into the math – I do believe there is a hot hand effect in basketball. However, outside of three-point shooting contests, where players shoot exactly the same shot multiple times in a row, the effect is fairly small – which is why a lot of the early papers missed it altogether. There’s also basically no evidence of a cold hand, which is what we’re investigating here. (See this article from Vox for a decent summary). All that’s just to say, an estimate based on the classic assumption that each shot is independent of the shot before it is just an estimate – but probably a fairly reasonable one.

This season, Golden State has made 41.2 percent of their 3pt attempts. This means when they shoot 30 times, we’d expect them to make around 12 or 13 of their shots. In fact, leaving the math aside for later, we can see that we’d expect exactly 12 threes to go in 14.6 percent of the time, with each possible outcome getting less and less likely as we move away from 12.

As you can see, the odds of the Warriors making exactly 4 threes is very small, and the odds of them making 3,2,1, or 0 threes is so small it doesn’t show up on the graph. Adding up the ways the Warriors could make 4 or fewer threes while shooting 30 times, the odds of them doing so are .099 percent.

Let’s add some context here by comparing the Warriors as a whole to Steph Curry. Curry was 1/10 from three in the Warrior’s loss, and this season he’s making his threes 45.9 percent of the time. Here’s the likelihood chart for Curry when he shoots 10 threes.

While Curry making 1 or fewer threes in 10 shots is rare, it’s not surprising to see it happen at least once a season. It happens just over 2 percent of the time. While this sounds pretty rare, it translates into 1 out of every 49 games, and the NBA plays an 82 game season, plus playoffs. (When talking about rare events it’s important to keep in mind how often there’s a chance for the event to occur).

By contrast, the Warriors as a team making only 4 out of 30 shots should only occur once every 1,007 games. So either we just saw cold shooting of the sort that should only happen about once every 12 seasons due to chance, or there was something about the defense or some other unknown factor that was throwing off the Warrior’s three-point attempts. (I expected the Warriors to win in a blowout and was watching the U.S. beat France in women’s soccer instead, so I don’t really know if there was something visibly different to explain the poor three-point shooting).

The comparison between the Warriors as a whole and Curry also shows just how quickly sample size starts to make a difference. The Warriors going 1 for 10 for their first 10 threes would be even less unusual than Curry going 1 for 10 (the team as a whole shoots less accurately than Curry). The difference is that the poor shooting by the team spanned an entire 30 shots. Shooting incredibly poorly over a 10 shot span might be a once a season occurrence, but shooting poorly over a 30 shot span is a once every 12 seasons occurrence.

A few words on the math in this post – uninterested readers can skip this as all the conclusions have already been mentioned above.

The odds of making any particular shot in basketball can be reasonably (though imperfectly) estimated using the same math used for calculating probabilities of a biased coin. Thus, if flipping heads is making a 3, we could say that the coin used for Curry has a 45.9 percent chance of landing on heads, while the coin used for the Warriors has a 41.2% chance of landing on heads. The math for then figuring out how likely it is to flip exactly k heads in n flips, with p percentage of flipping a head is well-established.

It’s a basic binomial distribution, where in the case of basketball it tells us the probability of making precisely k shots in n attempts given that p percentage of shots go in over the long run.

When 30 shots are taken, there are 31 possible outcomes (0-30) as seen in the first chart above. Calculating this separately for each would be quite tedious. Fortunately, the R statistical programming language allows this sort of calculation and doesn’t even require any looping. k can simply be a vector of all possible outcomes 0 through n. The code I used for the calculations and graphs in this post is below.

##Setting up a function to calculate binomial probabilities binomial<-function(k,n,p){ factorial(n)/(factorial(k)*(factorial(n-k)))*p^k*(1-p)^(n-k) } ##Calculating odds of Warrior's making 4 or fewer threes bin.prob<-binomial(k=0:30,n=30,p=.412) sum(bin.prob[1:5])#The first five possible outcomes are 0,1,2,3, and 4. 100/(sum(bin.prob[1:5])*100)#Translates to this happening every X games ##Graphing library("ggplot2") library("ggthemes") k<-0:30 data<-data.frame(k,bin.prob) plot<-ggplot(data, aes(x=as.factor(k),y=bin.prob))+geom_bar(stat="identity", fill="blue") plot<-plot+ggtitle("Distribution of 3-pointers made when the Warriors shoot 30 3-pointers")+ ylab("Likelihood of making X number of threes")+ xlab("Number of made threes") plot+theme_tufte() ##Steph Curry s.curry<-binomial(k=0:10,n=10,p=.459) sum(s.curry[1:2])#Odds of Curry making 0 or 1 threes 100/(sum(s.curry[1:2])*100)#This happens once out of X games k<-0:10 data.c<-data.frame(k,s.curry) plot.c<-ggplot(data.c, aes(x=as.factor(k),y=s.curry))+geom_bar(stat="identity", fill="blue") plot.c<-plot.c+ggtitle("Distribution of 3-pointers made when Curry shoots 10 3-pointers")+ ylab("Likelihood of making X number of threes")+ xlab("Number of made threes") plot.c+theme_tufte()