Binomial variables

coin flip -> P(H) = 0.6; P(T) = 0.4

X = # of heads after 10 flips of my coin

  • made up of independent trails (flip)

  • each trail can be classified either as success or failure

  • fixed # of trails

  • probability of success on each trail is constant

Inference -> The act or process of deriving logical conclusions from premises known or assumed to be true.

Distribution

X = # of heads from flipping a coin 5 times

possible outcomes from 5 flips: 22222=25=322 * 2 * 2 * 2 * 2 = 2^5 = 32

P(X=0)=132=5C0325C0=5!0!(50)!=5!5!=1P(X=0) = \frac{1}{32} =\frac{_5 C_0}{32} \Rightarrow _5 C_0 = \frac{5!}{0! * (5-0)!} = \frac{5!}{5!} = 1

P(X=1)=532=5C1325C1=5!1!(51)!=5!1!=5P(X=1) = \frac{5}{32} = \frac{_5 C_1}{32} \Rightarrow _5C_1 = \frac{5!}{1!*(5-1)!}=\frac{5!}{1!}=5

P(X=2)=1032=5C2325C2=5!2!(52)!=5!2!3!=5432232=10P(X=2) = \frac{10}{32} = \frac{_5 C_2}{32} \Rightarrow _5C_2 = \frac{5!}{2!*(5-2)!}=\frac{5!}{2!*3!}=\frac{5*4*3*2}{2*3*2}=10

P(X=3)=1032=5C3325C3=5!3!(53)!=5!3!2!=10P(X=3) = \frac{10}{32} = \frac{_5 C_3}{32} \Rightarrow _5C_3 = \frac{5!}{3!*(5-3)!}=\frac{5!}{3!*2!}=10

P(X=4)=532=5C4325C4=5!4!(54)!=5!1!=5P(X=4) = \frac{5}{32} = \frac{_5 C_4}{32} \Rightarrow _5C_4 = \frac{5!}{4!*(5-4)!}=\frac{5!}{1!}=5

P(X=5)=132=5C5325C5=5!5!(55)!=5!5!=1P(X=5) = \frac{1}{32} =\frac{_5 C_5}{32} \Rightarrow _5 C_5 = \frac{5!}{5! * (5-5)!} = \frac{5!}{5!} = 1

Example:

prob (score) = 70% or 0.7

prob (miss) = 30% or 0.3

P(Exactly 2 scores in 6 attempts) =

(62)0.720.34=150.490.0081=0.05935\binom {6}{2} * 0.7^2 * 0.3^4 = 15 * 0.49 * 0.0081 = 0.05935

SSMMMM=0.70.70.30.30.30.3=(0.7)2(0.3)4\Longrightarrow \text{SSMMMM} = 0.7 * 0.7 * 0.3 * 0.3 * 0.3 * 0.3 = (0.7)^2 * (0.3)^4

