You’ve just been hired by the Zootopia Police Department.
… Not as an officer, but as the City’s Data Analyst.
A stack of paperwork lands on your desk.
“Every year, ZPD puts out a report,” she says. “Hiring numbers, exam scores, patrol stats, you name it. The mayor’s office wants someone independent to check it. That’s you now.”
She taps the folder. “Before you can check anything, though, you need to understand chance. Random noise looks a lot like a pattern if you don’t know what you’re looking at.”
Definition
A random experiment is any process whose outcome can’t be predicted with certainty in advance, but we do know the possible outcomes.
ZPD randomly selects one recruit from this year’s academy class to review.
We do not know who will be selected, but we know the pool of candidates.
An outcome is one specific result of the experiment.
The sample space is the set of all possible outcomes.
An event is any collection of outcomes we care about.
Looking Forward
Probability is just a way of assigning a number to how likely an event is, based on the sample space it came from.
Every probability is between 0 and 1. 0 \le P(A) \le 1 where P(A) = \begin{cases} 0, & \text{A is impossible} \\ 1, & \text{A is guaranteed} \end{cases}
All possible outcomes, added together, equal 1.
The Complement Rule
P(A^c) = 1 - P(A)
The probability an event doesn’t happen is 1 minus the probability it does.
Example
If 72% of recruits work Patrol, what fraction work Desk duty?
P(\text{Desk}) = 1 - P(\text{Patrol}) = 1 - 0.72 = 0.28
28% of recruits work Desk duty.
Example
ZPD’s records show that 15% of academy applicants fail the physical exam. What’s the probability a randomly chosen applicant passes?
P(\text{pass}) = 1 - P(\text{fail}) = 1 - 0.15 = 0.85
We expect that a randomly chosen applicant will pass 85% of the time.
Conditional probability
P(A \mid B)
The probability of A, given that B has already happened. New information (B) changes what we believe is likely.
Example
Suppose ZPD’s weather log shows it rains fairly often in Rainforest District, but almost never in Sahara Square. You are asked to find P(\text{rain} \mid \text{Rainforest District}). How is this different from P(\text{rain})?
P(\text{rain}) is for all of Zootropolis.
P(\text{rain} \mid \text{Rainforest District}) is for only the Rainforest District.
Example
Among all ZPD recruits, 60% work in Tundratown. Among Tundratown recruits specifically, 10% passed the academy exam on their first attempt.
What does P(\text{pass} \mid \text{Tundratown}) = 0.10 actually tell you?
If you already know a recruit is stationed in Tundratown, there’s a 10% chance they passed the exam the first time they took it.
This is a more specific number than the first-time pass rate for ZPD as a whole.
Independent Events
Two events are independent when knowing one tells you nothing about the other: P(A \mid B) = P(A)
Example
Suppose P(\text{pass exam}) = 0.85 overall, and P(\text{pass exam} \mid \text{Tundratown}) = 0.10. Are “passing the exam” and “being assigned to Tundratown” independent?
No. If they were independent, both numbers would be equal.
Because they are not, this implies that, knowing someone’s district does change what we’d expect about their exam outcome.
Example
Suppose P(\text{pass exam}) = 0.85 overall, and among recruits whose last name starts with a vowel, P(\text{pass exam} \mid \text{vowel last name}) = 0.85 as well. Are “passing the exam” and “having a last name that starts with a vowel” independent?
Both numbers are equal. Knowing a recruit’s last name starts with a vowel doesn’t change the probability they passed the exam.
P(A \mid B) = P(A), therefore, A is independent of B.
Union: A \cup B
Everything in A, B, or both.
Intersection: A \cap B
What’s in both A and B together.
Mutually exclusive events are events that can never happen together.
P(A \cap B) = 0
Addition Rule
If we have two events, A and B, the probability of A \text{ or } B is given by:
P(A \cup B) = P(A) + P(B) - P(A \cap B)
If A and B are mutually exclusive, this simplifies to: P(A \cup B) = P(A) + P(B)
Example
A recruit is randomly selected. ZPD wants to know the probability this recruit works in either Sahara Square (20%) or Tundratown (60%). Which approach is appropriate?
\begin{align*} P(\text{Sahara $\cup$ Tundra}) &= P(\text{Sahara}) + P(\text{Tundra}) - P(\text{Sahara $\cap$ Tundra}) \\ &= P(\text{Sahara}) + P(\text{Tundra}) \\ &= 0.20 + 0.60 \\ &= 0.80 \end{align*}
Example
A recruit is randomly selected. 30% of recruits work Patrol, and 45% report getting 8+ hours of sleep. 15% of recruits both work Patrol and get 8+ hours of sleep. What’s the probability a recruit works Patrol or gets 8+ hours of sleep?
\begin{align*} P(\text{Patrol $\cup$ 8+ hrs}) &= P(\text{Patrol}) + P(\text{8+ hrs}) - P(\text{Patrol $\cap$ 8+ hrs}) \\ &= 0.30 + 0.45 - 0.15 \\ &= 0.60 \end{align*}
Multiplication Rule
For independent events: P(A \cap B) = P(A) \times P(B)
Multiplication Rule
For dependent events: P(A \cap B) = P(A) \times P(B \mid A)
Example
Suppose P(\text{passes exam}) = 0.85 and P(\text{reports 8+ hrs sleep}) = 0.40. Further, we know that P(\text{reports 8+ hrs sleep} \mid \text{passes exam}) = 0.40. What’s the probability a randomly chosen recruit passes the exam and reports 8+ hours of sleep?
\begin{align*} P(\text{passes exam $\cap$ 8+ hrs}) &= P(\text{passes exam}) \times P(\text{8+ hrs} \mid \text{passes exam}) \\ &= P(\text{passes exam}) \times P(\text{8+ hrs}) \\ &= 0.85 \times 0.40 \\ &= 0.34 \end{align*}
Example
Suppose P(\text{Tundratown}) = 0.60, and among Tundratown recruits specifically, P(\text{passes exam} \mid \text{Tundratown}) = 0.10. What’s the probability a randomly chosen recruit is assigned to Tundratown and passes the exam on their first attempt?
\begin{align*} P(\text{Tundra} \cap \text{pass exam}) &= P(\text{Tundra}) \times P(\text{pass exam} \mid \text{Tundra}) \\ &= 0.60 \times 0.10 \\ &= 0.06 \end{align*}
This lecture gave an overview of probability basics.
Complement: P(A^c) = 1 - P(A)
Conditional: P(A \mid B)
Independence: P(A \mid B) = P(A)
Addition: P(A \cup B) = P(A) + P(B) - P(A \cap B)
Multiplication: P(A \text{ and } B) = P(A) \times P(B \mid A)
The next lecture covers probability distribution basics.