Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Formula & theorem reference

Concept clusters →

Every named result in this course, grouped by chapter. Each one links back to where it's derived.

Readiness: what probability leans on

Formula

Union and Intersection

For sets A and B: A \cup B = \{\text{everything in } A,\text{ in } B,\text{ or in both}\} A \cap B = \{\text{everything in both } A \text{ and } B\}

Theorem

The Fundamental Counting Principle

If one choice can be made in m ways, and a second, independent choice can be made in n ways, then the two choices together can be made in m \times n ways. More generally, for a sequence of k independent choices with n_1, n_2, \ldots, n_k options respectively, the total number of outcomes is n_1 \times n_2 \times \cdots \times n_k.

Show proof

This isn't really a theorem to prove so much as a fact to see. Lay the first choice's m options down the rows of a grid and the second choice's n options across the columns. Every cell of that grid is exactly one valid pairing — one option from the first choice matched with one option from the second — and every valid pairing lands in exactly one cell. A grid with m rows and n columns has m \times n cells. Counting the pairings and counting the cells are the same question, so they have the same answer. Chaining a third independent choice onto the pair just replaces each cell of that grid with a fresh n_3-row stack, and multiplication absorbs each new stage the same way.

Formula

Permutations of n items taken r at a time

also known as: P(n,r) or nPr

The number of ways to arrange r items chosen from n distinct items, where order matters, is P(n,r) = \frac{n!}{(n-r)!}.

Show proof

This is just the counting principle, run r times in a row. The first position in the arrangement can be filled by any of the n items. The second position can be filled by any of the n - 1 items that remain (one has been used). The third by any of the n-2 remaining, and so on, down to the rth position, which has n - (r-1) = n - r + 1 choices left. Multiply across all r positions: P(n,r) = n \cdot (n-1) \cdot (n-2) \cdots (n - r + 1). That product has exactly r factors, starting at n and counting down. To see it equals \frac{n!}{(n-r)!}, write n! in full and notice the tail end cancels: n! = \bigl[n(n-1)\cdots(n-r+1)\bigr] \cdot (n-r)!, so dividing both sides by (n-r)! leaves exactly the product above.

Formula

Combinations of n items taken r at a time

also known as: C(n,r), nCr, or n choose r

The number of ways to choose r items from n distinct items, where order does not matter, is C(n,r) = \binom{n}{r} = \frac{n!}{r!\,(n-r)!}.

Show proof

Start from P(n,r), which counts every arrangement of r chosen items. Each unordered group of r items corresponds to many of those arrangements — specifically, every one of the r! ways to reorder that same group is a different permutation but the exact same combination. So P(n,r) overcounts each combination by a factor of r!, and dividing it out gives the true count: C(n,r) = \frac{P(n,r)}{r!} = \frac{n!/(n-r)!}{r!} = \frac{n!}{r!\,(n-r)!}.

Formula

Sum of an Infinite Geometric Series

also known as: the convergence formula S = a_1/(1-r)

For |r| < 1, S = \sum_{k=1}^{\infty} a_1 r^{\,k-1} = \frac{a_1}{1 - r}. The series diverges (has no finite sum) when |r| \ge 1.

Probability as a measure

Theorem

The Probability Axioms

also known as: the Kolmogorov axioms

A probability function P assigns a number to every event in a sample space S and must satisfy three rules:

  1. Nonnegativity. P(E) \geq 0 for every event E.
  2. Normalization. P(S) = 1.
  3. Additivity. If E_1, E_2, E_3, \ldots are pairwise mutually exclusive events (no two share an outcome), then P(E_1 \cup E_2 \cup E_3 \cup \cdots) = P(E_1) + P(E_2) + P(E_3) + \cdots.

Every other fact about probability, including the complement rule, monotonicity, inclusion-exclusion, and every named distribution's own properties, is a consequence of these three rules, not an independent assumption.

Formula

The Complement Rule

also known as: P(not A) = 1 - P(A)

For any event A with complement \overline{A} = S \setminus A, P(\overline{A}) = 1 - P(A).

Show proof

A and \overline{A} are mutually exclusive and their union is the whole sample space S. Additivity (axiom 3) gives P(A) + P(\overline{A}) = P(A \cup \overline{A}) = P(S), and normalization (axiom 2) gives P(S) = 1. So P(A) + P(\overline{A}) = 1, which rearranges to P(\overline{A}) = 1 - P(A).

Formula

The Addition Rule

also known as: P(A or B) = P(A) + P(B) - P(A and B)

For any two events A and B, P(A \cup B) = P(A) + P(B) - P(A \cap B).

Show proof

A \cup B splits into three mutually exclusive pieces: A \setminus B, A \cap B, and B \setminus A. Additivity gives P(A \cup B) = P(A \setminus B) + P(A \cap B) + P(B \setminus A). Separately, A splits into A \setminus B and A \cap B, so P(A) = P(A \setminus B) + P(A \cap B), and likewise P(B) = P(B \setminus A) + P(A \cap B). Adding P(A) + P(B) therefore counts P(A \cap B) twice; subtracting it once leaves exactly P(A \cup B).

Formula

Inclusion-Exclusion for Three Events

For any three events A, B, and C, P(A \cup B \cup C) = P(A) + P(B) + P(C) - P(A \cap B) - P(A \cap C) - P(B \cap C) + P(A \cap B \cap C).

Show proof

Apply the two-event addition rule to A \cup (B \cup C): P(A \cup B \cup C) = P(A) + P(B \cup C) - P\big(A \cap (B \cup C)\big). Expand P(B \cup C) = P(B) + P(C) - P(B \cap C) by the addition rule again. For the last term, A \cap (B \cup C) = (A \cap B) \cup (A \cap C) by the distributive law, so a third application of the addition rule gives P\big(A \cap (B \cup C)\big) = P(A \cap B) + P(A \cap C) - P(A \cap B \cap C). Substituting both expansions back in and collecting terms gives the stated formula. Each pairwise overlap is subtracted once and the triple overlap, removed three times by the pairwise subtractions, is added back once to restore it to being counted exactly once.

Theorem

De Morgan's Laws (Sets)

For sets A and B inside a universal set U: \overline{A \cup B} = \overline{A} \cap \overline{B} \overline{A \cap B} = \overline{A} \cup \overline{B}

Show proof

Both are proved by double inclusion, checking an arbitrary element x \in U against each side.

First law. x \in \overline{A \cup B} means x \notin A \cup B, which means x \notin A and x \notin B (an element outside a union is outside both pieces). That is exactly x \in \overline{A} and x \in \overline{B}, i.e. x \in \overline{A} \cap \overline{B}. Every step above reverses, so the two sets have identical elements.

Second law. x \in \overline{A \cap B} means x \notin A \cap B, which means x \notin A or x \notin B (an element outside an intersection is missing from at least one piece). That is exactly x \in \overline{A} or x \in \overline{B}, i.e. x \in \overline{A} \cup \overline{B}. Again every step reverses.

Both arguments are the exact set-theoretic translation of propositional De Morgan's laws, with \cup standing in for \vee, \cap for \wedge, and complement for negation.

Counting for probability

Formula

Permutations with repeated objects

The number of distinct arrangements of n objects, where one kind of object repeats n_1 times, another kind repeats n_2 times, and so on through n_k groups of indistinguishable objects (with n_1 + n_2 + \cdots + n_k = n), is \frac{n!}{n_1!\, n_2! \cdots n_k!}.

Show proof

Start from n!, the count if every one of the n objects were secretly distinct (as if each carried its own invisible label). Within that count, every group of n_1 identical objects can be relabeled among themselves in n_1! ways without changing the arrangement anyone can actually see — so n! overcounts the first repeated group by a factor of n_1!. The same overcounting happens independently for the second group (factor n_2!), the third, and so on. Dividing n! by n_1!\, n_2! \cdots n_k! removes every one of those redundant relabelings at once, since the groups' internal shufflings are independent of each other.

Formula

Circular Permutations

also known as: arrangements around a circle

The number of distinct ways to arrange n distinct items around a circle, where arrangements that differ only by rotation count as the same, is (n-1)!.

Show proof

Line the n items up in a row first: there are n! such arrangements. Bending any one row into a circle produces exactly n different rows that land on the same circular arrangement — one for each rotation of which item is "first." So every circular arrangement is counted n times among the n! linear ones, and dividing removes the overcount: \frac{n!}{n} = (n-1)!. Equivalently: fix one item's seat to remove rotational symmetry, then arrange the other n-1 items in the remaining seats in any order.

Formula

The Multinomial Coefficient

also known as: the number of ways to split n items into labeled groups

