Probability Basics

Difficulty
Importance

The problem

Real systems are full of uncertainty — request latencies vary, hash collisions happen, servers fail at some rate, users convert at some percentage. Probability quantifies that uncertainty instead of pretending systems are deterministic.

Why now

Sets and logic let us describe events precisely — an event is a subset of possible outcomes — and combinatorics lets us count how many ways something can happen. Probability adds the missing piece: a measure that turns 'how many ways' into 'how likely,' which requires both as prerequisites.

Mental model

Probability is counting, normalized: the chance of an event is the fraction of the total possibility-space it occupies. Once outcomes are equally likely, 'probability' and 'combinatorics problem' are the same question asked two ways — which is why the birthday paradox, hash collisions, and load-balancing fairness all reduce to the same calculation.

Requires

Unlocks

Used in

Projects

  • Simulate the birthday paradox for hash collisions and compare empirical results to the calculated probability
  • Given a service's per-request failure rate, calculate the probability of at least one failure in a batch of N requests

Examples

  • A hash function with a 32-bit output has a >50% chance of a collision after only ~77,000 keys (birthday bound)
  • If p99 latency is 100ms, roughly 1 in 100 requests takes longer — that's a probability statement about your system

Resources

Mastery checklist