Lecture Notes — Lecture 26: Counting and Probability in Data

Companion to the lecture plan and the worked examples. Read the Definitions before class, the Explanation after it; the practice questions and the lecture quiz close the loop.

Definitions

Explanation

Counting graduates into probability: same arithmetic, plus a denominator of equally likely or observed outcomes. Frequency tables turn anecdote into arithmetic ('usually under 3 minutes' becomes 7 of 14 days - exactly half, not 'usually'). Conditional probability is the 2x2 table skill: P(mobile given double-click) and P(double-click given mobile) share a numerator and swap denominators - confusing them is the classic base-rate fallacy. Independence is the special case where conditioning changes nothing; its failure is exactly what 'the evidence changed my mind' means, quantified. The complement rule and the multiplication rule do most of the work in exercises; the birthday-style surprises come from multiplying complements (1 - 364/365 x ...). Throughout, we keep the data frame: these are counts from a table, not oracle probabilities - and small samples make every ratio jumpy.

Examples

The lecture's worked examples live in examples.md; the case studies this lecture builds on are worked in class from the projector. The case sequence with difficulties:

Common misconceptions

Summary and key takeaways

  1. Frequency tables turn adjectives into fractions.
  2. P(A given B) and P(B given A) share a numerator and swap denominators - never conflate.
  3. Base rates decide how impressive evidence is.
  4. Complements multiply into surprises: the birthday result is subtraction-friendly.
  5. Independence is a model, not an observation; test it, do not assume it.

Practice questions

Where this leads

Next lecture: Tables, Cleaning, and Anomalies. The quiz below checks this lecture's essentials before we build on them.