The number of ways to split n distinct items into labeled groups of sizes k_1, k_2, \ldots, k_m (with k_1 + k_2 + \cdots + k_m = n) is \binom{n}{k_1, k_2, \ldots, k_m} = \frac{n!}{k_1!\,k_2!\,\cdots\,k_m!}.

Show proof

Choose the first group of k_1 items from all n: \binom{n}{k_1} ways. From the n - k_1 that remain, choose the second group of k_2: \binom{n-k_1}{k_2} ways. Continue until every item is placed. By the product rule, the total count is \binom{n}{k_1}\binom{n-k_1}{k_2}\binom{n-k_1-k_2}{k_3}\cdots = \frac{n!}{k_1!(n-k_1)!}\cdot\frac{(n-k_1)!}{k_2!(n-k_1-k_2)!}\cdots. Every factorial in a denominator cancels the matching factorial in the next numerator except the very last, leaving \dfrac{n!}{k_1!\,k_2!\,\cdots\,k_m!}. Setting m=2 recovers the ordinary binomial coefficient \binom{n}{k_1,\,n-k_1} = \binom{n}{k_1}.

Formula

Stars and Bars

also known as: distributing identical items into labeled bins

The number of ways to distribute n identical items into k labeled bins (some bins may be empty) is \binom{n+k-1}{k-1}.

Show proof

Represent the n items as n stars in a row. Splitting them into k bins is the same as choosing where to place k-1 dividing bars among the stars — everything before the first bar goes in bin 1, everything between the first and second bar goes in bin 2, and so on. The row now has n stars and k-1 bars, n+k-1 symbols in total, and a distribution is completely determined by which k-1 of those n+k-1 positions hold bars. That is exactly \binom{n+k-1}{k-1} choices.

Conditional probability and independence

Formula

Conditional Probability

also known as: P(A given B)

P(A \mid B) = \frac{P(A \text{ and } B)}{P(B)}, \qquad P(B) \neq 0.

Formula

The Multiplication Rule

also known as: the general product rule for probability

For any two events A and B with P(A) \neq 0, P(A \cap B) = P(A)\,P(B \mid A).

Show proof

The conditional probability formula defines P(B \mid A) = \dfrac{P(A \cap B)}{P(A)} whenever P(A) \neq 0. Multiplying both sides by P(A) isolates P(A \cap B) directly: P(A)\,P(B \mid A) = P(A) \cdot \frac{P(A \cap B)}{P(A)} = P(A \cap B). The same rearrangement starting from P(A \mid B) gives the symmetric form P(A \cap B) = P(B)\,P(A \mid B) whenever P(B) \neq 0 instead.

Theorem

The Law of Total Probability

If B_1, B_2, \ldots, B_n partition the sample space (they are pairwise mutually exclusive and their union is the whole space), then for any event A, P(A) = \sum_{i=1}^{n} P(A \mid B_i)\,P(B_i).

Show proof

Because the B_i partition the sample space, A itself splits into the pairwise mutually exclusive pieces A \cap B_1, A \cap B_2, \ldots, A \cap B_n — every outcome in A lands in exactly one B_i, so it lands in exactly one A \cap B_i. The third probability axiom (additivity) then gives P(A) = P(A \cap B_1) + P(A \cap B_2) + \cdots + P(A \cap B_n). The multiplication rule rewrites each term as P(A \cap B_i) = P(A \mid B_i)\,P(B_i), which is exactly the sum above.

Theorem

Bayes' Theorem

For events A and B with P(B) \neq 0, P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}.

Show proof

The Conditional Probability formula, applied to P(A\mid B) and to P(B\mid A) separately, gives two ways to write the same joint probability: P(A\text{ and }B) = P(A\mid B)\,P(B), \qquad P(A\text{ and }B) = P(B\mid A)\,P(A). Both right-hand sides equal the same quantity, so they equal each other: P(A\mid B)\,P(B) = P(B\mid A)\,P(A). Dividing both sides by P(B) (nonzero by hypothesis) isolates P(A\mid B): P(A\mid B) = \frac{P(B\mid A)\,P(A)}{P(B)}.

Formula

Bayes' Theorem, Odds Form

also known as: posterior odds = likelihood ratio times prior odds

Writing the odds of an event A against its complement as \operatorname{odds}(A) = \dfrac{P(A)}{P(\text{not } A)}, Bayes' theorem becomes \operatorname{odds}(A \mid B) = \frac{P(B \mid A)}{P(B \mid \text{not } A)} \cdot \operatorname{odds}(A).

Show proof

Apply Bayes' theorem to A and to its complement separately: P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}, \qquad P(\text{not } A \mid B) = \frac{P(B \mid \text{not } A)\,P(\text{not } A)}{P(B)}. Dividing the first equation by the second cancels the shared denominator P(B) entirely: \frac{P(A \mid B)}{P(\text{not } A \mid B)} = \frac{P(B \mid A)}{P(B \mid \text{not } A)} \cdot \frac{P(A)}{P(\text{not } A)}. The left side is \operatorname{odds}(A \mid B) and the rightmost factor is \operatorname{odds}(A), giving exactly the stated form. Never needing P(B) is the whole appeal: the odds form updates a prior directly by a likelihood ratio, with no separate normalization step.

Formula

Independent Events

also known as: the product rule for independence

Events A and B are independent when P(A \cap B) = P(A)\,P(B).

Show proof

The multiplication rule gives P(A \cap B) = P(A)\,P(B \mid A) whenever P(A) \neq 0. Substituting P(A \cap B) = P(A)P(B) and dividing both sides by P(A) shows this is equivalent to P(B \mid A) = P(B) — conditioning on A leaves B's probability completely unchanged, which is the intuitive meaning independence is meant to capture. The same substitution starting from P(A\mid B) shows P(A\mid B) = P(A) whenever P(B)\ne 0, confirming the relationship is symmetric.

Definition

Pairwise Independence Does Not Imply Mutual Independence

also known as: a pairwise-independent, not-mutually-independent triple

Flip two fair coins and let A = "first coin is heads," B = "second coin is heads," C = "the two coins show different faces (exactly one heads)." Every pair among A, B, C is independent: P(A) = P(B) = P(C) = \tfrac12, and each pairwise intersection has probability \tfrac14 = \tfrac12 \cdot \tfrac12. But the three are not mutually independent, since knowing any two determines the third completely: P(A \cap B \cap C) = 0 \neq \tfrac12\cdot\tfrac12\cdot\tfrac12 = \tfrac18.

Show proof

The four equally likely outcomes are HH, HT, TH, TT. A = \{HH, HT\}, B = \{HH, TH\}, C = \{HT, TH\}, each with probability \tfrac12. Every pairwise intersection is a single outcome: A \cap B = \{HH\}, A \cap C = \{HT\}, B \cap C = \{TH\}, each with probability \tfrac14 = \tfrac12\cdot\tfrac12 — so all three pairs pass the independence test. But A \cap B = \{HH\} already forces the outcome to be HH whenever both A and B hold — and HH fails C (the two coins agree, they don't differ). So A \cap B \cap C = \varnothing, giving P(A\cap B\cap C) = 0, while P(A)P(B)P(C) = \tfrac18 \neq 0. Mutual independence genuinely asks more than every pair checking out.

Discrete random variables

Definition

Random Variable

also known as: X: S -> R

A random variable X is a function from a sample space S to the real numbers, X: S \to \mathbb{R}, assigning exactly one numerical value to every outcome. X is discrete when its set of possible values is finite or countable.

Show proof

Nothing here is a new kind of object — X is an ordinary function, with domain S (the outcomes) and range the set of values X actually takes. Different outcomes can share a value (the function need not be one-to-one), which is exactly why a random variable's range is almost always smaller than its domain: many outcomes routinely collapse onto one number. The probability distribution of X records, for every value x in its range, the probability P(X=x) of the event \{s \in S : X(s)=x\} — the set of every outcome mapping to that value.

Formula

Conditions for a Valid Probability Mass Function

also known as: pmf validity

A function p assigning a number to every value x in a discrete random variable X's range is a valid probability mass function exactly when p(x) \geq 0 \text{ for every } x, \qquad \sum_x p(x) = 1.

Show proof

Both conditions are the probability axioms restated for a random variable's own values rather than for arbitrary events. Each p(x) is really P(X=x), the probability of the event \{s \in S : X(s)=x\}, so nonnegativity of probability forces p(x)\ge 0. The events "X=x" for every possible x are pairwise mutually exclusive (a single outcome can't map to two different values) and their union is the entire sample space, so additivity plus normalization force \sum_x p(x) = P(S) = 1.

Definition

The Cumulative Distribution Function

also known as: CDF, F(x)

The cumulative distribution function of a random variable X is F(x) = P(X \leq x), defined for every real number x, not just the values X can actually take.

Show proof

