Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.


1Experiments, Sample Spaces, and Events

Probability theory begins with a simple setup: something happens, and we observe the result.

1.1Set Operations

Events are sets, and we manipulate them using three operations:


2The Axioms of Probability

From these three axioms, we derive every other rule:


3The Sample-Point Method


4Counting Tools: The mn Rule


5Permutations

Why it works: Position 1 has nn choices, position 2 has n1n-1, ..., position rr has nr+1n-r+1. By the mn rule: n(n1)(nr+1)n(n-1)\cdots(n-r+1).

5.1When to Use Permutations vs. Combinations

This is the single most common source of counting errors. Use this checklist:


6Combinations and Partitions

Why it works: nPr_nP_r counts ordered arrangements. Each group of rr objects appears in r!r! different orders. Dividing removes the redundancy: (nr)=nPrr!\binom{n}{r} = \frac{_nP_r}{r!}.


7Putting It All Together: The Birthday Problem

The complement strategy: Computing “at least one match” directly is a nightmare. Instead:

P(at least one match)=1P(all birthdays different)P(\text{at least one match}) = 1 - P(\text{all birthdays different})

Assumptions: 365 days, all equally likely, independence.

Computing P(\text{all n birthdays different}):

Person 1: any day (365/365365/365). Person 2 must avoid Person 1’s birthday: 364/365364/365. Person 3: 363/365363/365. Person kk: (365k+1)/365(365-k+1)/365.

We can multiply these fractions because we assumed birthdays are independent — knowing Person 1’s birthday doesn’t affect the probability of Person 2’s birthday. (This is the mn rule in action: each person’s birthday is a “stage” with outcomes that don’t depend on previous stages.)

P(no match)=365365364365365n+1365=365Pn365nP(\text{no match}) = \frac{365}{365} \cdot \frac{364}{365} \cdots \frac{365-n+1}{365} = \frac{_{365}P_n}{365^n}
P(at least one match among n people)=1365Pn365n\boxed{P(\text{at least one match among } n \text{ people}) = 1 - \frac{_{365}P_n}{365^n}}
nnP(match)P(\text{match})
100.117
230.507
300.706
500.970
570.990
birthday_prob <- function(n) {
  1 - prod((365:(365 - n + 1)) / 365)
}
n_vals <- 1:80
plot(n_vals, sapply(n_vals, birthday_prob), type = "l", lwd = 2,
     col = "steelblue", xlab = "People", ylab = "P(match)",
     main = "The Birthday Problem")
abline(h = 0.5, v = 23, lty = 2, col = "red")

Why so low? With nn people, there are (n2)\binom{n}{2} pairs. At n=23n = 23: (232)=253\binom{23}{2} = 253 pairs — each a potential match. The quadratic growth of pairs compensates for the low probability of any single match.




8Chapter 2 Refresh Homework

These problems integrate material across all sections of Chapter 2.


R2.1. A company selects a team of 3 from 10 engineers, then designates one as leader. (a) How many teams? (b) How many leaders per team? (c) Total (team + leader) outcomes? (d) Verify by computing: pick leader first, then 2 others.

R2.2. An alarm system has 3 sensors, each detecting an intruder (D) 90% of the time or failing (F) 10%. (a) List SS. (b) Are outcomes equally likely? (c) List AA = “at least 2 detect.” (d) Compute P(A)P(A) by assigning probabilities (P(DDF)=0.92×0.1P(DDF) = 0.9^2 \times 0.1). (e) Verify using the complement.

R2.3. A club has 9 seniors and 6 juniors. A committee of 4 is formed at random. Find: (a) total committees, (b) committees with exactly 2 seniors and 2 juniors, (c) P(exactly 2 seniors, 2 juniors)P(\text{exactly 2 seniors, 2 juniors}), (d) P(at least 1 junior)P(\text{at least 1 junior}) using the complement.

R2.4. Passwords are 8 characters (26 lowercase + 26 uppercase + 10 digits). (a) Total passwords? (b) Lowercase-only passwords? (c) P(random password is all lowercase)P(\text{random password is all lowercase})? (d) Why does this matter for security?

R2.5. Use R to compute the exact birthday probability for n=40n = 40, then simulate: generate 40 random birthdays 100,000 times and count matches. Compare.

R2.6. Three events satisfy: P(A)=0.4P(A) = 0.4, P(B)=0.3P(B) = 0.3, P(C)=0.2P(C) = 0.2, P(AB)=0.15P(A \cap B) = 0.15, P(AC)=0.08P(A \cap C) = 0.08, P(BC)=0.06P(B \cap C) = 0.06, P(ABC)=0.02P(A \cap B \cap C) = 0.02. Find P(ABC)P(A \cup B \cup C) using inclusion-exclusion, and P(ABC)P(\overline{A \cup B \cup C}).


9Chapter 2 Quiz

Test your understanding. You need 80% (12/15) to earn the badge.