Saturday, October 6, 2012

Jeremy Lin vs The Ghost (Finding Patterns)


This is a follow up post to Jeremy Lin vs The Ghost.

Note: For this post, I decided to stick to the basic rules of probability. There are formulas and models that could be used for this problem, but we'll focus on doing some exploration.

Before answering our question, let's tackle the same question with smaller numbers to see if we can find any pattern that we can use to help us arrive at the solution. Instead of finding the probability of making 21 shots and missing at most 6, for now, let's use making 4 shots and missing at most 3. We will still assume his probability of making a shot is 71%.

There are several arrangements possible for 4 shots made and up to 3 missed shots. Let's write out the arrangements and see if we can get some insight. To keep things simple, we will be using S for success (made shot) and F for failure (missed shot). Here are the possible arrangements for wins (4 made shots in 4 to 7 attempts):
Shots Attempted 4 5 6 7
Outcome Summary 4S & 0F 4S & 1F 4S & 2F 4S & 3F
Possible arrangements
(disregarding rules)
SSSS
SSSSF
SSSFS
SSFSS
SFSSS
FSSSS
SSSSFF
SSSFSF
SSFSSF
SFSSSF
FSSSSF

SSSFFS
SSFSFS
SFSSFS
FSSSFS
SSFFSS

SFSFSS
FSSFSS
SFFSSS
FSFSSS
FFSSSS
SSSSFFF
SSSFSFF
SSFSSFF
SFSSSFF
FSSSSFF

SSSFFSF
SSFSFSF
SFSSFSF
FSSSFSF
SSFFSSF

SFSFSSF
FSSFSSF
SFFSSSF
FSFSSSF
FFSSSSF

SSSFFFS
SSFSFFS
SFSSFFS
FSSSFFS
SSFFSFS

SFSFSFS
FSSFSFS
SFFSSFS
FSFSSFS
FFSSSFS

SSFFFSS
SFSFFSS
FSSFFSS
SFFSFSS
FSFSFSS

FFSSFSS
SFFFSSS
FSFFSSS
FFSFSSS
FFFSSSS
One thing to note is that certain arrangements are just not possible. For example:
SSSSF
is not a possible arrangement since 4 shots were already made (S), there wouldn't be a 5th attempt that results in a miss (F).

In fact, every arrangement that has 4 made shots (S) and where the last shot is a miss (F) is not possible, the game would end before the last shot was even attempted. In the above table, the arrangements which are not possible are bolded. A summary of the arrangements are in the table below.
Shots Attempted 4 5 6 7
Outcome Summary 4S & 0F 4S & 1F 4S & 2F 4S & 3F
Number of arrangements
(disregarding rules)
1 5 15 35
Number of impossible arrangements
(last attempt is F)
0 1 5 15
Number of arrangements
(following rules)
1-0=1 5-1=4 15-5=10 35-15=20

The question is essentially "What is the probability that he makes 4 shots out of 4 attempts, 4 shots out of 5 attempts, out of 6 attempts, or out of 7." We will multiply the probability of those events occurring by the number of ways (different arrangements) it can occur and add them together.

We assumed earlier that the probability of making a shot is .71, so the probability of missing a shot (its complement) is 1-.71=.29.

For 4 successes in 4 attempts, we see there's only 1 way it can happen:
\[ \begin{align*}
& 1 * (.71)(.71)(.71)(.71) \\
& 1 * (.71)^4 \\
& 1 * .25411681 \\
& .25411681 \end{align*} \]For 4 successes in 5 attempts, we see there are 4 ways it can happen:
\[ \begin{align*}
& 4 * (.71)(.71)(.71)(.71)(.29) \\
& 4 * (.71)^4(.29) \\
& 4 * .25411681 * .29 \\
& 4 * .0736938749 \\
& .2947754996 \end{align*} \]For 4 successes in 6 attempts, we see there are 10 ways it can happen:
\[ \begin{align*}
& 10 * (.71)(.71)(.71)(.71)(.29)(.29) \\
& 10 * (.71)^4(.29)^2 \\
& 10 * .25411681 * .0841 \\
& 10 * .021371223721 \\
& .21371223721 \end{align*} \]For 4 successes in 7 attempts, we see there are 20 ways it can happen:
\[ \begin{align*}
& 20 * (.71)(.71)(.71)(.71)(.29)(.29)(.29) \\
& 20 * (.71)^4(.29)^3 \\
& 20 * .25411681 * .024389 \\
& 20 * 0.00619765487909 \\
& .1239530975818 \end{align*} \]Adding all together we get:
\[ \begin{align*}
&= .25411681 + .2947754996 + .21371223721 + .1239530975818 \\
&= .8865576443918 \end{align*} \]
So assuming Jeremy Lin's probability of making a 3-point shot is 71% and the shots are indepedent, then the probability of him making 4 shots before he misses 4 (up to 3 missed shots) is about 88.66% (assuming I made the right assumptions and did the calculations correctly).

Can we use this pattern to answer the question in our original post?

Question 1: Assuming each shot is independent of the others and his probability of making a shot is 71%, what is the probability that Jeremy Lin beats the ghost (essentially he makes 21 shots before he misses 7)?

I'll put up a simulator in the next post so we can check our answer when we arrive at it.

Jeremy Lin vs The Ghost
Jeremy Lin vs The Ghost (Finding Patterns)
Jeremy Lin vs The Ghost (Simulation)