For a discrete random variable with pmf p, F(x) sums p over every value at or below x: F(x) = \sum_{t \leq x} p(t). Because the events "X=t" for different t are pairwise mutually exclusive, this sum is exactly P(X \leq x) by additivity. F is defined at every real x (not only X's own possible values) because the question "P(X \leq x)" makes sense no matter what number x is asked about — between two consecutive values X can take, F simply stays flat, since no additional probability mass has been crossed.

Expectation and variance

Formula

Expected value of a discrete outcome

also known as: E(X), the mean of a random variable

If a quantity X can take values x_1, x_2, \ldots, x_n with respective probabilities p_1, p_2, \ldots, p_n (with p_1 + p_2 + \cdots + p_n = 1), its expected value is E(X) = \sum_{i=1}^{n} x_i \cdot p_i = x_1 p_1 + x_2 p_2 + \cdots + x_n p_n.

Show proof

This is a weighted average, and the weighting is what makes it meaningful over the long run. Imagine repeating the underlying random process N times, for very large N: outcome x_i will occur approximately N p_i times (that's what "probability p_i" means in the long run). The total payout across all N trials is then approximately \sum_i x_i \cdot (N p_i), and dividing by N trials to get the average payout per trial leaves exactly \sum_i x_i p_i — the probabilities' role as relative frequencies is what turns a plain average into a probability-weighted one.

Formula

The Law of the Unconscious Statistician

also known as: LOTUS, E[g(X)]

For a discrete random variable X with pmf p and any function g, E[g(X)] = \sum_x g(x)\,p(x). Notably, this needs no separate distribution for g(X) itself; the original pmf p is enough.

Show proof

Group the sample space by X's own value: every outcome s with X(s)=x contributes g(X(s)) = g(x) to the sum defining E[g(X)] over outcomes, and there are exactly p(x) worth of probability mass among those outcomes. Summing g(x) once per value x, weighted by how much probability mass maps to that x, is precisely \sum_x g(x)p(x), the same regrouping-by-value argument that turns "sum over outcomes" into "sum over X's own values" for E[X] itself, applied here to g(X) instead of X.

Theorem

Linearity of Expectation

also known as: E[X+Y] = E[X] + E[Y]

For any two random variables X and Y defined on the same sample space, and any constants a, b, E(aX + bY) = a\,E(X) + b\,E(Y). This holds whether or not X and Y are independent.

Show proof

Let the sample space be S = \{s_1, s_2, \ldots, s_n\} with P(s_i) = p_i. By definition, a random variable's expected value is a sum taken directly over the sample space: E(aX+bY) = \sum_{i=1}^{n} \big(aX(s_i) + bY(s_i)\big)\,p_i. Distribute p_i across the sum inside each term, then split the single sum into two sums, since addition of finitely many numbers can always be regrouped this way: \sum_{i=1}^{n} \big(aX(s_i)p_i + bY(s_i)p_i\big) = a\sum_{i=1}^{n} X(s_i)p_i + b\sum_{i=1}^{n} Y(s_i)p_i. The two resulting sums are exactly E(X) and E(Y) by definition, so E(aX+bY) = a\,E(X) + b\,E(Y). Nowhere did this argument use P(X=x, Y=y) = P(X=x)P(Y=y) — the independence condition — which is exactly why the result holds regardless of whether X and Y are independent.

Definition

Variance

also known as: Var(X)

The variance of a random variable X with mean \mu = E(X) is \operatorname{Var}(X) = E\big[(X-\mu)^2\big] = \sum_x (x-\mu)^2\,p(x). It measures how spread out X's values tend to be around its own mean.

Show proof

(X-\mu) is itself a random variable — how far a draw of X lands from the mean — and squaring it makes every deviation contribute positively regardless of direction, so a symmetric spread above and below the mean doesn't cancel to zero the way E(X-\mu) itself always does (by linearity, E(X-\mu) = E(X)-\mu = 0 for every distribution, which is exactly why "average deviation" isn't a useful measure of spread on its own). \operatorname{Var}(X) is LOTUS applied to g(x) = (x-\mu)^2, which is why it's expressed as a weighted sum over X's own pmf rather than needing a separate distribution for the squared deviation.

Formula

The Computational Formula for Variance

also known as: Var(X) = E[X^2] - (E[X])^2

For a random variable X with mean \mu = E(X), \operatorname{Var}(X) = E(X^2) - \mu^2.

Show proof

Expand the squared deviation inside the definition of variance: \operatorname{Var}(X) = E\big[(X-\mu)^2\big] = E\big[X^2 - 2\mu X + \mu^2\big]. Linearity of expectation splits this into three separate terms, treating \mu (a constant, not a random variable) as it would any constant multiplier: E(X^2) - 2\mu\,E(X) + \mu^2. Since E(X) = \mu by definition, the middle term is -2\mu \cdot \mu = -2\mu^2, leaving E(X^2) - 2\mu^2 + \mu^2 = E(X^2) - \mu^2. This form is almost always faster to compute by hand than the definition directly, since it needs only two separate expected-value sums (of X and of X^2) rather than one sum over every deviation.

Formula

Variance Under a Linear Transformation

also known as: Var(aX + b) = a^2 Var(X)

For a random variable X and constants a, b, \operatorname{Var}(aX+b) = a^2\operatorname{Var}(X). Notably, shifting by b never changes the variance at all.

Show proof

Let \mu = E(X), so E(aX+b) = a\mu+b by linearity. Then \operatorname{Var}(aX+b) = E\big[(aX+b-(a\mu+b))^2\big] = E\big[(aX-a\mu)^2\big] = E\big[a^2(X-\mu)^2\big]. Linearity pulls the constant a^2 back out of the expectation: a^2 E\big[(X-\mu)^2\big] = a^2\operatorname{Var}(X). The shift b cancelled entirely inside the subtraction, which is exactly why adding a constant to every outcome moves the mean but never changes how spread out the outcomes are around it.

Theorem

Variance of a Sum of Independent Random Variables

also known as: Var(X+Y) = Var(X) + Var(Y), for independent X, Y

If X and Y are independent random variables, then \operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y). Unlike linearity of expectation, this requires independence. It is not true for dependent variables in general.

Show proof