6C2=(62)=6!2!(62)!=654321(21(4321)=15\Longrightarrow _6C_2 = \binom{6}{2}=\frac{6!}{2!*(6-2)!} = \frac{6*5*4*3*2*1}{(2*1(4*3*2*1)}=15

Generalizing k scores in n attempts:

P(Exactly kk scores in nn attempts) = (nk)fk(1f)nk\large\binom{n}{k}* f^k * (1-f)^{n-k}

f = prob of making attempts

A binomial probability problem has these features:

  • a set number of trials (n\blueD{n})

  • each trial can be classified as a "success" or "failure"

  • the probability of success (p\greenD{p}) is the same for each trial

  • results from each trial are independent from each other

Here's a summary of our general strategy for binomial probability:

Using the example from Problem 1:

  • n=3n=3 free-throws

  • each free-throw is a "make" (success) or a "miss" (failure)

  • probability she makes a free-throw is p=0.90\greenD{p}=\greenD{0.90}

  • assume free-throws are independent

\begin{aligned}P(\text{makes 2 of 3 free throws}) &= \, _3\text{C}_2 \cdot(\greenD{0.90})^{2} \cdot (\maroonD{0.10})^1 \\ \\ &=3\cdot0.81\cdot0.10 \\ \\ &=3\cdot0.081 \\ \\ &=0.243\end{aligned}

In general...

P(\text{exactly }k \text{ successes})=\,_n\text{C}_k \cdot p^k \cdot (1-p)^{n-k}

Challenge Problem

Steph promises to buy Luke ice cream if he makes 33 or more of his 44 free-throws.

What is the probability that he makes 33 or more of the 44 free throws?

Luke gets ice cream if he makes 33 or 44 free throws. We can find the probability of each of those outcomes and add the results together.Here's how we can think of this problem:

  • n=4n=4 trials (shots)

  • each shot is either a make or miss

  • probability that he makes a shot is p=0.20p=0.20

  • shots are independent

\begin{aligned}P(\text{makes 3 or more}) &= P(\text{makes 3 free-throws}) + P(\text{makes 4 free-throws}) \\ \\ & =\,_4\text{C}_3 \cdot (0.20)^3 \cdot (0.80)^1+\,_4\text{C}_4 \cdot (0.20)^4 \cdot (0.80)^0 \\ \\ &= \dfrac{4!}{(4-3)! \cdot3!} \cdot0.008 \cdot 0.80+\dfrac{4!}{(4-4)! \cdot4!} \cdot 0.0016 \\ \\ &=\dfrac{4 \cdot 3\cdot 2\cdot 1}{3\cdot 2 \cdot 1}\cdot0.008 \cdot 0.80 +\dfrac{4 \cdot 3\cdot 2\cdot 1}{4 \cdot 3 \cdot 2 \cdot 1} \cdot0.0016 \\ \\ &=4 \cdot0.008 \cdot 0.80+0.0016\\ \\ &=0.0256+0.0016 \\ \\ &=0.0272\end{aligned}

Quiz #1

Layla has a coin that has a 60%60\% chance of showing heads each time it is flipped. She is going to flip the coin 55 times. Let XX represent the number of heads she gets.

What is the probability that she gets more than 33 heads?

Finding P(X=5)P(X=5)

For each flip, we know P(heads)=60%P(\blueD{\text{heads}})=\blueD{60\%}. To find the probability that all 55 flips are heads, we can multiply probabilities since flips are independent:

P(X=5)=(0.60)(0.60)(0.60)(0.60)(0.60)=(0.60)5=0.07776\begin{aligned} P(X=5)&=(\blueD{0.60})(\blueD{0.60})(\blueD{0.60})(\blueD{0.60})(\blueD{0.60}) \\\\ &=(\blueD{0.60})^5 \\\\ &=0.07776 \end{aligned}

We'll come back and use this result later. Next, we need to find P(X=4)P(X=4) (the probability that she gets 44 heads).

Finding P(X=4)P(X=4)

Getting 44 heads in 55 attempts means Layla needs to get 44 heads and 11 tail. For each flip, we know P(heads)=60%P(\blueD{\text{heads}})=\blueD{60\%} and P(tails)=40%P(\maroonD{\text{tails}})=\maroonD{40\%}.

Let's start by finding the probability of getting 44 heads followed by 11 tail:

P(HHHHT)=(0.6)4(0.4)=0.05184P(\blueD{\text{HHHH}}\maroonD{\text{T}})=(\blueD{0.6})^4(\maroonD{0.4})=0.05184

This isn't the entire probability though, because there are other ways to get 44 heads from 55 flips (for example, THHHH). How many different ways are there? We can use the combination formula:

nCk=n!(nk)!k!5C4=5!(54)!4!=54321(1)4321=5\begin{aligned} _n\text{C}_k&=\dfrac{n!}{(n-k)!\cdot k!} \\\\ _5\text{C}_4&=\dfrac{5!}{(5-4)!\cdot4!} \\\\ &=\dfrac{5 \cdot \cancel{4 \cdot 3 \cdot 2 \cdot 1}}{(1) \cdot \cancel{4 \cdot 3 \cdot 2 \cdot 1}} \\\\ &=5 \end{aligned}

Do they all have the same probability?

Each of the 55 ways has the same probability that we already found:

P(HHHHT)=(0.6)4(0.4)=0.05184P(HHHTH)=(0.6)4(0.4)=0.05184P(HHTHH)=(0.6)4(0.4)=0.05184P(HTHHH)=(0.6)4(0.4)=0.05184P(THHHH)=(0.6)4(0.4)=0.05184\begin{aligned} P(\blueD{\text{HHHH}}\maroonD{\text{T}})&=(\blueD{0.6})^4(\maroonD{0.4})=0.05184 \\\\ P(\blueD{\text{HHH}}\maroonD{\text{T}}\blueD{\text{H}})&=(\blueD{0.6})^4(\maroonD{0.4})=0.05184 \\\\ P(\blueD{\text{HH}}\maroonD{\text{T}}\blueD{\text{HH}})&=(\blueD{0.6})^4(\maroonD{0.4})=0.05184 \\\\ P(\blueD{\text{H}}\maroonD{\text{T}}\blueD{\text{HHH}})&=(\blueD{0.6})^4(\maroonD{0.4})=0.05184 \\\\ P(\maroonD{\text{T}}\blueD{\text{HHHH}})&=(\blueD{0.6})^4(\maroonD{0.4})=0.05184 \end{aligned}

So we can multiply this probability by 55 since that is how many ways there are to get 44 heads in 55 flips.

P(X=4)=5(0.6)4(0.4)=5(0.05184)=0.2592\begin{aligned} P(X=4)&=5(0.6)^4(0.4) \\\\ &=5(0.05184) \\\\ &=0.2592 \end{aligned}

Putting it all together

Let's return to our original strategy to answer the question:

P(X>3)=P(4 heads)+P(5 heads)=P(X=4)+P(X=5)=5(0.6)4(0.4)+(0.6)5=0.2592+0.07776=0.336960.34\begin{aligned} P(X>3)&=P(4\text{ heads})+P(5\text{ heads}) \\\\ &=P(X=4)+P(X=5) \\\\ &=5(0.6)^4(0.4)+(0.6)^5 \\\\ &=0.2592+0.07776 \\\\ &=0.33696 \\\\ &\approx0.34 \end{aligned}

Quiz #2

Ira ran out of time while taking a multiple-choice test and plans to guess on the last 66 questions. Each question has 44 possible choices, one of which is correct. Let X=X= the number of answers Ira correctly guesses in the last 66 questions.

What is the probability that he answers fewer than 22 questions correctly in the last 66 questions?

Strategy (without a fancy calculator)

The probability that Ira gets fewer than 22 questions correct in the 66 questions is equivalent to the probability that he gets 00 or 11 question correct. So we can find those probabilities and add them them together to get our answer:

P(X<2)=P(0 correct)+P(1 correct)=P(X=0)+P(X=1)\begin{aligned} P(X<2)&=P(0\text{ correct})+P(1\text{ correct}) \\\\ &=P(X=0)+P(X=1) \end{aligned}

Finding P(X=0)P(X=0)

There are 44 possible choices for each question, so we know P(correct)=25%P(\blueD{\text{correct}})=\blueD{25\%} and P(not)=75%P(\maroonD{\text{not}})=\maroonD{75\%}. Answering 00 questions correctly is equivalent to answering all 66 questions incorrectly. We can multiply probabilities since we are assuming independence:

P(X=0)=(0.75)(0.75)(0.75)(0.75)(0.75)(0.75)=(0.75)60.17798\begin{aligned} P(X=0)&=(\maroonD{0.75})(\maroonD{0.75})(\maroonD{0.75})(\maroonD{0.75})(\maroonD{0.75})(\maroonD{0.75}) \\\\ &=(\maroonD{0.75})^6 \\\\ &\approx0.17798 \end{aligned}

​We'll come back and use this result later. Next, we need to find P(X=1)P(X=1) (the probability that he answers 11 question correctly).

Finding P(X=1)P(X=1)

Answering 11 question correctly in the last 66 questions means Ira needs to get 11 question correct and 55 questions not correct. There are 44 possible choices for each question, so we know P(correct)=25%P(\blueD{\text{correct}})=\blueD{25\%} and P(not)=75%P(\maroonD{\text{not}})=\maroonD{75\%}.

Since we are assuming independence, let's multiply probabilities to find the probability of getting 11 question correct followed by 55 questions not correct:

P(CNNNNN)=(0.25)(0.75)50.05933P(\blueD{\text{C}}\maroonD{\text{NNNNN}})=(\blueD{0.25})(\maroonD{0.75})^5\approx0.05933

This isn't the entire probability though, because there are other ways to get 11 question correct from 66 questions (for example, NNNNNC). How many different ways are there? We can use the combination formula:

nCk=n!(nk)!k!6C1=6!(61)!1!=654321(54321)1=6\begin{aligned} _n\text{C}_k&=\dfrac{n!}{(n-k)!\cdot k!} \\\\ _6\text{C}_1&=\dfrac{6!}{(6-1)!\cdot1!} \\\\ &=\dfrac{6 \cdot \cancel{5 \cdot 4 \cdot 3 \cdot 2 \cdot 1}}{(\cancel{5 \cdot 4 \cdot 3 \cdot 2 \cdot 1}) \cdot 1} \\\\ &=6 \end{aligned}

There are 66 ways to get 11 question correct in 66 questions. Do they all have the same probability?

Each of the 66 ways has the same probability that we already found:

P(CNNNNN)=(0.25)(0.75)50.05933P(NCNNNN)=(0.25)(0.75)50.05933P(NNCNNN)=(0.25)(0.75)50.05933P(NNNCNN)=(0.25)(0.75)50.05933P(NNNNCN)=(0.25)(0.75)50.05933P(NNNNNC)=(0.25)(0.75)50.05933\begin{aligned} P(\blueD{\text{C}}\maroonD{\text{NNNNN}})&=(\blueD{0.25})(\maroonD{0.75})^5\approx0.05933 \\\\ P(\maroonD{\text{N}}\blueD{\text{C}}\maroonD{\text{NNNN}})&=(\blueD{0.25})(\maroonD{0.75})^5\approx0.05933 \\\\ P(\maroonD{\text{NN}}\blueD{\text{C}}\maroonD{\text{NNN}})&=(\blueD{0.25})(\maroonD{0.75})^5\approx0.05933 \\\\ P(\maroonD{\text{NNN}}\blueD{\text{C}}\maroonD{\text{NN}})&=(\blueD{0.25})(\maroonD{0.75})^5\approx0.05933 \\\\ P(\maroonD{\text{NNNN}}\blueD{\text{C}}\maroonD{\text{N}})&=(\blueD{0.25})(\maroonD{0.75})^5\approx0.05933 \\\\ P(\maroonD{\text{NNNNN}}\blueD{\text{C}})&=(\blueD{0.25})(\maroonD{0.75})^5\approx0.05933 \end{aligned}

​So we can multiply this probability by 66 since that is how many ways there are to get 11 question correct in 66 questions:

P(X=1)=6(0.25)(0.75)56(0.05933)0.35596\begin{aligned} P(X=1)&=6(0.25)(0.75)^5 \\\\ &\approx6(0.05933) \\\\ &\approx0.35596 \end{aligned}

Putting it all together

Let's return to our original strategy to answer the question:

P(X<2)=P(0 correct)+P(1 correct)=P(X=0)+P(X=1)=(0.75)6+6(0.25)(0.75)50.17798+0.355960.533940.53\begin{aligned} P(X<2)&=P(0\text{ correct})+P(1\text{ correct}) \\\\ &=P(X=0)+P(X=1) \\\\ &=(0.75)^6+6(0.25)(0.75)^5 \\\\ &\approx0.17798+0.35596 \\\\ &\approx0.53394 \\\\ &\approx0.53 \end{aligned}

Last updated