Lecture 3: Probability
● An event is something that either happens or doesn’t happen, or is true or is not true
○ Can be written as P(A)
● Combining events:
○ P(A and B) is the probability that both events A and B will happen
■ Both happen together / overlap/intersect
■ i.e. P(student and employed) = students who also have jobs
○ (P(A or B) is the probability that either event A or event B will happen (or both)
■ Everything in either category
■ i.e. P(student or employed) = people who are students, employed, or both
● Additive rule: (P(A or B)
○ P(A or B) = P(A) + P(B) - P(A and B)
■ When you add P(A) + P(B), you count the overlap twice, so you remove it
once
■ i.e. P(student) = 0.4, P(employed) = 0.6, P(student and employed) = 0.2
● P(student or employed) = 0.4 + 0.6 - 0.2 = 0.8
● Complement rule: P(not A)
○ Probabilities have to add up to 1 (100%), either something happens or it doesn’t
○ P(not A) = 1 - P(A)
■ i.e. P(not loyal) = 1 - P(loyal)
■ = 1 - 0.136
■ = 0.864
● Conditional probability: P(A if B)
○ P(A if B) = P(A and B) / P(B)
■ Meaning: among cases where B happen, what fraction also have A
■ i.e. P(promoted and high performer) = 0.15, P(high performer) = 0.30
■ P(promoted if high performer) = 0.15 / 0.30 = 0.5
■ Translation: 50% of high performers get promoted
○ Can be rearranged: (P(A and B) = P(A if B)*P(B)
● Disjoint events: P(A and B) = 0
○ Events A and B are disjoint or mutually exclusive if only one of the two events
can happen
○ A and B cannot happen, they’re mutually exclusive
■ i.e. P(heads and tails on same coin flip) = 0
■ You can’t get both on one flip
○ Disjoint events are never independent
● Independence: (P(A if B) = P(A)
○ Knowing B happened doesn’t change the probability of A
■ i.e. P(rain) =0.3, P(rain if Tuesday) = 0.3
■ The day of the week doesn’t affect rain, so they’re independent
○ If A and B are independent: P(A and B): = P(A) * P(B)
● Bayes problem is when you need to “flip” a conditional probability
○ You’re given P(B if A), you want P(A if B)
○ Count actual people
■ Start with 100 people, split by base rate
■ Apply test accuracy to each group
■ Add up who tests positive
■ Calculate fractions that are actually positive