Let \mu_X = E(X), \mu_Y = E(Y). Expand the squared deviation of the sum: \operatorname{Var}(X+Y) = E\big[((X-\mu_X)+(Y-\mu_Y))^2\big] = E\big[(X-\mu_X)^2\big] + E\big[(Y-\mu_Y)^2\big] + 2E\big[(X-\mu_X)(Y-\mu_Y)\big]. The first two terms are \operatorname{Var}(X) and \operatorname{Var}(Y) directly. The cross term is the covariance of X and Y; independence makes E[(X-\mu_X)(Y-\mu_Y)] = E(X-\mu_X)\,E(Y-\mu_Y) = 0 \cdot 0 = 0 (the expectation of a product of independent quantities is the product of their expectations, and each factor's own expectation is zero by linearity). With the cross term gone, \operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) exactly. Without independence, that cross term need not vanish, which is why this result — unlike linearity of expectation — genuinely needs the hypothesis.

The named discrete distributions

Formula

The Bernoulli distribution

also known as: X ~ Bernoulli(p)

X is Bernoulli(p) if it takes value 1 ("success") with probability p and 0 ("failure") with probability 1-p. Its pmf, mean, and variance are p(x) = p^x(1-p)^{1-x}, \quad x \in \{0,1\}, \qquad E(X)=p, \qquad \operatorname{Var}(X)=p(1-p).

Show proof

A Bernoulli random variable is exactly an indicator random variable for its own success event, so its mean and variance follow directly from the indicator-variable results already established: E(X) = 1\cdot p + 0\cdot(1-p) = p, and E(X^2) = 1^2\cdot p + 0^2\cdot(1-p) = p, so \operatorname{Var}(X) = E(X^2)-\mu^2 = p - p^2 = p(1-p).

Formula

The binomial distribution

also known as: X ~ Binomial(n, p)

X is Binomial(n, p) if it counts the number of successes in n independent Bernoulli(p) trials. Its pmf, mean, and variance are p(k) = \binom{n}{k}p^k(1-p)^{n-k}, \quad k \in \{0,1,\ldots,n\}, \qquad E(X)=np, \qquad \operatorname{Var}(X)=np(1-p).

Show proof

Write X = I_1 + I_2 + \cdots + I_n, one indicator per trial (the indicator trick). Linearity gives E(X) = \sum_i E(I_i) = np immediately, with no independence required. The variance DOES need independence: since the trials are independent, \operatorname{Var}(X) = \sum_i \operatorname{Var}(I_i) = n\,p(1-p), applying the sum-of- independent-variables rule to n terms instead of just two. The pmf counts the \binom{n}{k} orderings of k successes and n-k failures, each with probability p^k(1-p)^{n-k}.

Formula

The geometric distribution

also known as: X ~ Geometric(p)

X is Geometric(p) if it counts the number of independent Bernoulli(p) trials up to and including the first success (support \{1,2,3,\ldots\}). Its pmf, mean, and variance are p(k) = (1-p)^{k-1}p, \quad k \ge 1, \qquad E(X)=\frac1p, \qquad \operatorname{Var}(X)=\frac{1-p}{p^2}.

Show proof

p(k) is exactly k-1 failures then one success, each trial independent: (1-p)^{k-1}\cdot p. The mean and variance both follow from differentiating the geometric series \sum_{k\ge1}(1-p)^{k-1} = 1/p with respect to p -- the details are a calculus exercise, not a probability one, and are not re-derived here.

Definition

The memoryless property (discrete)

also known as: P(X > s+t | X > s) = P(X > t)

A geometric random variable X is memoryless: conditioned on surviving past trial s with no success yet, the number of ADDITIONAL trials needed still has the same Geometric(p) distribution, no matter how large s already is. P(X > s+t \mid X > s) = P(X > t), \qquad s,t \ge 0 \text{ integers}.

Show proof

P(X>s) = (1-p)^s (the first s trials all fail). So P(X>s+t \mid X>s) = \frac{P(X>s+t)}{P(X>s)} = \frac{(1-p)^{s+t}}{(1-p)^s} = (1-p)^t = P(X>t). The past failures carry no information about the future -- the process has no memory of how long it has already run.

Formula

The negative binomial distribution

also known as: X ~ NegBinomial(r, p)

X is negative binomial(r, p) if it counts the number of independent Bernoulli(p) trials up to and including the r-th success (support \{r, r+1, r+2, \ldots\}). Its pmf, mean, and variance are p(k) = \binom{k-1}{r-1}p^r(1-p)^{k-r}, \quad k \ge r, \qquad E(X)=\frac{r}{p}, \qquad \operatorname{Var}(X)=\frac{r(1-p)}{p^2}.

Show proof

X = Y_1+Y_2+\cdots+Y_r, a sum of r INDEPENDENT Geometric(p) variables -- Y_1 is the wait for the 1st success, Y_2 the additional wait for the 2nd after the 1st, and so on, each fresh wait having the same distribution by the memoryless property. Linearity gives E(X) = r\cdot(1/p) = r/p; independence lets variances add, giving \operatorname{Var}(X) = r\cdot(1-p)/p^2. The pmf counts orderings of r-1 successes among the first k-1 trials, times the fixed r-th trial itself landing on a success.

Formula

The hypergeometric distribution

also known as: X ~ Hypergeometric(N, K, n)

A population of N items has K "successes"; n are drawn WITHOUT replacement. X, the number of successes among the n drawn, is hypergeometric(N,K,n): p(k) = \frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}}, \qquad E(X)=n\frac{K}{N}, \qquad \operatorname{Var}(X)=n\frac{K}{N}\left(1-\frac{K}{N}\right)\frac{N-n}{N-1}.

Show proof

The pmf is a direct ratio of counts: choose k of the K successes and n-k of the N-K failures, over all \binom{N}{n} equally likely samples. The mean matches the binomial mean n\cdot(K/N) exactly (by symmetry, each of the n draws is marginally a success with probability K/N, and linearity of expectation never needed independence). The variance carries an extra factor \tfrac{N-n}{N-1}, the finite population correction, versus the binomial's np(1-p) -- it shrinks toward 0 as n\to N (drawing the whole population removes all randomness) and toward 1 as N\to\infty (sampling without replacement from a huge population behaves like sampling with replacement).

Formula

The Poisson distribution

also known as: X ~ Poisson(lambda)

X is Poisson(\lambda) if it counts the number of events occurring in a fixed interval, when events occur independently at a constant average rate \lambda per interval (support \{0,1,2,\ldots\}). Its pmf, mean, and variance are p(k) = \frac{e^{-\lambda}\lambda^k}{k!}, \quad k \ge 0, \qquad E(X)=\lambda, \qquad \operatorname{Var}(X)=\lambda.

Show proof

The mean and variance both equal \lambda -- a distinctive fingerprint of this family, unlike the binomial where mean np and variance np(1-p) differ whenever p\ne 0. The pmf itself is most easily justified as the limit of a binomial pmf as n\to\infty with np held fixed at \lambda, which the next section derives directly.

Theorem

Poisson as a limit of binomial

also known as: Binomial(n, lambda/n) -> Poisson(lambda) as n -> infinity

Fix \lambda > 0. As n \to \infty with p = \lambda/n (so np=\lambda stays fixed), the Binomial(n, \lambda/n) pmf converges to the Poisson(\lambda) pmf at every k: \lim_{n\to\infty} \binom{n}{k}\left(\frac{\lambda}{n}\right)^k\left(1-\frac{\lambda}{n}\right)^{n-k} = \frac{e^{-\lambda}\lambda^k}{k!}.

Show proof

Expand the binomial pmf and separate the pieces that have a clean limit: \binom{n}{k}\left(\frac{\lambda}{n}\right)^k\left(1-\frac{\lambda}{n}\right)^{n-k} = \frac{n(n-1)\cdots(n-k+1)}{n^k}\cdot\frac{\lambda^k}{k!}\cdot\left(1-\frac{\lambda}{n}\right)^{n-k}. The first factor is a product of k terms each of the form \tfrac{n-j}{n}\to 1 as n\to\infty, for fixed k. The last factor is \left(1-\tfrac{\lambda}{n}\right)^{n-k} \to e^{-\lambda}, a standard limit (the same one that defines e^x). What remains is exactly \tfrac{\lambda^k}{k!}e^{-\lambda}, the Poisson(\lambda) pmf. This is why the Poisson distribution models "rare events over many opportunities" -- a large number of trials n, each individually unlikely (p small), with the product np held at a moderate rate \lambda.

Formula

The discrete uniform distribution

also known as: X ~ DiscreteUniform(a, b)

X is discrete uniform on \{a, a+1, \ldots, b\} if every one of its b-a+1 integer values is equally likely. Its pmf, mean, and variance are p(k) = \frac{1}{b-a+1}, \quad k \in \{a,\ldots,b\}, \qquad E(X)=\frac{a+b}{2}, \qquad \operatorname{Var}(X)=\frac{(b-a+1)^2-1}{12}.

Show proof

The mean is the midpoint of the range, by symmetry -- every value is equally likely, so the weighted average is the plain average of the two endpoints. The variance formula follows from summing (k-\mu)^2 evenly across all b-a+1 values (a sum of squares of an evenly spaced sequence centered at 0), and is not re-derived here.

Continuous random variables

Formula

Probability density function

also known as: PDF

A function f is a probability density function on [a,b] if f(x)\ge 0 for every x in [a,b] and \int_a^b f(x)\,dx = 1. For any c,d with a\le c\le d\le b, the probability that the outcome falls in [c,d] is P(c\le X\le d) = \int_c^d f(x)\,dx.

Show proof

The two conditions are exactly the continuous analogue of a discrete probability distribution: individual probabilities can't be negative, which forces f(x)\ge 0, and the probabilities of all possible outcomes must add to 1, which becomes \int_a^b f(x)\,dx=1 once "adding over all outcomes" is replaced by integrating over the continuum from a to b. The same reasoning that turns a sum into an integral for area turns "sum the probability over every outcome in [c,d]" into \int_c^d f(x)\,dx — each infinitesimal width dx near x carries "probability density f(x) times width dx" worth of probability, and those slivers are added by the integral exactly as area slivers are.

Definition

The continuous cumulative distribution function

also known as: F(x) = P(X<=x)

For a continuous random variable X with pdf f, the cumulative distribution function is F(x) = P(X\le x) = \int_{-\infty}^{x} f(t)\,dt. F is non-decreasing, F(-\infty)=0, F(\infty)=1, and (unlike a discrete CDF) is continuous everywhere -- no jumps, since a single point carries zero probability.

Show proof

P(X\le x) is the probability mass to the left of x, which for a continuous variable is exactly the area under f from -\infty to x -- the same "area equals probability" fact probability-as-area already established, applied to a growing interval instead of a fixed one. F is non-decreasing since extending the interval of integration can only add nonnegative area. F has no jumps because a jump of size P(X=x) would require P(X=x)>0, which is false for every continuous X.

Theorem

Fundamental Theorem of Calculus, Part 1

also known as: FTC1, the accumulation-function derivative theorem

Suppose f is continuous on [a, b]. Define A(x) = \int_a^x f(t)\,dt for x in [a, b]. Then A is differentiable on (a, b) and

A'(x) = f(x).
Show proof

