Probability & Statistics

Study Sheet

Probability & Statistics

Counting, probability, and the shape of data — one desk reference

The Fundamental Counting Principle

Concept
Multiply the Choices

If a task is made of several independent stages, and stage 11 can happen in mm ways, stage 22 in nn ways, and so on, then the whole task can happen in

m×n×⋯ ways.m \times n \times \cdots \ \text{ways.}

This is the engine behind every counting formula in this topic: whenever choices are made in sequence, you multiply.

Permutations count ordered arrangements; combinations count unordered selections. Probability of independent events multiplies, of mutually exclusive events adds, and conditional probability rescales to the event that already happened. The normal distribution describes many measurements, and z-scores measure how unusual a value is.

Multiplication counts the branches of a tree: each of the 44 shirts starts its own set of 33 pants branches, so there are 4+4+4=4×3=124 + 4 + 4 = 4 \times 3 = 12 shirt-and-pants pairs, and each of those splits again into 22 shoe choices. Every complete path through the tree is exactly one outfit, and no outfit is counted twice.

Example
Worked Example: Building an Outfit
S1P1P2P3S2P1P2P3S3P1P2P3S4P1P2P3
44 shirts, each with 33 pants: 1212 branches. The 22 shoes double that to 2424.

A wardrobe has 44 shirts, 33 pairs of pants, and 22 pairs of shoes. How many outfits (one of each) are possible?

4×3×2=24 outfits.4 \times 3 \times 2 = 24 \ \text{outfits.}

If a password uses 33 digits and repeats are allowed, there are 10×10×10=100010 \times 10 \times 10 = 1000 passwords.

Side note
Where it goes wrong

Adding the choices: 4+3+2=94 + 3 + 2 = 9 outfits. That counts single items, not combinations; every shirt can go with every pair of pants, so the choices multiply.

Tip

Repeats allowed or not? If items can repeat, each stage keeps the full count (10×10×1010 \times 10 \times 10). If they cannot repeat, the pool shrinks by one each time (10×9×810 \times 9 \times 8).

Try it
Try it: license plates

A plate has 33 letters followed by 33 digits. How many plates are possible? How many if no letter or digit may repeat?

Show the answer

Repeats allowed: 263×103=17,576×1000=17,576,00026^3 \times 10^3 = 17{,}576 \times 1000 = 17{,}576{,}000. No repeats: 26×25×24×10×9×8=15,600×720=11,232,00026 \times 25 \times 24 \times 10 \times 9 \times 8 = 15{,}600 \times 720 = 11{,}232{,}000.

Permutations and Combinations

Concept
Order Matters vs. Order Doesn't

Both count ways to choose rr items from nn distinct items.

  • Permutation — order matters (arrangements, rankings, seating): @@BLOCK0@@
  • Combination — order does not matter (committees, teams, hands): @@BLOCK1@@

Because a combination ignores the r!r! orderings of each group, (nr)=P(n,r)r!\binom{n}{r} = \dfrac{P(n,r)}{r!}.

Every team of 33 can be lined up in 3!=63! = 6 orders, so listing lines counts each team 66 times. That is the whole relationship: P(5,3)=C(5,3)×3!P(5, 3) = C(5, 3) \times 3!, so C(5,3)=606=10C(5, 3) = \tfrac{60}{6} = 10. The formula (nr)=n!r!(n−r)!\binom nr = \tfrac{n!}{r!(n - r)!} is the permutation count divided by the orderings of each group.

Example
Worked Example: Same Numbers, Different Question
{A, B, C}1 teamABCACBBACBCACABCBA3! = 6 lines
One team of three produces six different lines.

From 55 students, form a line of 33 (permutation) versus a team of 33 (combination).