Fix x in (a,b) and form the difference quotient defining A'(x): \frac{A(x+h)-A(x)}{h} = \frac{1}{h}\left[\int_a^{x+h}f(t)\,dt -\int_a^x f(t)\,dt\right] = \frac{1}{h}\int_x^{x+h} f(t)\,dt, the last step by additivity of the definite integral over adjacent intervals. The remaining integral is f's net signed area over a sliver of width h -- and by the Mean Value Theorem for Integrals (f continuous on [x,x+h]), that sliver equals f(c)\cdot h for SOME c between x and x+h, so \frac{A(x+h)-A(x)}{h} = f(c) \quad\text{for some $c$ strictly between $x$ and $x+h$.} As h\to0, c is squeezed between x and x+h and is forced to x too, and f's continuity at x then forces f(c)\to f(x). Taking the limit, A'(x) = \lim_{h\to0}\frac{A(x+h)-A(x)}{h} = \lim_{h\to0} f(c) = f(x).

The same conclusion falls out of the Riemann-sum definition directly, without invoking the Mean Value Theorem for Integrals: for small h, \int_x^{x+h} f(t)\,dt is itself approximated by a single thin rectangle of width h and height approximately f(x) (since f barely changes over an interval that short, by continuity), so \frac{1}{h}\int_x^{x+h}f(t)\,dt\approx f(x), with the approximation becoming exact in the limit h\to0 -- the same "thin slice, height \approx f(x)" idea Chapter 7 built Riemann sums from in the first place, just run over a single infinitesimally short interval instead of the whole [a,b].

Continuity of f is load-bearing in both arguments: it is what supplies the Mean Value Theorem for Integrals' own hypothesis, and it is what forces f(c)\to f(x) as the squeezed point c\to x -- a discontinuous f can make A fail to be differentiable exactly at the discontinuity, even though A itself (an accumulated area) still exists there.

Loading interactive…

Definition

Quantile

also known as: the p-th quantile; the median is the 0.5 quantile

The p-th quantile of a continuous random variable X is the value x_p solving F(x_p) = p, \qquad \text{i.e., } x_p = F^{-1}(p). The median is the special case p=0.5: the value splitting the distribution's probability exactly in half.

Show proof

Since a continuous CDF F is non-decreasing and takes every value in [0,1] continuously (no jumps), F^{-1}(p) is well-defined for every p strictly between 0 and 1 -- exactly one x_p satisfies F(x_p)=p. This is the continuous counterpart of "reading a CDF graph backwards": instead of finding F(x) from x, a quantile finds x from a target probability p.

Formula

Expected value of a continuous random variable

also known as: E(X) for a PDF

If X is a continuous random variable with probability density function f on [a,b], its expected value is E(X) = \int_a^b x\,f(x)\,dx.

Show proof

This is the continuous version of the discrete weighted average E(X)=\sum_i x_i p_i. Partition [a,b] into thin slivers of width \Delta x; the sliver at x carries approximately f(x)\Delta x worth of probability (by the definition of a density), so it contributes x\cdot f(x)\Delta x to the weighted sum, the same way a discrete outcome x_i contributes x_i p_i. Summing every sliver's contribution gives a Riemann sum \sum x\,f(x)\Delta x, and letting the slivers shrink turns that sum into \int_a^b x f(x)\,dx.

The named continuous distributions

Formula

The continuous uniform distribution

also known as: X ~ Uniform(a, b)

X is continuous uniform on [a,b] if its density is flat across the whole interval: f(x) = \frac{1}{b-a}, \quad a\le x\le b, \qquad E(X)=\frac{a+b}{2}, \qquad \operatorname{Var}(X)=\frac{(b-a)^2}{12}.

Show proof

f integrates to 1 over [a,b] automatically: \int_a^b \frac{1}{b-a}\,dx = \frac{b-a}{b-a} = 1. The mean is the midpoint by the same symmetry argument the discrete uniform distribution used -- no value is weighted more than any other. The variance formula matches the discrete uniform's own \big((b-a+1)^2-1\big)/12 in the limit of infinitely many equally spaced values collapsing to a continuum, simplifying to (b-a)^2/12.

Formula

The exponential distribution

also known as: X ~ Exponential(rate)

X is exponential with rate \lambda if it models the continuous waiting time until the next event of a Poisson process with that same rate. Its pdf, mean, and variance are f(x) = \lambda e^{-\lambda x}, \quad x\ge 0, \qquad E(X)=\frac1\lambda, \qquad \operatorname{Var}(X)=\frac1{\lambda^2}.

Show proof

The exponential is the continuous counterpart of the geometric distribution: where geometric counts discrete TRIALS until the first success, exponential measures continuous TIME until the first Poisson event, at the same underlying rate \lambda. Its CDF F(x)=1-e^{-\lambda x} comes directly from a Poisson-process fact: no events occurring in [0,x] has probability e^{-\lambda x} (the Poisson pmf at 0, with mean \lambda x), so at least one event by time x has probability 1-e^{-\lambda x}.

Definition

The memoryless property (continuous)

also known as: P(X > s+t | X > s) = P(X > t), continuous case

An exponential random variable X is memoryless: having already waited s time units with no event yet, the ADDITIONAL wait still has exactly the same \operatorname{Exponential}(\lambda) distribution, for any s,t\ge0: P(X > s+t \mid X > s) = P(X > t).

Show proof

P(X>s) = e^{-\lambda s} (no events in [0,s]). So P(X>s+t\mid X>s) = \frac{P(X>s+t)}{P(X>s)} = \frac{e^{-\lambda(s+t)}}{e^{-\lambda s}} = e^{-\lambda t} = P(X>t). This is the exact continuous-time analog of the geometric distribution's own memoryless property, and the exponential is in fact the ONLY continuous distribution with this property, the same way geometric is the only memoryless discrete one.

Formula

The normal distribution

also known as: X ~ Normal(mu, sigma); the Gaussian, the bell curve

X is normal with mean \mu and standard deviation \sigma if its density is the familiar bell curve f(x) = \frac{1}{\sigma\sqrt{2\pi}}\,e^{-(x-\mu)^2/(2\sigma^2)}, \qquad E(X)=\mu, \qquad \operatorname{Var}(X)=\sigma^2. No closed-form antiderivative exists for f. So F(x) is always computed numerically, or read from a standardized table: the next section's own subject.

Show proof

The curve is symmetric about \mu (replacing x with 2\mu-x leaves f unchanged), which is why the mean and the median coincide for every normal distribution. It's bell-shaped because f is maximized exactly at x=\mu and decays toward 0 in both directions. That decay is faster as |x-\mu| grows relative to \sigma: \sigma itself controls exactly how fast it happens, wider for larger \sigma.

Formula

Z-score standardization

also known as: z = (x - mu) / sigma

For X\sim\operatorname{Normal}(\mu,\sigma), the z-score of a value x is z = \frac{x-\mu}{\sigma}. Z = (X-\mu)/\sigma is itself \operatorname{Normal}(0,1) -- the standard normal distribution -- and P(X\le x) = \Phi(z), where \Phi is the standard normal CDF.

Show proof

Standardizing is a linear transformation, Z=aX+b with a=1/\sigma, b=-\mu/\sigma. By the linear-transformation rules already established, E(Z) = E(X)/\sigma - \mu/\sigma = \mu/\sigma-\mu/\sigma=0 and \operatorname{Var}(Z) = \operatorname{Var}(X)/\sigma^2 = \sigma^2/\sigma^2=1 -- mean 0, variance 1, exactly the standard normal's own parameters. Every normal distribution reduces to the SAME standard normal after standardizing, which is exactly why one single \Phi table (or function) answers a probability question for any \mu,\sigma at all.

Theorem

The empirical rule

also known as: the 68-95-99.7 rule

For X\sim\operatorname{Normal}(\mu,\sigma), P(\mu-\sigma\le X\le\mu+\sigma)\approx 0.68, \quad P(\mu-2\sigma\le X\le\mu+2\sigma)\approx 0.95, \quad P(\mu-3\sigma\le X\le\mu+3\sigma)\approx 0.997.

Show proof

Each bound follows from \Phi(k)-\Phi(-k) at k=1,2,3, using the standard normal CDF: \Phi(1)-\Phi(-1)\approx0.6827, \Phi(2)-\Phi(-2)\approx0.9545, \Phi(3)-\Phi(-3)\approx0.9973. Since standardizing reduces every normal distribution to the same standard normal, these three numbers are universal -- they hold for every \mu and \sigma, not just a particular pair.

Theorem

Normal approximation to the binomial

also known as: Binomial(n,p) ~ Normal(np, sqrt(np(1-p))) for large n

For X\sim\operatorname{Binomial}(n,p) with n large enough that np\ge10 and n(1-p)\ge10, X \approx \operatorname{Normal}\big(np,\ \sqrt{np(1-p)}\big).

Show proof

This is a special case of the central limit theorem: X is itself a sum of n independent Bernoulli(p) trials, and a sum of enough independent, identically distributed pieces is approximately normal regardless of the pieces' own shape (a fact this course's own limit- theorems chapter develops in full generality). X's own mean np and variance np(1-p) carry over unchanged into the approximating normal distribution's parameters.

Definition

The continuity correction

also known as: P(X<=k) approx Phi((k+0.5-np)/sd)

When approximating a discrete \operatorname{Binomial}(n,p) probability with a continuous normal curve, the continuity correction shifts the boundary by half a unit to account for the discrete bar at k straddling [k-0.5, k+0.5] on the continuous scale: P(X\le k) \approx \Phi\!\left(\frac{k+0.5-np}{\sqrt{np(1-p)}}\right).

Show proof

A discrete bar at k occupies the WHOLE interval [k-0.5,k+0.5] once placed on a continuous axis, not just the single point k. Approximating P(X\le k) with the normal CDF evaluated exactly at k (no correction) cuts that bar in half, systematically excluding roughly P(X=k)/2 worth of area. Evaluating instead at k+0.5 includes the bar's ENTIRE width, which is why the correction consistently improves the approximation's accuracy, especially for small or moderate n.

Joint distributions

Definition

Joint probability mass function

also known as: p(x, y) = P(X=x, Y=y)

For two discrete random variables X and Y on the same sample space, the joint probability mass function is p(x,y) = P(X=x,\ Y=y). It satisfies p(x,y)\ge0 for every pair, and the sum over every pair equals 1: \sum_x\sum_y p(x,y) = 1.

Definition

Joint probability density function

also known as: f(x, y)

For two continuous random variables X and Y, the joint probability density function f(x,y) satisfies f(x,y)\ge0 everywhere, and \iint f(x,y)\,dx\,dy = 1 over the whole plane. A probability is recovered by integrating f over a two-dimensional region: P\big((X,Y)\in A\big) = \iint_A f(x,y)\,dx\,dy.

Formula

Marginal distribution

also known as: p_X(x); f_X(x)

The marginal distribution of X alone is recovered from a joint distribution by summing (discrete) or integrating (continuous) out the other variable: p_X(x) = \sum_y p(x,y), \qquad f_X(x) = \int f(x,y)\,dy.

Show proof

Every outcome with X=x falls into exactly one value of Y, so the events \{X=x, Y=y\} over every y partition the event \{X=x\} completely, with no overlap. Summing their disjoint probabilities recovers P(X=x) exactly, which is the definition of p_X(x). The continuous case replaces this partition-and-sum with the same argument carried out via an integral over y instead of a sum.

Formula

Conditional distribution

also known as: p(y | x) = p(x, y) / p_X(x)

The conditional distribution of Y given X=x is p_{Y\mid X}(y\mid x) = \frac{p(x,y)}{p_X(x)}, defined whenever p_X(x) > 0.

Show proof

This is exactly the conditional-probability formula P(B\mid A)=P(A\cap B)/P(A) applied to the events A=\{X=x\} and B=\{Y=y\}. Nothing new is required beyond that definition; a joint pmf is just an organized table of such events, one cell per (x,y) pair.

Definition

Conditional expectation

also known as: E(Y | X=x)

The conditional expectation of Y given X=x is the mean of Y's own conditional distribution: E(Y\mid X=x) = \sum_y y\cdot p_{Y\mid X}(y\mid x). It is an ordinary expected value, computed against the narrowed distribution p_{Y\mid X}(\cdot\mid x) rather than Y's own marginal distribution.

Formula

Independence of random variables

also known as: p(x, y) = p_X(x) p_Y(y) for every x, y

Random variables X and Y are independent exactly when their joint distribution factors into the product of their marginals, for every single pair: p(x,y) = p_X(x)\,p_Y(y) \quad \text{for every } x, y.

Show proof

This restates event-independence, P(A\cap B)=P(A)P(B), applied simultaneously to every event pair A=\{X=x\}, B=\{Y=y\}. A single pair failing to factor is enough to break independence entirely, which is why the definition demands the product rule hold for EVERY pair, not merely on average across them.

Formula

Covariance

also known as: Cov(X, Y) = E(XY) - E(X)E(Y)

The covariance of X and Y measures how they vary together: \operatorname{Cov}(X,Y) = E\big[(X-\mu_X)(Y-\mu_Y)\big] = E(XY)-\mu_X\mu_Y. Positive covariance means the two tend to sit above (or below) their own means together. Negative covariance means one runs high exactly when the other runs low.

Show proof

Expand the product inside the definition: E[(X-\mu_X)(Y-\mu_Y)] = E[XY - \mu_X Y - \mu_Y X + \mu_X\mu_Y]. Linearity splits this into four separate expectations. The middle two collapse to -\mu_X\mu_Y each, since E(Y)=\mu_Y and E(X)=\mu_X by definition, leaving E(XY) - \mu_X\mu_Y - \mu_Y\mu_X + \mu_X\mu_Y = E(XY) - \mu_X\mu_Y. That is the same computational shortcut the variance formula uses, generalized from one variable to two.

Formula

Correlation coefficient (random variables)

also known as: rho = Cov(X, Y) / (sigma_X sigma_Y)

The correlation coefficient rescales covariance into a unitless number always between -1 and 1. \rho_{X,Y} = \frac{\operatorname{Cov}(X,Y)}{\sigma_X\sigma_Y}. Dividing by both standard deviations removes the original units. So \rho measures only the STRENGTH and direction of the linear relationship, never the scale either variable happens to be measured in.

Transformations of random variables

Theorem

Linearity of Expectation

also known as: E[X+Y] = E[X] + E[Y]

For any two random variables X and Y defined on the same sample space, and any constants a, b, E(aX + bY) = a\,E(X) + b\,E(Y). This holds whether or not X and Y are independent.

Show proof

Let the sample space be S = \{s_1, s_2, \ldots, s_n\} with P(s_i) = p_i. By definition, a random variable's expected value is a sum taken directly over the sample space: E(aX+bY) = \sum_{i=1}^{n} \big(aX(s_i) + bY(s_i)\big)\,p_i. Distribute p_i across the sum inside each term, then split the single sum into two sums, since addition of finitely many numbers can always be regrouped this way: \sum_{i=1}^{n} \big(aX(s_i)p_i + bY(s_i)p_i\big) = a\sum_{i=1}^{n} X(s_i)p_i + b\sum_{i=1}^{n} Y(s_i)p_i. The two resulting sums are exactly E(X) and E(Y) by definition, so E(aX+bY) = a\,E(X) + b\,E(Y). Nowhere did this argument use P(X=x, Y=y) = P(X=x)P(Y=y) — the independence condition — which is exactly why the result holds regardless of whether X and Y are independent.

Formula

Variance Under a Linear Transformation

also known as: Var(aX + b) = a^2 Var(X)

For a random variable X and constants a, b, \operatorname{Var}(aX+b) = a^2\operatorname{Var}(X). Notably, shifting by b never changes the variance at all.

Show proof

Let \mu = E(X), so E(aX+b) = a\mu+b by linearity. Then \operatorname{Var}(aX+b) = E\big[(aX+b-(a\mu+b))^2\big] = E\big[(aX-a\mu)^2\big] = E\big[a^2(X-\mu)^2\big]. Linearity pulls the constant a^2 back out of the expectation: a^2 E\big[(X-\mu)^2\big] = a^2\operatorname{Var}(X). The shift b cancelled entirely inside the subtraction, which is exactly why adding a constant to every outcome moves the mean but never changes how spread out the outcomes are around it.

Formula

Z-score standardization

also known as: z = (x - mu) / sigma

For X\sim\operatorname{Normal}(\mu,\sigma), the z-score of a value x is z = \frac{x-\mu}{\sigma}. Z = (X-\mu)/\sigma is itself \operatorname{Normal}(0,1) -- the standard normal distribution -- and P(X\le x) = \Phi(z), where \Phi is the standard normal CDF.

Show proof

Standardizing is a linear transformation, Z=aX+b with a=1/\sigma, b=-\mu/\sigma. By the linear-transformation rules already established, E(Z) = E(X)/\sigma - \mu/\sigma = \mu/\sigma-\mu/\sigma=0 and \operatorname{Var}(Z) = \operatorname{Var}(X)/\sigma^2 = \sigma^2/\sigma^2=1 -- mean 0, variance 1, exactly the standard normal's own parameters. Every normal distribution reduces to the SAME standard normal after standardizing, which is exactly why one single \Phi table (or function) answers a probability question for any \mu,\sigma at all.

Formula

The CDF method for a transformed variable

also known as: F_Y(y) = P(g(X) <= y)