P(5,3)=5!2!=5×4×3=60(order matters)C(5,3)=(53)=5×4×33!=606=10(order doesn’t)\begin{aligned} P(5,3) &= \frac{5!}{2!} = 5 \times 4 \times 3 = 60 \quad\text{(order matters)}\\[2pt] C(5,3) &= \binom{5}{3} = \frac{5 \times 4 \times 3}{3!} = \frac{60}{6} = 10 \quad\text{(order doesn't)} \end{aligned}

There are exactly 3!=63! = 6 times as many lines as teams, because each team of 33 can be lined up in 66 ways.

Side note
Where it goes wrong

Using a permutation for a committee: "choose 33 of 55 for a committee: 5×4×3=605 \times 4 \times 3 = 60." Swapping two members does not change a committee, so each group of 33 was counted 3!=63! = 6 times; the answer is 1010.

Tip

Decision test: Ask “If I swap two chosen items, is it a different outcome?” Yes ⇒\Rightarrow permutation (order matters). No ⇒\Rightarrow combination.

Try it
Try it: which one?

(a) How many ways can 88 runners finish first, second and third? (b) How many 44-person committees can be chosen from 1010 people?

Show the answer

(a) Order matters: P(8,3)=8×7×6=336P(8, 3) = 8 \times 7 \times 6 = 336. (b) Order does not: (104)=10×9×8×74!=504024=210\binom{10}{4} = \tfrac{10 \times 9 \times 8 \times 7}{4!} = \tfrac{5040}{24} = 210.

Basic Probability

Concept
Theoretical, Experimental, Complement

For equally likely outcomes,

P(event)=number of favorable outcomestotal number of outcomes,0≤P≤1.P(\text{event}) = \frac{\text{number of favorable outcomes}}{\text{total number of outcomes}}, \qquad 0 \le P \le 1.

Theoretical probability comes from the model (a fair die gives 16\tfrac16). Experimental probability comes from data: times it happenedtrials\dfrac{\text{times it happened}}{\text{trials}}. The complement rule saves work:

P(not A)=1−P(A).P(\text{not } A) = 1 - P(A).

The complement rule holds because an event and its complement split the outcomes with nothing left over and nothing shared: every draw is red or not red. Their probabilities therefore add to 11. It is the right tool whenever the event itself is complicated but its opposite is simple, like "at least one."

Example
Worked Example: Marbles and a Complement
3 red (filled) and 5 blue: P(red) = 3/8
Eight equally likely marbles, three of them red.

A bag holds 33 red and 55 blue marbles (88 total).

P(red)=38,P(not red)=1−38=58.P(\text{red}) = \frac{3}{8}, \qquad P(\text{not red}) = 1 - \frac{3}{8} = \frac{5}{8}.

Over many draws, the experimental fraction of reds should hover near 38=0.375\tfrac38 = 0.375 (the Law of Large Numbers).

Side note
Where it goes wrong

Expecting experimental results to match exactly in the short run: after 88 draws with replacement, getting 55 reds does not mean the bag changed. The Law of Large Numbers is about long runs; the fraction settles near 0.3750.375 only over many draws.

Tip

“At least one” trick: It is almost always easier to compute 1−P(none)1 - P(\text{none}) than to add up every “one or more” case.

Try it
Try it: at least one

Roll a fair die 33 times. What is the probability of at least one 66?

Show the answer

Complement: no 66 in three rolls has probability (56)3=125216\left(\tfrac56\right)^3 = \tfrac{125}{216}. So P(at least one 6)=1−125216=91216≈0.421P(\text{at least one } 6) = 1 - \tfrac{125}{216} = \tfrac{91}{216} \approx 0.421.

Independent & Dependent Events; Conditional Probability

Concept
The Multiplication Rule

For the probability that both AA and BB happen:

P(A and B)=P(A)⋅P(B∣A).P(A \text{ and } B) = P(A)\cdot P(B \mid A).
  • Independent — one outcome doesn't affect the other, so P(B∣A)=P(B)P(B \mid A) = P(B) and the rule becomes P(A)⋅P(B)P(A)\cdot P(B). (Coin flips, drawing with replacement.)
  • Dependent — the first outcome changes the second (drawing without replacement).

Conditional probability isolates P(B∣A)=P(A and B)P(A)P(B \mid A) = \dfrac{P(A \text{ and } B)}{P(A)}.

Conditioning shrinks the world. Given that a student plays a sport, only the 60%60\% who do are still in play, and of them the ones who also play an instrument are the 25%25\% overlap; so the conditional probability is 2560\tfrac{25}{60}. The multiplication rule is the same sentence rearranged: P(both)=P(sport)⋅P(instrument∣sport)P(\text{both}) = P(\text{sport}) \cdot P(\text{instrument} \mid \text{sport}).

Example
Worked Example: Dependent Draw (No Replacement)

A deck of 5252 cards: draw two, without replacement. Find P(both hearts)P(\text{both hearts}). There are 1313 hearts.

P(both hearts)=1352⋅1251=14⋅1251=12204=117≈0.059.P(\text{both hearts}) = \frac{13}{52}\cdot\frac{12}{51} = \frac14 \cdot \frac{12}{51} = \frac{12}{204} = \frac{1}{17} \approx 0.059.

The second fraction uses 1212 and 5151 because one heart is already gone.

Side note
Where it goes wrong

Confusing P(A∣B)P(A \mid B) with P(B∣A)P(B \mid A). "P(sport∣instrument)P(\text{sport} \mid \text{instrument})" divides the overlap by the instrument total, which is not given here; it is not 512\tfrac{5}{12} in general.

Example
Worked Example: Conditional Probability
sportinstrument35%25%?
Given a sport, only the sport circle counts: 2560=512\tfrac{25}{60} = \tfrac{5}{12}.

In a class, 60%60\% play a sport and 25%25\% play a sport and an instrument. Given a student plays a sport, the chance they also play an instrument is

P(instrument∣sport)=P(both)P(sport)=0.250.60=512≈0.417.P(\text{instrument}\mid\text{sport}) = \frac{P(\text{both})}{P(\text{sport})} = \frac{0.25}{0.60} = \frac{5}{12} \approx 0.417.
Tip

With vs. without replacement. “With replacement” ⇒\Rightarrow independent (denominators stay the same). “Without replacement” ⇒\Rightarrow dependent (denominator drops by 11 each draw).

Try it
Try it: without replacement

A box has 44 good and 22 faulty batteries. Two are taken without replacement. Find P(both good)P(\text{both good}) and P(second faulty∣first good)P(\text{second faulty} \mid \text{first good}).

Show the answer

P(both good)=46⋅35=1230=25P(\text{both good}) = \tfrac46 \cdot \tfrac35 = \tfrac{12}{30} = \tfrac25. After a good one is removed, 55 remain with 22 faulty: P(second faulty∣first good)=25P(\text{second faulty} \mid \text{first good}) = \tfrac25.

Mutually Exclusive & Overlapping Events (Addition Rule)

Concept
The Addition Rule

For the probability that AA or BB happens:

P(A or B)=P(A)+P(B)−P(A and B).P(A \text{ or } B) = P(A) + P(B) - P(A \text{ and } B).
  • Mutually exclusive (disjoint) — can't both happen, so P(A and B)=0P(A \text{ and } B) = 0 and the rule is just P(A)+P(B)P(A)+P(B).
  • Overlapping — can happen together, so subtract the overlap once (it was counted twice).

Adding P(A)+P(B)P(A) + P(B) counts every outcome in the overlap twice, once as an AA and once as a BB. Subtracting P(A and B)P(A \text{ and } B) once corrects the double count. When the events cannot overlap, that correction is 00, and the simple sum is right.

Example
Worked Example: Overlap in a Deck
kingshearts311252 cards
3+1+12=163 + 1 + 12 = 16 cards are a king or a heart.

Draw one card. Find P(king or heart)P(\text{king or heart}). There are 44 kings, 1313 hearts, and the king of hearts is in both.

P(king or heart)=452+1352−152=1652=413.P(\text{king or heart}) = \frac{4}{52} + \frac{13}{52} - \frac{1}{52} = \frac{16}{52} = \frac{4}{13}.

If we had added without subtracting, the king of hearts would be double-counted.

Side note
Where it goes wrong

Adding overlapping probabilities: P(king or heart)=452+1352=1752P(\text{king or heart}) = \tfrac{4}{52} + \tfrac{13}{52} = \tfrac{17}{52}. The king of hearts was counted in both; the answer is 1652=413\tfrac{16}{52} = \tfrac{4}{13}.

Tip

Spot the overlap. If two categories can describe the same outcome, they overlap — always subtract P(A and B)P(A \text{ and } B). If they never coincide, the overlap is 00.

Try it
Try it: addition rule

In a class of 3030, 1818 take Spanish, 1212 take art and 55 take both. A student is chosen at random. Find P(Spanish or art)P(\text{Spanish or art}) and P(neither)P(\text{neither}).

Show the answer

P(S or A)=18+12−530=2530=56P(S \text{ or } A) = \tfrac{18 + 12 - 5}{30} = \tfrac{25}{30} = \tfrac56. P(neither)=1−56=16P(\text{neither}) = 1 - \tfrac56 = \tfrac16 (that is 55 students).

Binomial Probability (Introduction)

Concept
Counting Successes in Repeated Trials

A binomial experiment has: (1) a fixed number of trials nn, (2) two outcomes per trial — success or failure, (3) a constant success probability pp, and (4) independent trials. The probability of exactly kk successes is

P(k)=(nk) pk (1−p) n−k.P(k) = \binom{n}{k}\, p^{k}\,(1-p)^{\,n-k}.

Here (nk)\binom{n}{k} counts which trials succeed, pkp^k is their successes, and (1−p)n−k(1-p)^{n-k} the remaining failures.

Any one specific sequence with 33 heads and 22 tails, like HHTHT, has probability (12)3(12)2\left(\tfrac12\right)^3\left(\tfrac12\right)^2 because the flips are independent. The binomial coefficient counts how many such sequences there are, (53)=10\binom53 = 10 (choose which 33 of the 55 flips are heads), and the sequences cannot happen together, so their probabilities add.

Example
Worked Example: Exactly 3 Heads in 5 Flips
1/3205/32110/32210/3235/3241/325
All six outcomes for 55 flips; 33 heads (shaded) has probability 1032\tfrac{10}{32}.

A fair coin, so p=12p = \tfrac12, n=5n = 5, k=3k = 3:

P(3)=(53)(12)3(12)2=10⋅132=1032=516=0.3125.P(3) = \binom{5}{3}\left(\tfrac12\right)^{3}\left(\tfrac12\right)^{2} = 10 \cdot \frac{1}{32} = \frac{10}{32} = \frac{5}{16} = 0.3125.
Side note
Where it goes wrong

Forgetting the coefficient: P(3 heads)=(12)5=132P(3 \text{ heads}) = \left(\tfrac12\right)^5 = \tfrac{1}{32}. That is the chance of one particular order, like HHHTT; there are 1010 orders, so the answer is 1032\tfrac{10}{32}.

Tip

“At least” means add up cases: P(k≥1)=1−P(0)P(k \ge 1) = 1 - P(0) is usually the fastest route, using the complement again.

Try it
Try it: free throws

A player makes 70%70\% of free throws. In 44 shots, find P(exactly 3)P(\text{exactly } 3) and P(at least 1)P(\text{at least } 1).

Show the answer

P(3)=(43)(0.7)3(0.3)=4⋅0.343⋅0.3=0.4116P(3) = \binom43 (0.7)^3(0.3) = 4 \cdot 0.343 \cdot 0.3 = 0.4116. P(at least 1)=1−(0.3)4=1−0.0081=0.9919P(\text{at least } 1) = 1 - (0.3)^4 = 1 - 0.0081 = 0.9919.

Measures of Center and Spread

Concept
Center, Then Spread

Center: the mean xˉ=∑xn\bar{x} = \dfrac{\sum x}{n}, the median (middle value when ordered), and the mode (most frequent). Spread: the variance σ2\sigma^2 is the average squared distance from the mean, and the standard deviation σ\sigma is its square root:

σ2=∑(x−xˉ)2n,σ=σ2.\sigma^2 = \frac{\sum (x - \bar{x})^2}{n}, \qquad \sigma = \sqrt{\sigma^2}.

Standard deviation is in the same units as the data, so it measures “typical distance from the mean.”

Deviations from the mean always add to zero (that is what makes the mean the balance point), so their plain average is useless as a measure of spread. Squaring makes every deviation positive, and the square root at the end returns to the original units. The standard deviation is therefore a typical distance from the mean, with large deviations weighted more heavily.

Example
Worked Example: Standard Deviation Step by Step
12345678910mean 5mean ± σ: 3 to 7
Mean 55, standard deviation 22: six of the eight values lie within 22 of the mean.

Data: 2, 4, 4, 4, 5, 5, 7, 92,\ 4,\ 4,\ 4,\ 5,\ 5,\ 7,\ 9 (n=8n = 8).

xˉ=2+4+4+4+5+5+7+98=408=5∑(x−xˉ)2=(−3)2+(−1)2+(−1)2+(−1)2+02+02+22+42=9+1+1+1+0+0+4+16=32σ2=328=4,σ=4=2.\begin{aligned} \bar{x} &= \frac{2+4+4+4+5+5+7+9}{8} = \frac{40}{8} = 5\\[2pt] \sum (x-\bar{x})^2 &= (-3)^2 + (-1)^2 + (-1)^2 + (-1)^2 + 0^2 + 0^2 + 2^2 + 4^2\\ &= 9+1+1+1+0+0+4+16 = 32\\[2pt] \sigma^2 &= \frac{32}{8} = 4, \qquad \sigma = \sqrt{4} = 2. \end{aligned}

So a typical value sits about 22 units from the mean of 55.

Side note
Where it goes wrong

Averaging the deviations without squaring: −3−1−1−1+0+0+2+48=0\tfrac{-3 - 1 - 1 - 1 + 0 + 0 + 2 + 4}{8} = 0, "so there is no spread." Deviations from the mean always cancel; that is why they are squared first.

Tip

Population vs. sample. Dividing by nn gives the population standard deviation (used here). Dividing by n−1n-1 gives the sample standard deviation, used when the data is a sample of a larger group.

Try it
Try it: standard deviation

Find the mean and population standard deviation of 10,12,14,16,1810, 12, 14, 16, 18.

Show the answer

Mean 705=14\tfrac{70}{5} = 14. Deviations −4,−2,0,2,4-4, -2, 0, 2, 4; squares 16,4,0,4,1616, 4, 0, 4, 16, sum 4040. Variance 405=8\tfrac{40}{5} = 8, so σ=8=22≈2.83\sigma = \sqrt8 = 2\sqrt2 \approx 2.83.

The Normal Distribution, the Empirical Rule & z-Scores

Concept
The Bell Curve

Many natural measurements (heights, test scores, errors) follow a normal distribution: a symmetric, bell-shaped curve centered at the mean μ\mu, with spread set by σ\sigma. For any normal distribution, the Empirical Rule (68–95–99.7) says:

  • about 68%68\% of data lies within 1σ1\sigma of the mean,
  • about 95%95\% within 2σ2\sigma,
  • about 99.7%99.7\% within 3σ3\sigma.

A z-score converts any normal distribution to one standard scale, because every normal curve has the same shape once distances are measured in standard deviations. That is why one rule, 6868–9595–99.799.7, works for IQ, heights and test scores alike, and why values from different tests can be compared by their zz-scores.

Concept
z-Scores: How Many Standard Deviations Out

A z-score rewrites any value xx as its distance from the mean, measured in standard deviations:

z=x−μσ.z = \frac{x - \mu}{\sigma}.

A positive zz is above the mean, negative is below, and z=0z = 0 is exactly average. z-scores let you compare values from different distributions on one common scale.

Example
Worked Example: Empirical Rule & a z-Score
x55708510011513014568%2.5% above 130
IQ with μ=100\mu = 100, σ=15\sigma = 15: 68%68\% between 8585 and 115115; 2.5%2.5\% above 130130.

IQ scores are normal with μ=100\mu = 100, σ=15\sigma = 15.

  • Between 8585 and 115115 (that is μ±1σ\mu \pm 1\sigma): about 68%68\% of people.
  • An IQ of 130130 has z=130−10015=2z = \dfrac{130-100}{15} = 2, so it sits at μ+2σ\mu + 2\sigma. Only about 2.5%2.5\% of people score higher.
Side note
Where it goes wrong

Using the 95%95\% figure for a one-sided question: "95%95\% of scores are below 130130." 95%95\% lie between 7070 and 130130; the 5%5\% outside splits evenly, so 97.5%97.5\% are below 130130.

Tip

Symmetry shortcut. Because the curve is symmetric, 50%50\% lies below the mean and 50%50\% above. To find a one-sided tail, take half of what's left: above 2σ2\sigma is 100%−95%2=2.5%\tfrac{100\% - 95\%}{2} = 2.5\%.

Try it
Try it: compare with z

Ana scored 8282 on a test with μ=70\mu = 70, σ=8\sigma = 8. Ben scored 8888 on a test with μ=80\mu = 80, σ=4\sigma = 4. Who did better relative to their class?

Show the answer

Ana: z=82−708=1.5z = \tfrac{82 - 70}{8} = 1.5. Ben: z=88−804=2z = \tfrac{88 - 80}{4} = 2. Ben is 22 standard deviations above his mean, Ana 1.51.5, so Ben did better relative to his class.

Going Deeper: Advanced Probability & Statistics

Concept
Counting with Restrictions: Circular & Identical Items

Not every arrangement is a plain permutation — watch for two twists.

  • Circular arrangements. Seating nn people around a round table has no “first” seat, so every arrangement can be rotated nn ways to look the same. Divide the overcount away: @@BLOCK0@@
  • Identical (repeated) items. Arranging nn objects where one kind repeats n1n_1 times, another n2n_2 times, and so on: @@BLOCK1@@ We divide by each ni!n_i! because swapping identical items produces no new word.
Example
Worked Example: Arranging the Letters of MISSISSIPPI

The word MISSISSIPPI has 1111 letters: M (11), I (44), S (44), P (22). Distinct arrangements:

11!1! 4! 4! 2!=399168001×24×24×2=399168001152=34650.\frac{11!}{1!\,4!\,4!\,2!} = \frac{39916800}{1 \times 24 \times 24 \times 2} = \frac{39916800}{1152} = 34650.

Without dividing out the repeats we would count 11!=39,916,80011! = 39{,}916{,}800 — overcounting every rearrangement of identical letters.

Tip

Overcounting checklist. Whenever a symmetry makes different-looking arrangements “the same” (rotations of a circle, swaps of identical items, or reflections of a bracelet), divide the raw count by the number of ways that symmetry acts.

Concept
Complementary Counting and “At Least One”

When a direct count splits into many cases, count the opposite and subtract from the total. For probabilities this is the complement rule; for raw counts it is the same idea:

(ways with at least one A)=(total ways)−(ways with no A).(\text{ways with at least one } A) = (\text{total ways}) - (\text{ways with no } A).

The phrase “at least one” is the signal: the negation “none” is almost always a single, clean computation.

Example
Worked Example: At Least One Six in Four Rolls

Roll a fair die four times. Find P(at least one 6)P(\text{at least one } 6). The complement “no sixes” means each roll lands on one of five faces:

P(no 6)=(56)4=6251296,P(at least one 6)=1−6251296=6711296≈0.518.P(\text{no } 6) = \left(\frac{5}{6}\right)^{4} = \frac{625}{1296}, \qquad P(\text{at least one } 6) = 1 - \frac{625}{1296} = \frac{671}{1296} \approx 0.518.

Adding the “exactly one, exactly two, three, four” cases separately would take four binomial terms; the complement needs just one.

Concept
Bayes' Theorem: Reversing the Condition

Conditional probabilities are not symmetric: P(A∣B)≠P(B∣A)P(A \mid B) \ne P(B \mid A) in general. Bayes' theorem flips a known conditional into the one you want:

P(A∣B)=P(B∣A) P(A)P(B),P(B)=P(B∣A) P(A)+P(B∣Ac) P(Ac).P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}, \qquad P(B) = P(B \mid A)\,P(A) + P(B \mid A^c)\,P(A^c).

The denominator is the law of total probability: it rebuilds P(B)P(B) by splitting across AA and its complement AcA^c.

Example
Worked Example: A Medical Test (Base Rates Matter)

A disease affects 1%1\% of people. A test is 99%99\% accurate both ways: P(+∣sick)=0.99P(+\mid\text{sick}) = 0.99 and P(−∣healthy)=0.99P(-\mid\text{healthy}) = 0.99 (so P(+∣healthy)=0.01P(+\mid\text{healthy}) = 0.01). A patient tests positive — what is P(sick∣+)P(\text{sick}\mid +)?

P(+)=P(+∣sick)P(sick)+P(+∣healthy)P(healthy)=(0.99)(0.01)+(0.01)(0.99)=0.0099+0.0099=0.0198P(sick∣+)=(0.99)(0.01)0.0198=0.00990.0198=12=50%.\begin{aligned} P(+) &= P(+\mid\text{sick})P(\text{sick}) + P(+\mid\text{healthy})P(\text{healthy})\\ &= (0.99)(0.01) + (0.01)(0.99) = 0.0099 + 0.0099 = 0.0198\\[2pt] P(\text{sick}\mid +) &= \frac{(0.99)(0.01)}{0.0198} = \frac{0.0099}{0.0198} = \frac{1}{2} = 50\%. \end{aligned}

Despite a “99%99\% accurate” test, a positive result is only a coin flip — because the disease is rare, false positives from the huge healthy group roughly equal the true positives.

Tip

Don't ignore the base rate. A test's accuracy is P(+∣sick)P(+\mid\text{sick}), but a patient cares about P(sick∣+)P(\text{sick}\mid +). When the condition is rare, that reversal can be dramatically smaller. Always run it through Bayes.

Concept
Expected Value: The Long-Run Average

The expected value of a numerical outcome XX weights each value by its probability:

E(X)=∑xi P(xi).E(X) = \sum x_i\, P(x_i).

It is the average you would approach over many repetitions — not necessarily a possible single outcome. A game is fair when E(net gain)=0E(\text{net gain}) = 0.

Example
Worked Example: Is the Lottery Ticket Worth It?

A $22 ticket pays $100100 with probability 1200\tfrac{1}{200} and nothing otherwise. Find the expected net gain.

E(net)=(100−2)⋅1200⏟win+(−2)⋅199200⏟lose=98200−398200=−300200=−$1.50.E(\text{net}) = \underbrace{(100 - 2)\cdot\frac{1}{200}}_{\text{win}} + \underbrace{(-2)\cdot\frac{199}{200}}_{\text{lose}} = \frac{98}{200} - \frac{398}{200} = -\frac{300}{200} = -\$1.50.

On average you lose $1.501.50 per ticket, so the game is not fair (it favors the seller).

Concept
Binomial Threshold Probabilities (“At Least kk”)

For a binomial with nn trials and success probability pp, a threshold question sums several exact-kk terms:

P(X≥k)=∑j=kn(nj)pj(1−p)n−j.P(X \ge k) = \sum_{j=k}^{n} \binom{n}{j} p^{j}(1-p)^{n-j}.

When kk is small, the complement is faster: P(X≥1)=1−P(X=0)P(X \ge 1) = 1 - P(X = 0), and P(X≥2)=1−P(X=0)−P(X=1)P(X \ge 2) = 1 - P(X=0) - P(X=1).

Example
Worked Example: At Least 2 Defects in 6 Parts

Each part is defective with probability p=0.1p = 0.1, independently, n=6n = 6. Find P(X≥2)P(X \ge 2) using the complement:

P(X=0)=(60)(0.1)0(0.9)6=(0.9)6≈0.5314P(X=1)=(61)(0.1)1(0.9)5=6(0.1)(0.9)5≈0.3543P(X≥2)=1−0.5314−0.3543≈0.1143.\begin{aligned} P(X = 0) &= \binom{6}{0}(0.1)^0(0.9)^6 = (0.9)^6 \approx 0.5314\\[2pt] P(X = 1) &= \binom{6}{1}(0.1)^1(0.9)^5 = 6(0.1)(0.9)^5 \approx 0.3543\\[2pt] P(X \ge 2) &= 1 - 0.5314 - 0.3543 \approx 0.1143. \end{aligned}

So there is about an 11%11\% chance of two or more defects — found with two terms instead of five.

Concept
Linear Transformations of Data: y=ax+by = ax + b

Shifting and scaling every data value changes center and spread in predictable ways. If y=ax+by = ax + b:

  • Mean shifts and scales: yˉ=axˉ+b\bar{y} = a\bar{x} + b.
  • Standard deviation scales but does not shift: σy=∣a∣ σx\sigma_y = |a|\,\sigma_x.
  • Variance scales by the square: σy2=a2 σx2\sigma_y^2 = a^2\,\sigma_x^2.

Adding a constant bb slides all data together, so spread is unchanged; multiplying by aa stretches the gaps by ∣a∣|a|.

Example
Worked Example: Converting Celsius to Fahrenheit

A week of temperatures in Celsius has mean xˉ=20∘\bar{x} = 20^\circ and standard deviation σx=3∘\sigma_x = 3^\circ. Convert with F=1.8 C+32F = 1.8\,C + 32 (a=1.8a = 1.8, b=32b = 32):

Fˉ=1.8(20)+32=68∘σF=∣1.8∣⋅3=5.4∘(the +32 has no effect on spread).\begin{aligned} \bar{F} &= 1.8(20) + 32 = 68^\circ\\ \sigma_F &= |1.8|\cdot 3 = 5.4^\circ \quad(\text{the } +32 \text{ has no effect on spread}). \end{aligned}

Standardizing to a z-score is the special case z=x−μσz = \dfrac{x-\mu}{\sigma}, i.e. a=1σa = \tfrac{1}{\sigma}, b=−μσb = -\tfrac{\mu}{\sigma}, which forces mean 00 and standard deviation 11.

Tip

Add vs. multiply. Adding a constant moves the center but leaves the spread alone. Multiplying rescales both. This is why σ\sigma never changes when you merely shift data.

Concept
Combining Two Groups' Means and Variances

To pool two groups of sizes n1,n2n_1, n_2, the combined mean is the weighted average — never the plain average of the two means unless the groups are the same size:

xˉcombined=n1xˉ1+n2xˉ2n1+n2.\bar{x}_{\text{combined}} = \frac{n_1\bar{x}_1 + n_2\bar{x}_2}{n_1 + n_2}.

Variance must be pooled about the combined mean. Using each group's sum of squared deviations Si=niσi2S_i = n_i \sigma_i^2 and combined mean xˉc\bar{x}_c:

σcombined2=n1(σ12+(xˉ1−xˉc)2)+n2(σ22+(xˉ2−xˉc)2)n1+n2.\sigma_{\text{combined}}^2 = \frac{n_1(\sigma_1^2 + (\bar{x}_1 - \bar{x}_c)^2) + n_2(\sigma_2^2 + (\bar{x}_2 - \bar{x}_c)^2)}{n_1 + n_2}.

The extra (xˉi−xˉc)2(\bar{x}_i - \bar{x}_c)^2 terms account for how far each group's center sits from the shared center.

Example
Worked Example: Pooling Two Classes

Class A: n1=20n_1 = 20, xˉ1=80\bar{x}_1 = 80, σ12=25\sigma_1^2 = 25. Class B: n2=30n_2 = 30, xˉ2=90\bar{x}_2 = 90, σ22=16\sigma_2^2 = 16. Combined:

xˉc=20(80)+30(90)50=1600+270050=430050=86σc2=20(25+(80−86)2)+30(16+(90−86)2)50=20(25+36)+30(16+16)50=20(61)+30(32)50=1220+96050=218050=43.6.\begin{aligned} \bar{x}_c &= \frac{20(80) + 30(90)}{50} = \frac{1600 + 2700}{50} = \frac{4300}{50} = 86\\[2pt] \sigma_c^2 &= \frac{20\big(25 + (80-86)^2\big) + 30\big(16 + (90-86)^2\big)}{50}\\ &= \frac{20(25 + 36) + 30(16 + 16)}{50} = \frac{20(61) + 30(32)}{50}\\ &= \frac{1220 + 960}{50} = \frac{2180}{50} = 43.6. \end{aligned}

So σc=43.6≈6.60\sigma_c = \sqrt{43.6} \approx 6.60 — larger than either group's own spread, because the two centers (8080 and 9090) are pulled apart.

Tip

Weighted, not averaged. A combined mean weights by group size, and combined variance adds a “spread between the groups” correction. Never just average the two means or the two variances unless n1=n2n_1 = n_2 and the means coincide.

Why It Works

Combinations come from permutations by removing order: choosing kk items in order can be done n!(n−k)!\tfrac{n!}{(n-k)!} ways, and each unordered selection was counted k!k! times (once per ordering), so (nk)=n!k!(n−k)!\binom nk = \tfrac{n!}{k!(n-k)!}. Independent events multiply because the second event's probability is unchanged by the first; conditional probability P(A∣B)=P(A∩B)P(B)P(A\mid B) = \tfrac{P(A\cap B)}{P(B)} simply restricts the sample space to BB and renormalizes.

Tip
Reading a proof

Do not read a proof the way you read a rule. Cover the last line, ask what the previous line forces, and only then uncover it. If a step feels like magic, that is the step to work by hand with a concrete number.

Formulas, Proofs & Tips

Tip
Standard deviation
σ=∑(xi−xˉ)2n\sigma=\sqrt{\frac{\sum (x_i-\bar{x})^{2}}{n}}

What it means. The typical distance of a value from the mean.

Example. For 2,4,62,4,6: mean 44, so σ=4+0+43=83≈1.63\sigma=\sqrt{\tfrac{4+0+4}{3}}=\sqrt{\tfrac83}\approx1.63.

Why it works. Raw deviations xi−xˉx_i-\bar x sum to zero, so they are squared to stop cancellation, averaged to get a typical squared distance, then square-rooted to return to the original units.

Tip. Adding a constant to every value leaves σ\sigma unchanged; multiplying every value by kk multiplies σ\sigma by ∣k∣|k|.