For Y=g(X), the CDF method finds Y's own distribution by working directly through X's CDF. F_Y(y) = P(g(X)\le y) = P\big(X \in g^{-1}((-\infty, y])\big). The right-hand event is rewritten purely in terms of X, then evaluated using whatever is already known about X's own distribution.

Show proof

Y\le y and g(X)\le y are literally the same event, since Y is defined to equal g(X). Rewriting \{g(X)\le y\} as a set of x-values (inverting g where it is monotonic, or unioning several such sets where it is not) turns a question about the new variable Y into a question already answerable from X's own CDF or pdf, with no new machinery required.

Theorem

Linearity of Expectation

also known as: E[X+Y] = E[X] + E[Y]

For any two random variables X and Y defined on the same sample space, and any constants a, b, E(aX + bY) = a\,E(X) + b\,E(Y). This holds whether or not X and Y are independent.

Show proof

Let the sample space be S = \{s_1, s_2, \ldots, s_n\} with P(s_i) = p_i. By definition, a random variable's expected value is a sum taken directly over the sample space: E(aX+bY) = \sum_{i=1}^{n} \big(aX(s_i) + bY(s_i)\big)\,p_i. Distribute p_i across the sum inside each term, then split the single sum into two sums, since addition of finitely many numbers can always be regrouped this way: \sum_{i=1}^{n} \big(aX(s_i)p_i + bY(s_i)p_i\big) = a\sum_{i=1}^{n} X(s_i)p_i + b\sum_{i=1}^{n} Y(s_i)p_i. The two resulting sums are exactly E(X) and E(Y) by definition, so E(aX+bY) = a\,E(X) + b\,E(Y). Nowhere did this argument use P(X=x, Y=y) = P(X=x)P(Y=y) — the independence condition — which is exactly why the result holds regardless of whether X and Y are independent.

Theorem

Variance of a Sum of Independent Random Variables

also known as: Var(X+Y) = Var(X) + Var(Y), for independent X, Y

If X and Y are independent random variables, then \operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y). Unlike linearity of expectation, this requires independence. It is not true for dependent variables in general.

Show proof

Let \mu_X = E(X), \mu_Y = E(Y). Expand the squared deviation of the sum: \operatorname{Var}(X+Y) = E\big[((X-\mu_X)+(Y-\mu_Y))^2\big] = E\big[(X-\mu_X)^2\big] + E\big[(Y-\mu_Y)^2\big] + 2E\big[(X-\mu_X)(Y-\mu_Y)\big]. The first two terms are \operatorname{Var}(X) and \operatorname{Var}(Y) directly. The cross term is the covariance of X and Y; independence makes E[(X-\mu_X)(Y-\mu_Y)] = E(X-\mu_X)\,E(Y-\mu_Y) = 0 \cdot 0 = 0 (the expectation of a product of independent quantities is the product of their expectations, and each factor's own expectation is zero by linearity). With the cross term gone, \operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) exactly. Without independence, that cross term need not vanish, which is why this result — unlike linearity of expectation — genuinely needs the hypothesis.

Limit theorems

Theorem

Chebyshev's Inequality

also known as: P(|X-mu| >= k*sigma) <= 1/k^2

For ANY random variable X with mean \mu and standard deviation \sigma, and any k>0, the bound below holds. P(|X-\mu|\ge k\sigma) \le \frac{1}{k^2}. No assumption about X's own shape is needed at all. The bound holds for every distribution with a finite variance, named or not.

Show proof

Let Y=(X-\mu)^2, a nonnegative random variable with E(Y)=\operatorname{Var}(X)=\sigma^2. Markov's inequality (a bound for any nonnegative random variable, P(Y\ge a)\le E(Y)/a) applied with a=k^2\sigma^2 gives P\big((X-\mu)^2\ge k^2\sigma^2\big) \le \frac{\sigma^2}{k^2\sigma^2} = \frac{1}{k^2}. The event (X-\mu)^2\ge k^2\sigma^2 is exactly the event |X-\mu|\ge k\sigma, so the bound transfers directly.

Theorem

The Weak Law of Large Numbers

also known as: WLLN

For independent, identically distributed X_1,\ldots,X_n with mean \mu, the sample average \bar X_n converges in probability to \mu as n\to\infty. For every \varepsilon>0, the probability below goes to zero. P\big(|\bar X_n-\mu|\ge\varepsilon\big) \to 0 \quad \text{as } n\to\infty. Averaging over more independent draws makes a large deviation from the true mean increasingly unlikely, though never strictly impossible at any finite n.

Show proof

\bar X_n has mean \mu and, since the X_i are independent, variance \sigma^2/n (chapter 10's own sum-of-independent-variables rule, applied n times). Applying Chebyshev's inequality to \bar X_n with k=\varepsilon\sqrt n/\sigma gives P\big(|\bar X_n-\mu|\ge\varepsilon\big) \le \frac{\sigma^2}{n\varepsilon^2}. The right side shrinks to 0 as n\to\infty, for any fixed \varepsilon>0, which is exactly the convergence the law claims.

Formula

Standard Error (of the sample mean)

also known as: SE

For samples of size n drawn from a population with standard deviation \sigma, the standard error of the mean is SE = \frac{\sigma}{\sqrt n}. It is the standard deviation of the sampling distribution of \bar x itself, not of any one individual observation. It measures how much a sample mean is expected to vary from sample to sample, a different question from how much individual data points vary within one sample. When \sigma is unknown, the sample standard deviation s substitutes directly: SE \approx s/\sqrt n.

Show proof

Each of the n observations in a sample is an independent draw with variance \sigma^2. The sample mean \bar x = \frac{1}{n}\sum x_i rescales that sum by 1/n, and variance scales by the square of a constant multiplier, so \operatorname{Var}(\bar x) = \operatorname{Var}\left(\frac{1}{n}\sum x_i\right) = \frac{1}{n^2}\sum \operatorname{Var}(x_i) = \frac{n\sigma^2}{n^2} = \frac{\sigma^2}{n}. Taking a square root gives the standard deviation of \bar x, which is exactly what "standard error" names: SE = \sigma/\sqrt n.

Theorem

The Central Limit Theorem

also known as: CLT

For independent, identically distributed X_1,\ldots,X_n with mean \mu and finite standard deviation \sigma, the standardized sample average Z_n = \frac{\bar X_n - \mu}{\sigma/\sqrt n} converges to the STANDARD NORMAL distribution as n\to\infty, regardless of the shape of the original population's own distribution. Equivalently, \bar X_n is approximately \operatorname{Normal}(\mu,\sigma/\sqrt n) for large n.

Show proof

A full proof needs moment generating functions or characteristic functions, beyond this course's own scope. The intuition: \bar X_n is itself a sum of n independent pieces (each X_i/n), and summing many independent pieces smooths out any one piece's own irregular shape -- the same mechanism this course's own sums-of-independent-variables material already builds toward, pushed to its limit as n grows without bound.

Sampling and the bridge to statistics

Formula

The Finite Population Correction

also known as: FPC

Sampling WITHOUT replacement from a finite population of size N shrinks the standard error of the mean by the finite population correction factor. SE = \frac{\sigma}{\sqrt n}\sqrt{\frac{N-n}{N-1}}. The correction factor is always at most 1, so without-replacement sampling never has MORE spread than with-replacement sampling from the same population. As N\to\infty (or whenever n is small relative to N), the factor approaches 1 and the correction becomes negligible.

Show proof

Sampling with replacement draws n genuinely independent observations, giving \operatorname{Var}(\bar X)=\sigma^2/n directly. Sampling without replacement introduces a small NEGATIVE covariance between any two draws (choosing one unit makes every other unit slightly more likely among the remaining ones), which shrinks the sum's own variance below the independent case by exactly the factor (N-n)/(N-1) -- a standard finite-population covariance calculation. Taking a square root carries that same factor, as a square root, into the standard error.

Formula

The Sampling Distribution of a Proportion

also known as: p-hat ~ approx Normal(p, sqrt(p(1-p)/n))

A sample proportion \hat p is itself a sample MEAN, of n independent 0/1 indicators each with mean p and variance p(1-p). The central limit theorem applies directly: \hat p \approx \operatorname{Normal}\left(p,\ \sqrt{\frac{p(1-p)}{n}}\right) for large enough n (a common rule of thumb requires np\ge10 and n(1-p)\ge10, the same threshold this course's own normal-approximation material already uses).

Show proof

Let X_i=1 if the i-th draw has the property of interest, X_i=0 otherwise. Each X_i is Bernoulli(p), with mean p and variance p(1-p). The sample proportion \hat p=\frac{1}{n}\sum X_i is exactly the sample MEAN of these n indicators, so every result already established for the sampling distribution of a mean -- its own mean p, its own standard error \sqrt{p(1-p)/n}, and its own approximate normality for large n -- transfers directly, with no new machinery required.

Theorem

The Central Limit Theorem

also known as: CLT

For independent, identically distributed X_1,\ldots,X_n with mean \mu and finite standard deviation \sigma, the standardized sample average Z_n = \frac{\bar X_n - \mu}{\sigma/\sqrt n} converges to the STANDARD NORMAL distribution as n\to\infty, regardless of the shape of the original population's own distribution. Equivalently, \bar X_n is approximately \operatorname{Normal}(\mu,\sigma/\sqrt n) for large n.

Show proof

A full proof needs moment generating functions or characteristic functions, beyond this course's own scope. The intuition: \bar X_n is itself a sum of n independent pieces (each X_i/n), and summing many independent pieces smooths out any one piece's own irregular shape -- the same mechanism this course's own sums-of-independent-variables material already builds toward, pushed to its limit as n grows without bound.

Probability in the wild

For events A and B with P(B) \neq 0, P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}.

Show proof

The Conditional Probability formula, applied to P(A\mid B) and to P(B\mid A) separately, gives two ways to write the same joint probability: P(A\text{ and }B) = P(A\mid B)\,P(B), \qquad P(A\text{ and }B) = P(B\mid A)\,P(A). Both right-hand sides equal the same quantity, so they equal each other: P(A\mid B)\,P(B) = P(B\mid A)\,P(A). Dividing both sides by P(B) (nonzero by hypothesis) isolates P(A\mid B): P(A\mid B) = \frac{P(B\mid A)\,P(A)}{P(B)}.

Formula

The Birthday Problem

also known as: P(collision) for n people, 365 equally likely birthdays

For n people with independent, uniformly distributed birthdays among 365 days, the probability at least two share a birthday is P(\text{collision}) = 1 - \prod_{i=0}^{n-1}\frac{365-i}{365}. Notably, P(\text{collision}) > 0.5 once n=23, far smaller than most people's own intuition expects.

Show proof

It is easier to compute the COMPLEMENT, no collision at all. The first person's birthday can be anything (365/365). The second must avoid the first's day (364/365). The third must avoid both earlier days (363/365), and so on, down to the n-th person avoiding n-1 already-taken days ((365-n+1)/365). Multiplying these n independent fractions gives the no-collision probability; subtracting from 1 gives the stated formula.

Formula

Gambler's Ruin

also known as: P(reach N before 0), starting from i

A gambler starts with i dollars, wins \$1 with probability p and loses \$1 with probability q=1-p each round, and stops at \$0 (ruin) or \$N (the target). The probability of reaching N before 0 is P_i = \begin{cases} \dfrac{i}{N} & p = 0.5 \\[4pt] \dfrac{1-(q/p)^i}{1-(q/p)^N} & p \ne 0.5 \end{cases}.

Show proof

Conditioning on the first round's outcome gives a recurrence, P_i = p\,P_{i+1} + q\,P_{i-1}, with boundary conditions P_0=0 and P_N=1. For p=0.5 this recurrence forces P_i to be linear in i, giving P_i=i/N directly from the boundary conditions. For p\ne0.5, solving the same recurrence (a standard linear difference equation) produces the ratio-of-powers form stated above, which reduces to the p=0.5 case as a limit when q/p \to 1.

Formula

Gambler's Ruin

also known as: P(reach N before 0), starting from i

A gambler starts with i dollars, wins \$1 with probability p and loses \$1 with probability q=1-p each round, and stops at \$0 (ruin) or \$N (the target). The probability of reaching N before 0 is P_i = \begin{cases} \dfrac{i}{N} & p = 0.5 \\[4pt] \dfrac{1-(q/p)^i}{1-(q/p)^N} & p \ne 0.5 \end{cases}.

Show proof

Conditioning on the first round's outcome gives a recurrence, P_i = p\,P_{i+1} + q\,P_{i-1}, with boundary conditions P_0=0 and P_N=1. For p=0.5 this recurrence forces P_i to be linear in i, giving P_i=i/N directly from the boundary conditions. For p\ne0.5, solving the same recurrence (a standard linear difference equation) produces the ratio-of-powers form stated above, which reduces to the p=0.5 case as a limit when q/p \to 1.

Formula

System Reliability (Series, Parallel, k-of-n)

also known as: R(system) from component reliabilities

For n independent components each working with probability p (reliability p), the whole system's reliability depends on how the components are wired.

Series (every component must work): R_{\text{series}} = p^n.

Parallel (at least one component must work): R_{\text{parallel}} = 1-(1-p)^n.

k-of-n (at least k of the n components must work): R_{k\text{-of-}n} = \sum_{j=k}^{n}\binom{n}{j}p^j(1-p)^{n-j}.

Show proof

Series: the system is up only if EVERY component is up, and independence lets the individual probabilities multiply directly, p\cdot p\cdots p = p^n. Parallel: the system is down only if EVERY component is down, an event with probability (1-p)^n by the same independence argument, so the system is up with the complementary probability. k-of-n generalizes both: the number of working components is Binomial(n,p), and the system is up exactly when that count is at least k, which is the binomial tail sum shown. Setting k=n recovers series, and k=1 recovers parallel.

Formula

The M/M/1 Queue

also known as: Utilization, mean number in system, mean wait

A single-server queue has Poisson arrivals at rate \lambda and independent exponential service times at rate \mu (an M/M/1 queue). It is stable only when the utilization is below 1.

\rho = \frac{\lambda}{\mu} < 1.

When stable, the long-run average number of customers in the system is L, and the average time a customer waits, including service, is W.

L = \frac{\rho}{1-\rho}, \qquad W = \frac{1}{\mu-\lambda}.
Show proof

\rho is the fraction of time the server is busy, arrivals must be served at least as fast as they show up on average, so \rho\ge1 makes the queue grow without bound. Modeling the number in the system as a birth-death Markov chain with constant birth rate \lambda and death rate \mu gives a geometric stationary distribution with ratio \rho, whose mean is L=\rho/(1-\rho). Little's law, L=\lambda W, then gives W = L/\lambda = 1/(\mu-\lambda) directly.

For events A and B with P(B) \neq 0, P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}.

Show proof

The Conditional Probability formula, applied to P(A\mid B) and to P(B\mid A) separately, gives two ways to write the same joint probability: P(A\text{ and }B) = P(A\mid B)\,P(B), \qquad P(A\text{ and }B) = P(B\mid A)\,P(A). Both right-hand sides equal the same quantity, so they equal each other: P(A\mid B)\,P(B) = P(B\mid A)\,P(A). Dividing both sides by P(B) (nonzero by hypothesis) isolates P(A\mid B): P(A\mid B) = \frac{P(B\mid A)\,P(A)}{P(B)}.

Formula

The Sampling Distribution of a Proportion

also known as: p-hat ~ approx Normal(p, sqrt(p(1-p)/n))

A sample proportion \hat p is itself a sample MEAN, of n independent 0/1 indicators each with mean p and variance p(1-p). The central limit theorem applies directly: \hat p \approx \operatorname{Normal}\left(p,\ \sqrt{\frac{p(1-p)}{n}}\right) for large enough n (a common rule of thumb requires np\ge10 and n(1-p)\ge10, the same threshold this course's own normal-approximation material already uses).

Show proof

Let X_i=1 if the i-th draw has the property of interest, X_i=0 otherwise. Each X_i is Bernoulli(p), with mean p and variance p(1-p). The sample proportion \hat p=\frac{1}{n}\sum X_i is exactly the sample MEAN of these n indicators, so every result already established for the sampling distribution of a mean -- its own mean p, its own standard error \sqrt{p(1-p)/n}, and its own approximate normality for large n -- transfers directly, with no new machinery required.

Theorem

The Weak Law of Large Numbers

also known as: WLLN

For independent, identically distributed X_1,\ldots,X_n with mean \mu, the sample average \bar X_n converges in probability to \mu as n\to\infty. For every \varepsilon>0, the probability below goes to zero. P\big(|\bar X_n-\mu|\ge\varepsilon\big) \to 0 \quad \text{as } n\to\infty. Averaging over more independent draws makes a large deviation from the true mean increasingly unlikely, though never strictly impossible at any finite n.

Show proof

\bar X_n has mean \mu and, since the X_i are independent, variance \sigma^2/n (chapter 10's own sum-of-independent-variables rule, applied n times). Applying Chebyshev's inequality to \bar X_n with k=\varepsilon\sqrt n/\sigma gives P\big(|\bar X_n-\mu|\ge\varepsilon\big) \le \frac{\sigma^2}{n\varepsilon^2}. The right side shrinks to 0 as n\to\infty, for any fixed \varepsilon>0, which is exactly the convergence the law claims.

Graph settings

Calculator