📊 Data Science & Statistics · Undergraduate · STAT 310

Probability Theory

A calculus-based first course in probability with 19 lessons in six modules. Begin with event algebra, counting, conditional probability and independence. Develop random variables, expectation, variance and common distributions, then connect joint models to covariance, conditional expectation, transformations, convolution and generating functions. Distinguish exact probabilities, inequality bounds…

Start the interactive course (quizzes, progress, videos) →

Free forever. No sign-up, no ads. 19 lessons. The full lesson text is below so you can read it right here.

Module 1: Foundations of Probability

Sample spaces, events, the axioms that govern probability, and the counting tools that make outcomes computable.

Sample Spaces and Events

  • Write the sample space of a random experiment.
  • Express events as subsets of the sample space and combine them with union, intersection, and complement.
  • Identify mutually exclusive events and use a Venn diagram to picture set relationships.

Record two coin flips as HH, HT, TH or TT. These four ordered outcomes describe both flips. If you care only about the number of heads, you could instead record 0, 1 or 2. Either description can support a probability model, but the probabilities must match the description. This lesson develops the sample spaces and event operations that make such choices explicit.

The big picture

You already reason about "what could happen" all the time. When you wonder whether it will rain, you are weighing two outcomes, rain and no rain. When you roll a die in a board game, you know the result will be one of six numbers, no more and no fewer. Probability theory takes that everyday habit and makes it exact.

Think of the sample space as the menu of a restaurant. Before anyone can talk about the chance of ordering soup, the full menu has to be on the table. The menu does not say what anyone will order; it says what the options are. Numbers come in the next lesson, when we attach probabilities to the menu. Today we build menus, and we learn the set language, union, intersection, and complement, that groups menu items into events.

Key idea: every probability problem begins with the same move. List what can happen, then describe what you care about as a subset of that list.

The sample space

The sample space, written S (some books use the Greek letter Omega), is the set of all possible outcomes of the experiment. Read that aloud as "S is the set of everything that could happen." Each individual outcome is called a sample point. A few examples: [1]

  • One coin flip: S = {H, T}, two outcomes, heads or tails.
  • One roll of a six-sided die: S = {1, 2, 3, 4, 5, 6}, six outcomes.
  • Two coin flips: S = {HH, HT, TH, TT}, four outcomes.

In the ordered two-flip model, HT records heads followed by tails, while TH records the reverse. These are different outcomes of that model. A coarser model could record only the number of heads, combining both into the outcome 1. That coarser model cannot answer a question about which flip was heads. Match the recorded information to the question.

The same idea scales up. Roll two dice, one red and one blue. One outcome is the ordered pair (3, 5), meaning red shows 3 and blue shows 5. The red die has 6 faces, and for each of those the blue die has 6 faces, so the sample space holds 6 × 6 = 36 ordered pairs, from (1, 1) up to (6, 6). We will meet this 36-outcome space again and again, so it is worth picturing it as a 6 by 6 grid.

A sample space may be finite, countably infinite, or uncountable. The positive integers form a countably infinite set; a real interval is uncountable. For repeated coin flips until the first head, a careful model includes the possibility that no head ever occurs. Under independent flips with head probability p greater than 0, that never-head event has probability 0, but it is not the empty set. In introductory waiting-time calculations the geometric distribution describes the finite waiting times and assigns probability 1 to their union.

Try it. Flip a coin, then roll a die. Write the sample space. Work it out before reading on.

Worked answer. Each outcome must record both results in order: the flip, then the roll. Pair each of the 2 flip results with each of the 6 roll results: S = {H1, H2, H3, H4, H5, H6, T1, T2, T3, T4, T5, T6}. That is 2 × 6 = 12 outcomes. What we just did: we listed one complete record per outcome, and we counted by pairing stages rather than by writing outcomes at random.

Key idea: an outcome is one complete story of the experiment. If the experiment has stages, the outcome must name the result of every stage, in order.

Four ordered outcomes of two independent fair flips have probability 1/4 each. Coarsening to the head count produces masses 1/4,1/2,1/4 because count 1 combines HT and TH.
Four ordered outcomes of two independent fair flips have probability 1/4 each. Coarsening to the head count produces masses 1/4,1/2,1/4 because count 1 combines HT and TH.

Events as subsets

For a finite or countable sample space we can take every subset as an event. In a general probability model, events are the members of a specified collection called a sigma-algebra: it contains S and is closed under complements and countable unions. This distinction matters on uncountable spaces, where not every subset must be assigned a probability. For the die examples, every subset is an event. The event A={2,4,6} occurs exactly when the observed face belongs to A. [2]

An event with a single outcome, like {5}, is a simple event; an event with several outcomes is a compound event. Two extreme cases are allowed and useful. The whole space S is the certain event, since whatever happens is somewhere in S. The empty set, written with empty braces, is the impossible event, since it has no members for the outcome to match.

Most of the work in a probability problem is translating English into a subset. The phrase picks out members; you list them. On one die roll:

  • "At least 5" means 5 or more: the event {5, 6}.
  • "At most 2" means 2 or fewer: the event {1, 2}.
  • "More than 4" means strictly above 4: the event {5, 6} again, since a die cannot show 4.5.

On the 36-outcome two-dice space, the event "the sum is 7" collects every ordered pair whose entries add to 7: {(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)}, six members. Notice that (3, 4) and (4, 3) both appear, because red-3-with-blue-4 and red-4-with-blue-3 are different outcomes that happen to share a sum.

Key idea: an event is a membership list. To decide whether it occurred, check whether the actual outcome is on the list, nothing more.

Combining events

Because events are sets, we combine them with set operations, and each operation matches an everyday word: [1]

  • The union "A or B" (A union B) contains every outcome in A, in B, or in both. The mathematical "or" is inclusive: both counts.
  • The intersection "A and B" (A intersect B) contains only outcomes in both A and B.
  • The complement "not A" (written A with a bar, or A-complement) contains every outcome in S that is not in A.

A reliable way to build any of these is a one-outcome-at-a-time membership check. Take the die with A = {2, 4, 6} (even) and B = {1, 2, 3} (small). To form "A or B," walk through S asking each number "are you in A, or in B, or both?" The yes answers are 1, 2, 3, 4, 6, so A or B = {1, 2, 3, 4, 6}. To form "A and B," ask "are you in both?" Only 2 says yes, so A and B = {2}. And not A = {1, 3, 5}, the leftovers of S once A is removed.

Two events are mutually exclusive (or disjoint) if they share no outcomes, so their intersection is empty and they cannot both happen at once. For the die, A = {2, 4, 6} and B = {1, 3, 5} are mutually exclusive: no number is both even and odd.

One more pattern is worth meeting early because it saves effort later. The complement of a union obeys De Morgan's law: "not (A or B)" is the same event as "(not A) and (not B)." In words, the outcome avoids both A and B exactly when it misses A and also misses B. Check it concretely with A even and B small: A or B = {1, 2, 3, 4, 6}, so not (A or B) = {5}. Meanwhile not A = {1, 3, 5} and not B = {4, 5, 6}, whose intersection is also {5}. The two routes agree, and they always do.

Key idea: or means union, and means intersection, not means complement. When a compound event looks tangled, run a membership check outcome by outcome.

For die faces 1 through 6, A={2,4,6} and C={5,6}. The overlap is {6}, the union is {2,4,5,6}, and {1,3} lies outside both. Circle areas are schematic, not probabilities.
For die faces 1 through 6, A={2,4,6} and C={5,6}. The overlap is {6}, the union is {2,4,5,6}, and {1,3} lies outside both. Circle areas are schematic, not probabilities.

Worked example

Roll one die. Let A = {2, 4, 6} (even) and C = {5, 6} (greater than 4). We will build three events, one step at a time. [3]

  • Step 1, the union. Collect every number in A or in C, listing each member once: A or C = {2, 4, 5, 6}. The outcome 6 is in both sets, but it appears once, because a set lists members, not votes.
  • Step 2, the intersection. Keep only numbers in both: 2 and 4 are even but not above 4, and 5 is above 4 but odd, so A and C = {6}.
  • Step 3, the complement of A. Remove A's members from S: not A = {1, 3, 5}.

What we just did: we treated each event as a member list and combined lists with or, and, not. A Venn diagram makes these overlaps easy to see.

In a Venn diagram, the rectangle represents S, circles represent events, and their overlap represents the intersection. The union includes either circle, and the complement of A includes every point in the rectangle outside A. The diagram describes membership. Its drawn areas are not automatically probabilities.

Here is the same skill on a richer experiment. Draw one card from a standard 52-card deck, so S has 52 outcomes. Let H be "the card is a heart" (13 members) and F be "the card is a face card," meaning jack, queen, or king (12 members, three per suit).

  • The intersection "H and F" holds the face cards that are hearts: {jack of hearts, queen of hearts, king of hearts}, 3 members.
  • The union "H or F" holds every heart plus the face cards from the other three suits. Counting without double-listing: 13 + 12 - 3 = 22 members. We subtracted 3 because those three cards would otherwise be listed twice, once as hearts and once as face cards.
  • The complement "not H" holds the 52 - 13 = 39 cards that are clubs, diamonds, or spades.

What we just did: the count 13 + 12 - 3 is our first taste of the inclusion-exclusion idea, which returns in the next lesson as the addition rule for probabilities. The set work you do here becomes arithmetic there.

Try it

Flip a coin twice, so S = {HH, HT, TH, TT}. Let A be "the first flip is heads" and B be "at least one tail." Write A and B as subsets, then find "A and B" and "not B." Work it out before reading the answer.

Worked answer. Step 1: A collects outcomes whose first letter is H, so A = {HH, HT}. Step 2: B collects outcomes containing at least one T, so B = {HT, TH, TT}; only HH misses the list. Step 3: the intersection keeps outcomes on both lists, so A and B = {HT}. Step 4: the complement of B is everything else in S, so not B = {HH}. Notice that "not (at least one tail)" came out as "no tails at all," which is exactly what "zero tails" means: HH.

Where people get stuck

A common mistake is to give the three head counts 0, 1 and 2 equal probability. For two independent fair flips, their probabilities are 1/4, 1/2 and 1/4. The count 1 collects HT and TH, while the counts 0 and 2 each collect one ordered outcome. The count-based sample space is valid; the equal-probability assumption is what fails. [4]

For two independent fair dice, either the 36 ordered pairs or the 11 sums can define a valid sample space. The pairs have probability 1/36 each, while the sums have unequal probabilities. The sum space is useful when the question concerns only the total. Choose a representation that records what the question needs, then assign the correct weights; equal detail does not itself prove equal probability.

Third, complements of "at least" statements. The complement of "at least one head" in two flips is not "at least one tail." Run the membership check: "at least one head" is {HH, HT, TH}, so its complement is {TT}, the event "no heads." The opposite of "one or more" is "zero," a fact that will power many fast calculations in later lessons.

Common misconceptions

  • "An event is one outcome." An event is any subset: it may hold one outcome, several, all of them, or none. Both extremes, S and the empty set, are genuine events.
  • "Mutually exclusive means unrelated." It means the events cannot both happen; their member lists share nothing. Whether two events are "unrelated" in the informational sense is a different idea, independence, which gets its own lesson.
  • "The complement is the opposite extreme." The complement of "rolling a 6" is not "rolling a 1"; it is {1, 2, 3, 4, 5}, everything other than 6. Complement means "everything else," not "the reverse."
  • "HT and TH are the same thing." They describe different histories. Sets ignore repetition, but outcomes must record order when the experiment has ordered stages.

Recap

  • A random experiment is described by its sample space S, the set of all possible complete outcomes.
  • Sample spaces can be finite, countably infinite, or uncountable.
  • An event is an allowed subset of S; it occurs when the outcome belongs to it. All subsets may be used in the finite examples.
  • Or, and, not translate to union, intersection, complement; De Morgan's law links them.
  • Mutually exclusive events have empty intersection and cannot happen together.
  • Choose a sample space that supports the question, and justify its probability assignments separately.

Every probability question begins here: name the experiment, write the sample space, and translate the words of the problem into events built with union, intersection, and complement. Getting this translation right is half the battle in the rest of the course.

Retrieve, explain, and revisit

Close the worked examples before answering: How can a valid three-value head-count space come from four equally likely flip sequences?

Check the reasoning

Count 1 combines HT and TH, so its probability is twice that of 0 or 2.

Return after a day, then again after about a week: Use A={2,4,6} and B={4,5,6}. List the complement of A union B. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

The union is {2,4,5,6}; its complement in {1,2,3,4,5,6} is {1,3}.

Sources

  1. Orloff and Bloom, MIT 18.05 (2022), Class 2: Probability. Cited passages: pp. 1-2; pp. 2-3.
  2. Scott Sheffield, MIT 18.175 (2014), Lecture 1: Probability spaces. Cited passages: pp. 4-8.
  3. Orloff and Bloom, MIT 18.05 (2022), Class 1: Counting. Cited passages: pp. 3-5.
  4. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 4: finite equally likely models.
Key terms
Sample space
The set S of all possible outcomes of a random experiment.
Sample point
A single individual outcome in the sample space.
Event
A member of the specified collection of measurable subsets of the sample space. In the finite examples all subsets are allowed.
Union
The event 'A or B', containing outcomes in A, in B, or in both.
Intersection
The event 'A and B', containing only outcomes in both A and B.
Mutually exclusive
Two events that share no outcomes and cannot both occur.

The Axioms of Probability

  • State the three axioms of probability.
  • Derive the complement rule and the general addition rule from the axioms.
  • Compute probabilities for equally likely outcomes.

Suppose a die model assigns probability 1/6 to each of six faces. The probabilities are nonnegative and total 1. If an event contains three faces, it has probability 3/6. The axioms of probability generalize these consistency requirements. They constrain the assignments a model can make, but they do not establish that a physical die is fair or that any named distribution fits observations.

The big picture

A probability lies between 0 and 1. The empty event has probability 0 and the whole space has probability 1. The converses require care: a nonempty event can have probability 0, and a proper subset can have probability 1. For example, a uniform draw on [0,1] has probability 0 of being exactly 1/2. Probability 1 is called almost sure; it need not mean that the event contains every possible outcome. [1]

Here is an analogy that makes the axioms feel natural. Imagine you have exactly 1 kilogram of sand, and you spread all of it over the sample space, giving each outcome its share. The probability of an event is the total weight of sand sitting on that event's outcomes. Three facts about sand are then automatic: no pile weighs less than zero, the whole space carries the full 1 kilogram, and the weight on two regions that do not overlap is the sum of their separate weights. Those three facts, translated into symbols, are exactly the axioms.

If independent repetitions have the same probability p of an event, the law of large numbers makes their relative frequency converge to p in probability. That statement is a theorem under specified assumptions, not the definition of probability and not a promise that a finite sequence must look balanced. Dependence or changing probabilities can invalidate this simple conclusion.

Key idea: probability behaves like weight. Each event carries an amount between 0 and 1, the whole space carries exactly 1, and non-overlapping events combine by addition.

A two-point space with P(a)=1 and P(b)=0 satisfies the probability axioms. The event {b} is nonempty and null, while {a} has probability one without being the whole space.
A two-point space with P(a)=1 and P(b)=0 satisfies the probability axioms. The event {b} is nonempty and null, while {a} has probability one without being the whole space.

The three axioms

  1. Nonnegativity: for every event A, P(A) is greater than or equal to 0. Probabilities are never negative. There is no such thing as a chance below zero, in the same way a pile of sand cannot have negative weight.
  2. Normalization: the whole sample space has probability P(S) = 1. Something in S is certain to happen: when you roll the die, some face comes up. All the sand is on the table.
  3. Countable additivity: for a finite or countably infinite collection of pairwise disjoint events A1, A2,..., the probability of their union is the sum of their probabilities. The two-event rule P(A or B)=P(A)+P(B) is a special case. The axiom does not say to sum over an arbitrary uncountable family.

Read axiom 3 aloud slowly, because it carries a condition that is easy to miss: "if A and B cannot both happen, then the probability that one of them happens is the sum of their probabilities." The condition is the mutually exclusive part. When events overlap, plain addition counts the overlap twice, and we will need a corrected rule. That corrected rule is coming two paragraphs down, and it is one of the most used formulas in the course. [1]

Notice what the axioms do not say. They never tell you that a die is fair or that heads has probability 1/2. Those are modeling choices you supply based on symmetry or data. The axioms are the accounting rules that any honest assignment of probabilities must respect, the way bookkeeping rules constrain a ledger without telling you the prices.

Key idea: the axioms are the constitution of probability. They do not hand you numbers; they guarantee that whatever numbers you assign fit together consistently.

Consequences of the axioms

From these three rules alone, several everyday facts can be proven. Here is the list, then the reasoning behind the two most useful entries. [2]

  • The impossible event: P(empty set) = 0.
  • Bounds: every probability satisfies 0 is less than or equal to P(A) is less than or equal to 1.
  • The complement rule: since A and "not A" are disjoint and together fill S, we get P(A) + P(not A) = 1, so P(not A) = 1 - P(A).
  • The general addition rule: for any two events, disjoint or not, P(A or B) = P(A) + P(B) - P(A and B). We subtract the overlap so it is not counted twice.

Where does the complement rule come from? Walk through it in small steps.

  • Step 1. A and "not A" are mutually exclusive: no outcome is both in A and outside A. (Definition of complement.)
  • Step 2. Together they cover all of S: every outcome is either in A or not. (Definition again.)
  • Step 3. By axiom 3, P(A or not A) = P(A) + P(not A). (The two pieces are disjoint.)
  • Step 4. But "A or not A" is S itself, and axiom 2 says P(S) = 1. So P(A) + P(not A) = 1.
  • Step 5. Subtract P(A) from both sides: P(not A) = 1 - P(A).

What we just did: we split the certain event into two non-overlapping pieces and let additivity do the arithmetic. Every derivation in this lesson has that same shape: cut an event into disjoint pieces, add the pieces.

Now the general addition rule, with numbers before symbols. Roll one die, and let A = {2, 4, 6} and C = {5, 6}. Adding the raw sizes counts 3 + 2 = 5 outcomes, but the union {2, 4, 5, 6} has only 4 members, because the outcome 6 sits in both events and got counted twice. Subtracting the overlap once repairs the count: 3 + 2 - 1 = 4.

Probabilities inherit the same repair: P(A or C) = 3/6 + 2/6 - 1/6 = 4/6. In general, P(A or B) = P(A) + P(B) - P(A and B), and when A and B are disjoint the overlap term is 0, which hands back axiom 3.

Key idea: the complement rule and the addition rule are not extra laws to memorize separately. They are the axioms, rearranged.

The table counts 3 spade face cards,9 other face cards,10 spade non-face cards and 30 other cards. The union has 22 cards, giving 11/26 under uniform selection.
The table counts 3 spade face cards,9 other face cards,10 spade non-face cards and 30 other cards. The union has 22 cards, giving 11/26 under uniform selection.

Equally likely outcomes

When a finite sample space has N equally likely outcomes, total probability 1 is divided equally among them. Each outcome has mass 1/N, so the probability of an event is its number of outcomes divided by N. [2]

P(A) = (number of outcomes in A) / (total number of outcomes) = |A| / N.

Read that aloud: "the probability of A is the count of outcomes in A divided by the count of all outcomes." This formula is why the set work of the last lesson matters: once events are member lists, probability is counting.

Worked example. Draw one card from a standard 52-card deck, so N = 52 and each card has probability 1/52. The event "a heart" has 13 outcomes, so P(heart) = 13/52 = 1/4 = 0.25. The event "a king" has 4 outcomes, so P(king) = 4/52 = 1/13, about 0.077.

Using the addition rule. Find P(king or heart). Step 1: P(king) = 4/52. Step 2: P(heart) = 13/52. Step 3: the overlap is the single king of hearts, so P(king and heart) = 1/52. Step 4: assemble the rule:

P(king or heart) = 4/52 + 13/52 - 1/52 = 16/52 = 4/13, about 0.31.

What we just did: we counted each pile, spotted the double-counted card, and removed it once. If you instead listed the union directly, you would find 16 cards, the 13 hearts plus the kings of spades, clubs, and diamonds, and 16/52 again. Two routes, one answer, which is a good habit of self-checking.

Using the complement rule. The probability of "not a heart" is 1 - 13/52 = 39/52 = 3/4. The complement rule is the fastest route whenever a problem contains the words "at least one." To see it on familiar ground, flip two independent fair coins and ask for P(at least one head). The complement of "at least one head" is "no heads," which is the single outcome TT with probability 1/4. So P(at least one head) = 1 - 1/4 = 3/4. Compare that with listing {HH, HT, TH} and adding 3/4 directly: same answer, but the complement route stays quick even when "at least one" ranges over many trials.

One more equally-likely example, using two independent fair dice and their 36-outcome space from the last lesson. The event "the sum is 7" has the six members (1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1), so P(sum is 7) = 6/36 = 1/6. The event "the sum is 12" has the single member (6, 6), so its probability is 1/36. The sums are not equally likely, and that is fine: the underlying 36 ordered pairs are, and all probabilities flow from counting them.

Try it

Roll two independent fair dice. Find P(the sum is at least 10). Work it out with the 36-outcome space before reading on.

Worked answer. Step 1: "at least 10" means a sum of 10, 11, or 12. Step 2: list members by sum. Sum 10: (4, 6), (5, 5), (6, 4), three outcomes. Sum 11: (5, 6), (6, 5), two outcomes. Sum 12: (6, 6), one outcome. Step 3: the three sub-events are disjoint (a roll has only one sum), so additivity applies: 3 + 2 + 1 = 6 favorable outcomes. Step 4: divide by the total: P(sum at least 10) = 6/36 = 1/6, about 0.167. What we just did: translate words to outcomes, cut into disjoint pieces, count, add, divide.

Where people get stuck

If P(A)+P(B) exceeds 1, A and B must overlap with positive probability in a valid model. A sum below 1 does not prove disjointness. For a union, always use P(A or B)=P(A)+P(B)-P(A and B), or establish that the intersection has probability 0 before dropping the final term. [3]

A second stumble is applying the equally-likely formula to outcomes that are not equally likely. The two-dice sums 2 through 12 give 11 outcomes, but P(sum is 7) is not 1/11; it is 6/36. The formula |A| / N is only licensed when every outcome carries the same weight, which is why choosing the right sample space in lesson 1 was worth the care.

Third, sign slips with the complement rule. P(not A) = 1 - P(A) requires that "not A" be the full complement, everything else in S. The complement of "at least one head" is "no heads," not "at least one tail." If your complement and your event do not together cover S exactly once, step 2 of the derivation breaks and the rule does not apply.

A probability-zero event need not be empty, even in a finite model. On S={a, b}, assigning P({a})=1 and P({b})=0 obeys the axioms. The converse holds in a finite model only if every singleton has strictly positive probability. In a continuous uniform model, every singleton has probability 0 while the whole interval has probability 1. Countable additivity does not permit replacing the interval probability with an uncountable sum of singleton probabilities.

Common misconceptions

  • "Either it happens or it does not, so the probability is 50-50." Two outcomes need not be equally likely. A lottery ticket wins or loses, but P(win) is nowhere near 0.5. Equal probabilities must be earned by symmetry or evidence, not assumed from a two-item list.
  • "The axioms determine every probability." They only enforce consistency. Fairness of a die is a modeling assumption; the axioms then convert that assumption into the value 1/6 per face.
  • "Probabilities near 0 mean the event will not happen." Rare events happen constantly, because there are so many of them. A specific bridge hand is astronomically unlikely, yet every deal produces one.
  • "Addition works for any two events." Plain addition is only for mutually exclusive events. Overlapping events need the subtraction term P(A and B).

Recap

  • A probability measure is nonnegative, assigns 1 to S, and is countably additive on pairwise disjoint events.
  • The complement rule is P(A complement)=1-P(A).
  • The two-event union rule subtracts the intersection once: P(A union B)=P(A)+P(B)-P(A intersection B).
  • For a finite space of N equally likely outcomes, P(A)=|A|/N. Equal weighting is a model assumption.
  • An event can have probability zero without being empty, or probability one without being all of S.

Retrieve, explain, and revisit

Close the worked examples before answering: Does P(A)=0 imply A is the empty set? Give a finite counterexample.

Check the reasoning

No. On {a, b}, assign masses 1 and 0. Event {b} is nonempty with probability zero.

Return after a day, then again after about a week: If P(A)=0.6, P(B)=0.5 and P(A and B)=0.3, compute the union and the neither event. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

The union has probability 0.8 and its complement, neither, has probability 0.2.

Sources

  1. Scott Sheffield, MIT 18.175 (2014), Lecture 1: Probability spaces. Cited passages: pp. 4-5; p. 4.
  2. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: pp. 3-4; p. 4.
  3. Orloff and Bloom, MIT 18.05 (2022), Class 2: Probability. Cited passages: pp. 4-6.
Key terms
Probability
A number P(A) from 0 to 1 measuring how likely event A is.
Axioms of probability
Nonnegativity, normalization, and countable additivity for pairwise disjoint events.
Normalization
The axiom that the whole sample space has probability 1.
Complement rule
P(not A) = 1 - P(A), since A and not A partition S.
General addition rule
P(A or B) = P(A) + P(B) - P(A and B) for any two events.
Equally likely
In a finite space of N outcomes, an assignment of probability 1/N to each outcome.

Counting: Multiplication, Permutations, and Combinations

  • Apply the multiplication principle to count outcomes of multi-step experiments.
  • Compute permutations when order matters and combinations when it does not.
  • Use counts to find probabilities for equally likely outcomes.

When outcomes are equally likely, a probability is a ratio of two counts: favorable outcomes over total outcomes. So we need efficient ways to count outcomes without listing them all, because listing breaks down fast. Nobody wants to write out the 2,598,960 possible poker hands. The mathematics of counting is called combinatorics, and this lesson builds its three essential tools.

The big picture

Every counting method in this lesson is a shortcut for a list you could, in principle, write out by hand. That is a comforting way to hold the subject: if a formula ever feels doubtful, shrink the problem until the list is small, write the list, and watch the formula agree with it. We will do exactly that several times.

There are really only two questions to ask about any counting problem. First, is the selection built in stages? If so, multiply the number of choices at each stage. Second, does the order of the selection matter? If yes, you are counting permutations; if no, you are counting combinations. Almost every problem in this lesson, and in the exercises, is settled by those two questions.

Key idea: multiply across stages, then decide whether order matters. Order matters: permutation. Order does not: combination.

The multiplication principle

Suppose a task has n1 possible first choices, then n2 choices after every allowed first choice, and so on, with each stage count independent of which earlier choices were made. The total number of completions is n1 times n2 times the remaining stage counts. For example, a six-sided die result followed by one of two coin faces gives 6 times 2=12 ordered records. When later counts differ across branches, split into cases and add their counts. [1]

Why multiply and not add? Picture the die-then-coin experiment as a tree. The trunk splits into 6 branches, one per die face. Each of those branches splits again into 2 twigs, heads or tails. Twigs at the end: 6 groups of 2, which is 6 × 2 = 12. Addition would count 6 + 2 = 8, as if you performed one stage or the other, but the experiment performs both, one after another. "And then" means multiply; "or instead" means add.

A wardrobe example makes it concrete. With 3 shirts and 2 pairs of pants, each shirt pairs with each pair of pants, so there are 3 × 2 = 6 outfits. Add a choice of 4 pairs of shoes and the count becomes 3 × 2 × 4 = 24 complete outfits.

One care point: the principle needs the number of choices at each stage to be the same no matter what was picked earlier, even if the specific options differ. A 4-digit code with no repeated digit has 10 choices for the first digit, then 9 remaining, then 8, then 7, so 10 x 9 x 8 x 7 = 5,040 codes. Which nine digits remain at stage two depends on stage one, but there are always nine of them, so the multiplication stands.

Key idea: stages chain by multiplication because every choice at one stage pairs with every choice at the next.

Factorials

The number of ways to arrange n distinct objects in a row is n factorial, written n!, defined as n! = n x (n-1) x ... x 2 x 1. It is the multiplication principle applied to seats: n choices for the first position, n - 1 for the second (one object is used up), and so on down to 1. For example 5! = 5 x 4 x 3 x 2 x 1 = 120: five books can fill a shelf in 120 different orders. [1]

Factorials grow at a startling pace: 6! = 720, 10! = 3,628,800, and 52!, the number of ways to shuffle a deck, has 68 digits. This growth is why we count with formulas instead of lists.

By convention 0! = 1. Read that as "there is exactly one way to arrange nothing," the empty arrangement. The convention is not a whim; it is the value that makes the permutation and combination formulas below work smoothly when k equals n or 0.

Permutations: order matters

A permutation counts arrangements where order matters. The number of ordered arrangements of k objects chosen from n distinct objects is [2]

P(n, k) = n! / (n - k)!.

Worked example. How many ways can gold, silver, and bronze medals be awarded among 10 runners? Order matters (first is not the same as third), so build it in stages: 10 possible gold winners, then 9 left for silver, then 8 for bronze, giving P(10, 3) = 10 x 9 x 8 = 720.

Now watch the formula say the same thing. 10! / (10 - 3)! = 10! / 7!, and writing both out, 10! = 10 x 9 x 8 x 7!, so the 7! cancels top and bottom, leaving 10 × 9 × 8. The formula is not new machinery; it is the staged product with the unused tail of the factorial divided away. In practice you rarely compute big factorials: cancel first, then multiply the short product that survives.

Key idea: a permutation is the multiplication principle with a shrinking pool: n, then n - 1, then n - 2, for k stages.

Combinations: order does not matter

A combination counts selections where order does not matter. The number of ways to choose k objects from n, ignoring order, is the binomial coefficient [2]

C(n, k) = n! / (k! (n - k)!), read "n choose k".

Worked example. A committee of 2 is chosen from 5 people. Order does not matter, so C(5, 2) = 5! / (2! 3!) = (5 x 4) / (2 x 1) = 10.

Here is where the formula comes from, in two steps. Step 1: count ordered picks: P(5, 2) = 5 x 4 = 20 ways to pick a first person then a second. Step 2: notice each committee got counted twice: picking Ana then Ben and picking Ben then Ana build the same committee. Every group of 2 can be ordered in 2! = 2 ways, so the ordered count overstates by a factor of 2. Divide it away: 20 / 2 = 10. In general C(n, k) = P(n, k) / k!: count ordered, then divide by the k! orders that describe the same group.

With 5 people named A, B, C, D, E, you can check by listing: AB, AC, AD, AE, BC, BD, BE, CD, CE, DE. Ten pairs, matching the formula, which is the shrink-and-list habit from the start of the lesson.

A symmetry worth knowing: C(n, k) = C(n, n - k). Choosing 2 people to serve is the same act as choosing the 3 people who sit out, so C(5, 2) = C(5, 3) = 10. When k is large, count the leftovers instead.

Key idea: combinations are permutations with the order divided out: C(n, k) = P(n, k) / k!.

Two distinct selections from three objects have six ordered possibilities. Each of the three unordered pairs has exactly two orders, so dividing by 2! removes the duplication.
Two distinct selections from three objects have six ordered possibilities. Each of the three unordered pairs has exactly two orders, so dividing by 2! removes the duplication.

Putting counting to work in probability

How many 5-card poker hands are there from a 52-card deck? A hand is a handful, not a sequence, so order does not matter: C(52, 5) = 2,598,960. What is the probability that all 5 cards are hearts? There are 13 hearts, and the number of 5-heart hands is C(13, 5) = 1,287. Under a uniformly random five-card deal, every hand is equally likely, so [1]

P(all hearts) = C(13, 5) / C(52, 5) = 1,287 / 2,598,960 = 0.000495, about 1 in 2,020.

What we just did: we used the same species of count, combinations, for both the favorable outcomes and the total, so the "does order matter" decision was made once and applied consistently. Mixing a permutation numerator with a combination denominator is a classic way to get nonsense.

Compare two fictional even-money bets, each with independent fair dice. Bet A pays one unit of profit if at least one six occurs in four rolls of one die, and loses one unit otherwise. Bet B pays one unit if at least one double-six occurs in 24 rolls of a pair of dice, and loses one unit otherwise. The probability calculations determine the expected gain for these stated rules; they do not guarantee a profit over a particular evening.

Set up the first bet by counting. Four rolls have 6^4 = 1,296 equally likely outcomes. The rolls with no six at all leave 5 faces per roll: 5^4 = 625 outcomes. So, by the complement rule,

P(at least one six) = 1 - 625/1,296 = 671/1,296 = 0.518.

For Bet B, a pair of independent fair dice misses double-six with probability 35/36. Across 24 independent rolls, P(no double-six)=(35/36)^24, approximately 0.5086. Thus the win probability is approximately 0.4914. Bet A has win probability approximately 0.5177. With the specified unit profit or loss, expected gains are 2p-1: approximately 0.0355 units for A and -0.0172 for B. Expected gain describes an average under the model, not a guaranteed outcome.

The birthday problem

Here is the most famous counting surprise. In a room of 23 people, what is the probability that at least two share a birthday? Assume the 23 birthdays are independent, each uniformly distributed over 365 days, and ignore leap years. Intuition says the chance is small, since 23 is tiny next to 365. The count says otherwise. [2]

Work the complement: P(at least one shared birthday) = 1 - P(all 23 birthdays different). Try 3 people first. All different means: the first person takes any of 365 days, the second must miss 1 taken day (364 choices), the third must miss 2 (363 choices). So P(all different) = (365 x 364 x 363) / 365^3 = 0.9918, and P(some match) = 0.0082, still small.

For 23 people the same staged product runs from 365 down to 343, which is the permutation P(365, 23), divided by 365^23 total outcomes. Multiplying the 23 factors gives P(all different) = 0.4927. Therefore

P(at least one shared birthday) = 1 - 0.4927 = 0.5073, better than a coin flip.

The event concerns a match among any pair, not just a match with one specified person. There are C(23,2)=253 pairs, but their matching events cannot simply be added to obtain the chance of at least one match. The complementary product accounts for the joint no-match condition. The value 253/365 is an expected number of matching pairs, not the probability of at least one matching pair.

With independent birthdays uniform over 365 days, collision probability is one minus the product of no-match probabilities. It first exceeds one half at 23 people, where it is approximately 0.507297.
With independent birthdays uniform over 365 days, collision probability is one minus the product of no-match probabilities. It first exceeds one half at 23 people, where it is approximately 0.507297.

Try it

A club has 6 women and 4 men. A size-3 committee is selected uniformly from all subsets of the 10 distinct members. Find the probability the committee has exactly 2 women. Work it out before reading on.

Worked answer. Step 1, total outcomes: C(10, 3) = 120 equally likely committees. Step 2, favorable outcomes in stages: choose the 2 women, C(6, 2) = 15 ways, and then choose the 1 man, C(4, 1) = 4 ways, so 15 × 4 = 60 committees. Step 3, divide: P(exactly 2 women) = 60/120 = 0.5. What we just did: combinations inside each group, the multiplication principle across groups, and one division at the end.

Where people get stuck

The first trap is answering the order question wrongly. A "combination lock" actually wants a permutation: 5-31-17 and 17-31-5 do not both open it. Committees, hands, and teams ignore order; codes, rankings, and race results respect it. Ask "if I shuffle my selection, is it a different result?" If shuffling changes nothing, divide the order out.

The second trap is double counting in "at least" problems. From 6 women and 4 men, count committees of 3 with at least 2 women. Tempting but wrong: choose 2 women, C(6, 2) = 15, then anyone from the remaining 8 people, giving 15 × 8 = 120.

The correct count splits into disjoint cases: exactly 2 women, 15 × 4 = 60, plus exactly 3 women, C(6, 3) = 20, total 80. The wrong method counts each all-women committee three times, once for each pair of its members chosen at the first step: 60 + 3 × 20 = 120. When cases can overlap, cut them into exact, disjoint cases first.

The third trap is factorial arithmetic. Never compute 52! to find C(52, 5); cancel first. C(52, 5) = (52 x 51 x 50 x 49 x 48) / 5!, five factors over 120, which a calculator handles happily.

Common misconceptions

  • "Permutations and combinations are unrelated formulas." They are one idea apart: P(n, k) = k! × C(n, k). Ordered counts are unordered counts times the number of orders.
  • "With replacement and without replacement count the same." Four digits with repetition allowed: 10,000. Without: 5,040. The pool shrinks only when used items are not returned.
  • "Counting is only for games." The same tools count passwords, DNA sequences, committee assignments, lottery designs, and the test statistics of modern experiments.
  • "If the numbers are equally likely, my intuition about them is reliable." The birthday problem says otherwise. Trust the count, and use intuition to choose which count to set up.

Recap

  • Multiply per-stage choice counts when the stated count at each stage is the same for every allowed earlier choice. Otherwise split into cases or use a tree.
  • For n distinct objects, n! counts all orders, with 0!=1.
  • Without repetition, n!/(n-k)! counts ordered selections and C(n, k) counts unordered subsets, for integers 0<=k<=n.
  • Decide whether order, repetition and object identity matter before choosing a formula.
  • A favorable-count ratio requires a finite equally weighted sample space. The complement often simplifies an at-least-one event.

Retrieve, explain, and revisit

Close the worked examples before answering: Which three decisions should precede choosing a counting formula?

Check the reasoning

Determine whether order matters, repetition is allowed, and objects are distinct. For probabilities, also justify equal weights.

Return after a day, then again after about a week: How many five-digit codes with distinct digits are possible when the first digit cannot be zero? Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

There are 9 choices first, then 9,8,7,6 choices, giving 27,216. The zero restriction changes only the first-stage pool.

Sources

  1. Orloff and Bloom, MIT 18.05 (2022), Class 1: Counting. Cited passages: p. 6; pp. 6-7; pp. 7-8.
  2. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 7; pp. 4 and 7; complementary counting method.
Key terms
Multiplication principle
Multiply the number of choices at successive stages when each stage has the stated count for every preceding allowable choice.
Factorial
n! = n x (n-1) x ... x 1, the number of arrangements of n distinct objects; 0! = 1.
Permutation
P(n, k)=n!/(n-k)! counts ordered selections of k distinct objects from n without repetition.
Combination
C(n, k)=n!/[k!(n-k)!] counts unordered size-k subsets of n distinct objects.
Binomial coefficient
The number C(n, k), 'n choose k', giving the count of size-k subsets of an n-set.
Combinatorics
The mathematics of counting arrangements and selections.

Module 2: Conditional Probability and Independence

Updating probabilities on new information, the law of total probability, Bayes' theorem, and what it means for events to be independent.

Conditional Probability and the Multiplication Rule

  • Define conditional probability and compute it from a formula or a two-way table.
  • Apply the multiplication rule for the probability of a joint event.
  • Distinguish sampling with replacement from sampling without replacement.

New information changes probabilities. If you learn that a rolled die shows an even number, the chance it is a 2 is no longer 1/6. If a card drawn from the deck is known to be red, the chance it is the ace of spades has dropped to 0. Conditional probability is the tool that revises a probability once we know some event has occurred, and it is the single most used idea in the rest of this course.

The big picture

A card is drawn uniformly from a standard deck. Before any information, the chance it is the ace of hearts is 1/52. If you learn that the card is red, there are 26 equally likely remaining possibilities, so the chance is 1/26. The notation P(A | B), read as the probability of A given B, records both the target event and the information used.

The mental picture to keep is a shrinking world. Before the information arrives, the whole sample space S is in play. Learning that B occurred throws away every outcome outside B. What remains is a smaller world, and inside it we re-ask our question about A. Conditional probability is ordinary probability, computed on the survivors.

Key idea: P(A | B) answers "of the times B happens, what fraction also have A?" New information shrinks the world; the bar records what the world has shrunk to.

The definition

The probability of A given B is defined as

P(A | B) = P(A and B) / P(B), provided P(B) is greater than 0.

Why this formula? Conditioning on B shrinks the world to just the outcomes in B. Within that world, the outcomes where A also happens are exactly the outcomes of "A and B." Dividing by P(B) rescales the shrunken world so its total probability is 1 again, the way a pie chart of the survivors must still total 100%. Numerator: the part of A living inside B. Denominator: the size of the new world. [1]

Worked example. Roll a fair die. Let A = {2} and B = {2, 4, 6} (even). Work in steps.

  • Step 1. The overlap: A and B is {2}, so P(A and B) = 1/6. (A sits entirely inside B.)
  • Step 2. The new world: P(B) = 3/6 = 1/2. (Three outcomes survive the news.)
  • Step 3. Divide: P(A | B) = (1/6) / (1/2) = 2/6 = 1/3.

What we just did: knowing the roll is even shrank six outcomes down to three equally likely survivors {2, 4, 6}, and the outcome 2 is one of those three. The update raised the probability from 1/6 to 1/3. Notice that conditioning can raise a probability, lower it, or leave it unchanged; the direction depends on how A overlaps B.

One warning before we go on: P(A | B) and P(B | A) are different questions with different answers. The fraction of even rolls that are 2 is 1/3, while the fraction of rolls of 2 that are even is 1. Keeping the two directions straight is exactly what Bayes' theorem, two lessons from now, is for.

Reading a two-way table

Use the following fictional table of 200 students. Select one of these students uniformly, so a count divided by 200 defines a probability for this finite population. The categories are music study and sport participation: [2]

SportNo sportTotal
Music302050
No music9060150
Total12080200

The chance a random student plays a sport given they study music is P(sport | music) = 30 / 50 = 0.60: restrict to the 50 music students, then find the fraction who play a sport. The conditioning event tells you which row or column to live in; its total becomes your denominator.

Run a few more reads to build the habit.

  • P(music | sport) = 30/120 = 0.25: among the 120 athletes, 30 study music. Same overlap cell, different denominator, different answer: 0.25 versus 0.60. The two directions of conditioning really are different questions.
  • P(sport) = 120/200 = 0.60: no conditioning, so the denominator is everyone.
  • P(music and sport) = 30/200 = 0.15: the joint probability uses the grand total. Compare it with P(sport | music) = 30/50. Same 30 students on top, different world below.

What we just did: every one of these numbers is "a cell divided by a total," and the choice of total is the entire game. Joint probabilities divide by 200. Conditional probabilities divide by the total of the group you were told about.

Key idea: in a table, "given X" means "divide by X's total." If your denominator is still the grand total, you have not conditioned yet.

Among 200 students,30 both study music and play sport. The joint probability is 30/200. Conditioning on the 120 sport students gives music probability 30/120=1/4.
Among 200 students,30 both study music and play sport. The joint probability is 30/200. Conditioning on the 120 sport students gives music probability 30/120=1/4.

The multiplication rule

Rearranging the definition gives the multiplication rule for a joint probability:

P(A and B) = P(B) x P(A | B) = P(A) x P(B | A).

Read the middle version aloud: "the probability that both happen equals the probability the first happens, times the probability the second happens given the first did." This is the natural way to compute the probability of a sequence of events, one after another: each new factor is conditioned on everything so far. [1]

Worked example. Draw two cards without replacement. What is the probability both are aces? Step 1: P(first is an ace) = 4/52. Step 2: given the first was an ace, 3 aces remain among 51 cards, so P(second is an ace | first was) = 3/51. Step 3: multiply: (4/52) x (3/51) = 12/2,652 = 1/221, about 0.0045. What we just did: the second factor is a conditional probability because the deck the second draw sees depends on the first draw.

For three events, P(A and B and C)=P(A)P(B | A)P(C | A and B), provided the conditioning events in the displayed factors have positive probability. With uniformly random successive draws without replacement, the probability of three hearts is (13/52)(12/51)(11/50), approximately 0.01294. The updated fractions describe the composition left after the specified earlier draws.

With and without replacement

Worked example. An urn has 5 red and 3 blue balls (8 total). Draw two without replacement. Find the probability both are red. The first draw is red with probability 5/8. Given the first was red, only 4 red remain out of 7, so the second is red with probability 4/7. By the multiplication rule, [2]

P(both red) = (5/8) x (4/7) = 20/56 = 5/14, about 0.357.

If the first ball is returned and both draws select uniformly and independently, P(both red)=(5/8)^2=25/64, approximately 0.391. Replacement restores the composition; independent random selection is a separate condition. A mechanism could return the ball but deliberately repeat its color, creating dependence despite replacement.

For two uniformly random draws from 5 million red and 3 million blue balls, the exact no-replacement probability differs little from (5/8)^2 because one removal changes the composition very little. The relevant issue in a larger sample is the sampling fraction and the design, not population size alone. Large populations do not remove dependence caused by households, clusters, or a shared selection mechanism.

Uniform draws without replacement from 5 red and 3 blue balls produce ordered color probabilities RR=5/14,RB=15/56,BR=15/56,BB=3/28. These four probabilities sum to one.
Uniform draws without replacement from 5 red and 3 blue balls produce ordered color probabilities RR=5/14,RB=15/56,BR=15/56,BB=3/28. These four probabilities sum to one.

A classic puzzle: the two-children problem

Consider a simplified fictional model of two ordered binary outcomes, B and G, each independent with probability 1/2. The model is often described as two children, but its mathematical assumptions are specified here rather than inferred from real families. The sample space is {BB, BG, GB, GG}, with probability 1/4 for each outcome.

Question 1: given that the older child is a boy, what is the probability both are boys? The conditioning event is {BB, BG}, two outcomes. The favorable overlap is {BB}. So the answer is 1/2.

Question 2: given that at least one child is a boy, what is the probability both are boys? Now the conditioning event is {BB, BG, GB}, three outcomes, and the overlap is still {BB}. The answer is 1/3, not 1/2. The information "at least one boy" is weaker than "the older is a boy," so it rules out less and leaves a bigger world of survivors. Same question about A, different B, different answer. Writing out the shrunken world resolves what verbal intuition muddles.

How was the information obtained?

The two-children calculation conditions on an event, not on an unspecified conversation. If a family is selected uniformly and you are told whether it has at least one B, conditioning on a yes answer gives 1/3 for BB. If instead a uniformly chosen child is observed to be B, a BB family produces that observation with probability 1, while BG and GB do so with probability 1/2. Bayes then gives P(BB | observed B)=(1/4)/(1/2)=1/2. The selection and reporting procedure determine the likelihoods. [1]

Try it

A drawer has 4 black and 6 white socks. You pull two socks without replacement. Find the probability both are white. Work it out before reading on.

Worked answer. Step 1: P(first white) = 6/10. Step 2: given a white sock is gone, 5 whites remain among 9 socks, so P(second white | first white) = 5/9. Step 3: multiply: (6/10) x (5/9) = 30/90 = 1/3. What we just did: both the numerator and the denominator of the second factor dropped by one, because one white sock left the drawer and the drawer got smaller.

Where people get stuck

The most damaging confusion is swapping the two directions. P(positive test | healthy) and P(healthy | positive test) can differ enormously, and mistaking one for the other in courtrooms has a name, the prosecutor's fallacy. The table exercise is the antidote: the two directions use different denominators, 50 versus 120 in our example, so they are different numbers.

A second stumble is mixing up joint and conditional probability. "The probability a student does music and sport" is 30/200 = 0.15. "The probability a music student does sport" is 30/50 = 0.60. Same overlap, different worlds. When a sentence contains "given," "among," "of those," or "if we know," the denominator shrinks to that group.

Third, updating only half of the second-draw fraction. After removing a red ball, the second draw is 4/7: one fewer red on top, one fewer ball below. Writing 4/8 or 5/7 updates one count and forgets the other. Say the story aloud as you write each factor: "4 reds left, 7 balls left."

Common misconceptions

  • "Conditioning always lowers a probability." It can raise one: learning the roll was even lifted P(rolled a 2) from 1/6 to 1/3. Under the model, the conditional probability may increase, decrease, or remain unchanged; an individual update is not guaranteed to move closer to the eventual outcome.
  • "You can only condition on earlier events." The bar records information, not time order. Given that the second card was an ace, the probability the first was an ace is a legitimate question, and it also equals 3/51 by symmetry.
  • "P(A | B) is a strange new kind of probability." It is ordinary probability on a restricted sample space; all the axioms and rules from earlier lessons still hold inside the shrunken world.
  • "Without replacement is a minor technicality." In small pools it changes answers a lot: 5/14 versus 25/64 in the urn. The approximation depends on the sampling fraction and selection mechanism.

Recap

  • P(A|B)=P(A intersection B)/P(B) is defined here when P(B)>0.
  • A conditioning row or column becomes the denominator in a table.
  • P(A intersection B)=P(B)P(A|B). Every conditional factor in a longer chain needs a positive conditioning probability.
  • Uniform sampling without replacement generally produces dependence. Replacement and independent random selection produce independent draws.
  • The information-gathering rule is part of the model. Reversing a conditional changes the question.

Retrieve, explain, and revisit

Close the worked examples before answering: When is P(A|B)=P(A and B)/P(B) defined?

Check the reasoning

The event B must have positive probability. Conditioning on an exact continuous value needs a different construction.

Return after a day, then again after about a week: Using the same sock model, find P(second black) by total probability. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

(4/10)(3/9)+(6/10)(4/9)=0.4. The unconditional second-draw chance equals the original black fraction.

Sources

  1. Orloff and Bloom, MIT 18.05 (2022), Class 3: Conditional probability, independence and Bayes. Cited passages: pp. 2-3; pp. 3-4; pp. 2-4; conditional-event definition.
  2. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 5; pp. 5-6.
Key terms
Conditional probability
P(A | B) = P(A and B) / P(B), the probability of A given that B has occurred.
Joint probability
P(A and B), the probability that both A and B occur.
Multiplication rule
P(A and B) = P(B) x P(A | B), used to chain probabilities of successive events.
Two-way table
A table of counts cross-classified by two variables, handy for reading conditional probabilities.
Without replacement
Sampling in which a selected item is not returned, so later draws are conditioned on earlier ones.
With replacement
Sampling in which each item is returned before the next draw, keeping draws unaffected by each other.

Independence of Events

  • State the definition of independent events.
  • Test whether two events are independent using probabilities.
  • Contrast independence with being mutually exclusive.

Two fair coin outcomes can be independent, but fairness alone does not prove it. A mechanism that generates one fair outcome and copies it produces HH or TT with probability 1/2 each. Each recorded flip is fair, yet knowing the first completely determines the second. Independence is a condition on the joint model, and this lesson makes that condition precise.

The big picture

The last lesson was about information that changes probabilities: learning B shrinks the world and moves P(A) to P(A | B). Independence is the special case where the move goes nowhere. The news arrives, the world shrinks, and the fraction devoted to A is exactly what it was before. B happened, and A's prospects did not budge.

When P(B) is positive, independence is equivalent to P(A | B)=P(A). Substituting that equality into the multiplication rule gives P(A and B)=P(A)P(B). The product definition also handles probability-zero events, for which the conditional fraction P(A | B) is not defined by division.

Key idea: independence means the conditioning bar changes nothing. Learning B leaves P(A) exactly where it stood, so joint probabilities factor into products.

The definition

Two events A and B are independent if

P(A and B) = P(A) x P(B).

If P(B) is greater than 0, divide the product equation by P(B) to obtain P(A | B)=P(A). The reverse conditional expression requires P(A) greater than 0. Every probability-zero event is independent of every event under the product definition, since its intersection with any event also has probability 0. These edge cases are one reason to state the product definition first. [1]

Two remarks make the definition easier to use. First, it is symmetric: if B tells you nothing about A, then A tells you nothing about B; you never need to check both directions. Second, it is a numerical condition, not a feeling. Events that sound unrelated can be dependent, and events that sound linked can be independent, so the honest move is always to compute the three probabilities and compare.

Each table has P(X=1)=P(Y=1)=1/2. All four cells equal 1/4 only in the independent model. Agreement and disagreement models put mass 1/2 on different pairs.
Each table has P(X=1)=P(Y=1)=1/2. All four cells equal 1/4 only in the independent model. Agreement and disagreement models put mass 1/2 on different pairs.

Worked example: coins are independent

Specify a two-flip model in which HH, HT, TH, TT each have probability 1/4. Let A be first heads and B be second heads. The joint distribution supplies the probabilities needed to check independence: [2]

  • Step 1. P(A) = 1/2: two of the four outcomes {HH, HT, TH, TT} have a first H, namely HH and HT.
  • Step 2. P(B) = 1/2: the outcomes HH and TH.
  • Step 3. P(A and B) = P({HH}) = 1/4.
  • Step 4. Compare: P(A) x P(B) = (1/2)(1/2) = 1/4. Equal, so the flips are independent.

The calculation verifies independence within the specified four-outcome model. It does not prove that a physical coin apparatus produces independent observations. For a sequence modeled as independent fair flips, ten heads has probability (1/2)^10=1/1,024, and the next head probability remains 1/2 after any finite past sequence.

Worked example: testing for independence

Select one student uniformly from the fictional table of 200 students. The probabilities are P(music)=0.25, P(sport)=0.60, and P(music and sport)=0.15. The product equals the joint probability, so these two events are independent in this specified finite-population model. The equality does not establish independence in a wider population from which these students might have been sampled. [2]

Now a dependent pair, from one card drawn out of 52. Let A be "a king" and B be "a face card" (jack, queen, king, 12 cards). Then P(A) = 4/52, P(B) = 12/52, and since every king is a face card, P(A and B) = 4/52. Compare with the product: (4/52) x (12/52) = 48/2,704 = 0.018, while 4/52 = 0.077. Not equal, so the events are dependent. Sensibly so: learning the card is a face card lifts the chance of a king from 4/52 to P(A | B) = 4/12 = 1/3. Information that changes the odds is exactly what dependence is.

Key idea: to test independence, compute P(A), P(B), and P(A and B), then check the product. The arithmetic settles what wording cannot.

Independence is not mutual exclusivity

Disjointness concerns which outcomes can belong to both events; independence concerns how their probabilities factor. They are different conditions: [1]

  • Mutually exclusive: A and B have empty intersection, which implies P(A and B)=0. A probability-zero intersection need not be empty in a general model.
  • Independent events have P(A and B) = P(A) P(B).

If A and B each have positive probability and are mutually exclusive, then learning B occurred tells you A definitely did not, which is a huge amount of information, so they are dependent. Take one coin flip with A = "heads" and B = "tails." They are disjoint, and P(A | B) = 0, a long way from P(A) = 1/2. In short, two events with nonzero probability cannot be both mutually exclusive and independent: disjointness makes the product P(A)P(B) positive while the joint probability is 0, and those can never match.

A Venn diagram can show whether sets intersect, but ordinary drawn circle areas do not establish independence. Independence requires the intersection probability to equal the product of the event probabilities. For disjoint events with positive probabilities, that equality fails. If at least one event has probability 0, disjointness and independence can both hold.

Independence of several events and the complement trick

A finite collection of events is mutually independent if every subcollection has joint probability equal to the product of its event probabilities. For an infinite collection, require the property for every finite subcollection. Physical separation alone does not justify independence: different components may share a power supply, and different customers may respond to the same promotion. State the joint-model assumption and examine common causes. [1]

A common use is "at least one." Suppose a component works with probability 0.9, and three components fail or work independently. The probability all three work is 0.9 x 0.9 x 0.9 = 0.729. The probability at least one fails is easiest by complement: 1 - 0.729 = 0.271. Trying to add failure probabilities directly, 0.1 + 0.1 + 0.1 = 0.3, overcounts the cases where two or three fail together; the complement route sidesteps the overlap bookkeeping entirely.

For three backups whose failures are mutually independent and each have probability 0.1, the probability all fail is 0.1^3=0.001. The probability at least one works is 0.999. If a shared power failure instead disables all three with probability 0.1 and there are no other failures, each still fails with marginal probability 0.1 but the all-fail probability is 0.1. Matching marginal failure rates do not determine a system failure probability.

One fine point for careful readers: pairwise independence does not guarantee mutual independence. Use the four equally likely outcomes of two independent fair flips and let A = "first is heads," B = "second is heads," C = "both flips match." Each pair multiplies correctly: every intersection of two of them is the single outcome HH with probability 1/4, matching the product 1/2 × 1/2. But P(A and B and C) = P(HH) = 1/4, while the triple product is 1/8. Knowing any two of these events pins down the third, so the trio is not mutually independent even though every pair is.

For two independent fair flips, A=first heads,B=second heads,C=equal faces. Each event has probability 1/2 and every pair intersects with probability 1/4, but the triple intersection is HH with probability 1/4 rather than 1/8.
For two independent fair flips, A=first heads,B=second heads,C=equal faces. Each event has probability 1/2 and every pair intersects with probability 1/4, but the triple intersection is HH with probability 1/4 rather than 1/8.

The gambler's fallacy

Under an independent sequence with P(heads)=1/2 on every flip, P(next heads | the first five were heads)=1/2. The probability of six heads assessed before any flip is 1/64. These are different questions: the first conditions on five observed results, while the second includes the chance of those results occurring. [1]

The gambler's fallacy is the belief that independent trials must compensate for past imbalances. The law of large numbers does not force a success on the next trial. If the success probability is unknown, however, a streak can inform inference about that probability. Independence conditional on a fixed parameter and uncertainty about the parameter are different parts of a model.

Key idea: state the mechanism and what is known. Fair marginal probabilities alone do not establish independence, and a model assumption can require revision when evidence contradicts it.

Try it

Use two independent fair die rolls and the 36-outcome sample space of ordered pairs. Let A = "the first roll is a 6" and B = "the two rolls sum to 7." Are A and B independent? Then answer the same question for B' = "the two rolls sum to 12." Work both before reading on.

Worked answer. Step 1: P(A) = 6/36 = 1/6 (pairs (6, 1) through (6, 6)). Step 2: P(B) = 6/36 = 1/6 (the six pairs summing to 7). Step 3: A and B is the single pair (6, 1), so P(A and B) = 1/36, and P(A)P(B) = (1/6)(1/6) = 1/36. Equal, so A and B are independent: whatever the first roll shows, exactly one second-roll value completes a 7.

Step 4: for B', P(B') = 1/36 (only (6, 6)), and P(A and B') = 1/36, but P(A)P(B') = (1/6)(1/36) = 1/216. Not equal, so A and B' are dependent: a sum of 12 forces the first roll to be a 6.

Where people get stuck

Assuming independence for convenience can distort a joint probability in either direction. Let two indicators be identical fair binary variables. Each equals 1 with probability 1/2, but the probability both equal 1 is 1/2, not 1/4. If instead the second is always the complement of the first, the joint probability is 0. The same marginal probabilities support very different dependence structures.

Dependence alone does not identify a causal effect. For a synthetic example, let a fair binary variable Z determine X=Z and Y=Z. X and Y are dependent because they share Z; their joint distribution alone does not establish that intervening on X changes Y. Causal interpretation requires additional assumptions about the mechanism and intervention.

Third, misreading streaks. "Five heads in a row, tails is due" and "five heads in a row, heads is hot" are both wrong under an independent fair-coin model; the next flip is 1/2 either way. What a long streak can legitimately do is make you question whether the coin is fair, which is a question about the mechanism, taken up by statistics.

Common misconceptions

  • "Independent means the events cannot happen together." That is mutual exclusivity, and it is nearly the opposite: disjoint events with positive probability are always dependent.
  • "Independence is obvious from the story." The product condition defines independence in a probability model. Finite sample frequencies do not prove population independence. Specify assumptions and use data to assess their plausibility.
  • "Checking all pairs is enough for a group of events." Pairwise independence can hold while the collection is not mutually independent, as the two-coin matching example shows.
  • "After several failures, a success is due." Independent trials with a fixed success probability have no compensating obligation. Sampling without replacement can change that probability, but a success is guaranteed only if the stated remaining composition forces it.

Recap

  • A and B are independent when P(A and B) = P(A)P(B), equivalently P(A | B) = P(A) when P(B) is positive.
  • Test independence by computing; do not trust verbal plausibility.
  • Disjoint and independent are incompatible for events of positive probability.
  • For mutually independent events, joint probabilities are products, and "at least one" is handled by 1 minus P(none).
  • Independence belongs to the mechanism; conditioning on earlier outcomes does not change the law of a trial independent of them.

With independence and conditioning both in hand, the next lesson combines them into the two most consequential formulas of the course: the law of total probability and Bayes' theorem.

Retrieve, explain, and revisit

Close the worked examples before answering: Can positive-probability disjoint events be independent? Explain with the product definition.

Check the reasoning

No. Their intersection probability is zero but the product of their positive marginal probabilities is positive.

Return after a day, then again after about a week: Two independent components each fail with probability 0.2. Find P(at least one fails), then explain what a shared failure cause would change. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

The independent answer is 1-0.8 squared=0.36. A shared cause changes the joint probabilities, so the product calculation must be reassessed.

Sources

  1. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 6.
  2. Orloff and Bloom, MIT 18.05 (2022), Class 3: Conditional probability, independence and Bayes. Cited passages: pp. 7-8.
Key terms
Independent events
Events satisfying P(A and B)=P(A)P(B), including when one has probability zero.
Dependent events
Events for which P(A and B) is not equal to P(A) P(B).
Mutually independent
A collection of events for which the product rule holds for every subset.
Complement trick
Computing P(at least one) as 1 minus P(none), useful under independence.
Independent trials
In a model of independent trials, past outcomes do not alter the distribution of later trials.
Independence vs disjoint
Disjoint events have empty intersection. Independent events satisfy the product rule. Two positive-probability events cannot be both.

The Law of Total Probability and Bayes' Theorem

  • Use the law of total probability to combine conditional probabilities across cases.
  • Apply Bayes' theorem to reverse the direction of a conditional probability.
  • Explain how base rates and the observation mechanism affect a posterior probability.

Two closely linked results let us combine and then reverse conditional probabilities. The law of total probability assembles an overall probability from case-by-case pieces; Bayes' theorem turns P(evidence | hypothesis) into P(hypothesis | evidence), the direction we actually care about. Together they are the backbone of statistical reasoning, machine learning, spam filtering, and everyday diagnosis, and they power the most famous surprises in probability.

The big picture

Real questions rarely hand you probabilities in the direction you need. Medicine measures how often a test is positive among people known to have a disease; a patient wants the reverse, the chance of disease given a positive. A spam filter knows how often spam contains the word "free"; it needs the chance an email containing "free" is spam. In both cases the known conditional points one way and the needed conditional points the other.

The reversal takes two steps, and they are this lesson. First, compute the overall probability of the evidence by splitting the world into cases, which is the law of total probability. Second, ask what fraction of that evidence-probability came from the hypothesis you care about, which is Bayes' theorem. Every calculation ahead, however famous, is those two steps in costume.

Key idea: total probability averages over cases to get P(evidence); Bayes' theorem divides one case's share by that total to reverse the conditional.

The law of total probability

Partition the sample space into finitely or countably many disjoint events that cover it. For cases with positive probability, P(A) is the sum of P(A | case) times P(case). Zero-probability cases contribute zero through P(A and case); their undefined conditional fractions need not be used. For B and its complement, with both probabilities positive: [1]

P(A) = P(A | B) P(B) + P(A | not B) P(not B).

Read it aloud: "the chance of A is the chance of A in the first case, weighted by how likely that case is, plus the same for the other case." The weights are the case probabilities and must sum to 1. With more than two cases the sum grows a term per case, and the requirement is always the same: the cases must be disjoint (no overlap) and exhaustive (nothing missed), a setup called a partition.

Worked example. Suppose it rains on 30% of days. When it rains, your bus is late with probability 0.6; when it does not, with probability 0.1. What fraction of days is the bus late?

  • Step 1. The cases: rain (probability 0.3) and no rain (probability 0.7). Disjoint, exhaustive.
  • Step 2. The pieces: P(late | rain) = 0.6 and P(late | no rain) = 0.1.
  • Step 3. Weight and add: P(late) = (0.6)(0.3) + (0.1)(0.7) = 0.18 + 0.07 = 0.25.

What we just did: the overall rate 0.25 landed between 0.1 and 0.6, and closer to 0.1, because the no-rain case carries more weight. A total-probability answer is always a compromise between the case rates, pulled toward the likelier case. If your "average" drifts outside the range of the case values, a weight has gone missing.

Bayes' theorem

Bayes' theorem reverses a conditional probability, turning P(A | B) into P(B | A). It falls out of the multiplication rule in three short steps. [2]

  • Step 1. The joint probability has two factorizations: P(A and B) = P(A | B) P(B) and also P(A and B) = P(B | A) P(A). (Both are the multiplication rule from two directions.)
  • Step 2. Set them equal: P(B | A) P(A) = P(A | B) P(B).
  • Step 3. When P(A) is positive, divide both sides by P(A):

P(B | A) = P(A | B) P(B) / P(A),

where the denominator P(A) is usually computed with the law of total probability. Here P(B) is the prior (what we believed before the evidence A), and P(B | A) is the posterior (our updated belief after seeing A). The theorem is bookkeeping, not magic: of all the probability that flows into the evidence, it asks what share flowed through the hypothesis.

Worked example. Continue the bus story. Given that the bus is late today, what is the probability it is raining? We want P(rain | late). Numerator: P(late | rain) P(rain) = (0.6)(0.3) = 0.18. Denominator: P(late) = 0.25 from before. So P(rain | late) = 0.18 / 0.25 = 0.72. Lateness raised the probability of rain from the prior 0.30 to the posterior 0.72, because lateness is six times more common on rainy days.

Worked example: a medical test

Use a fictional screening model, not a claim about a real disease or test. Assume prevalence P(D)=0.01, sensitivity P(+ | D)=0.99, and specificity P(- | not D)=0.95, so P(+ | not D)=0.05. Assume these values apply to a person selected uniformly from the modeled population. What is P(D | +)? [2]

Step 1, total probability of a positive test.

P(+) = P(+ | D) P(D) + P(+ | not D) P(not D) = (0.99)(0.01) + (0.05)(0.99) = 0.0099 + 0.0495 = 0.0594.

Step 2, Bayes' theorem.

P(D | +) = P(+ | D) P(D) / P(+) = 0.0099 / 0.0594 = 0.1667, that is about 1/6, only 16.7%.

In this model, the positive predictive value is 1/6. The base rate matters because the group without the condition is much larger: its false-positive contribution is 0.0495, compared with 0.0099 from true positives. Sensitivity, specificity, overall classification accuracy, and positive predictive value are distinct quantities with different denominators.

Scale the probabilities to an expected-count table for 10,000 modeled people. Expected counts are 100 with the condition, including 99 positives, and 9,900 without it, including 495 positives. Thus 99/(99+495)=1/6. An actual random sample need not contain these exact counts. This table is another representation of the same assumed probabilities, not a new empirical study.

The positive branches total 0.0594; the branch with the condition contributes 0.0099. Holding the likelihoods fixed, increasing the prior increases the posterior; holding other inputs fixed, reducing the false-positive rate also increases it. Those are mathematical sensitivity statements. They do not prescribe screening or follow-up decisions for a real patient, where the inputs, purpose, benefits and harms must be established separately.

Stipulated prevalence 1%,sensitivity 99%,specificity 95% give expected counts 99 true positives and 495 false positives per 10,000. The posterior is 99/594=1/6. These are expected model counts,not clinical data.
Stipulated prevalence 1%,sensitivity 99%,specificity 95% give expected counts 99 true positives and 495 false positives per 10,000. The posterior is 99/594=1/6. These are expected model counts,not clinical data.

The Monty Hall problem

Place a car uniformly behind one of three doors, independently of the player's initial choice of door 1. The host knows the location, always opens an unchosen goat door, and always offers the switch. When the host has two goat doors available, assume a fair random choice between them. The host opens door 3. Should you switch to door 2? [1]

The two remaining doors need not have equal posterior probabilities. Before the reveal, the initial choice is correct with probability 1/3. Under the stated protocol, an always-switch strategy wins exactly when that initial choice was wrong. The following cases establish the strategy's overall win probability:

  • Case 1, probability 1/3: your door hides the car. Switching loses.
  • Case 2, probability 2/3: your door hides a goat. The host's hands are tied: he must open the other goat door, so the remaining door hides the car. Switching wins.

So switching wins with probability 2/3. The Bayes version confirms it. Priors: car behind 1, 2, or 3, each 1/3. Likelihood of the observation "host opens door 3": if the car is behind door 1, he picks between doors 2 and 3, so 1/2; if behind door 2, he is forced to open door 3, so 1; if behind door 3, impossible, 0. Total probability of the observation: (1/3)(1/2) + (1/3)(1) + (1/3)(0) = 1/2. Posterior for door 2: (1/3)(1) / (1/2) = 2/3.

The host's full procedure matters. If the host instead chooses an unpicked door uniformly without checking it, and you condition on door 3 revealing a goat, doors 1 and 2 have equal posterior probabilities. In the informed-host version, if the host opens door 3 with probability q when the car is behind door 1, then after observing door 3 the posterior for door 2 is 1/(1+q). The value 2/3 uses q=1/2. The unconditional always-switch strategy still wins 2/3 under an informed host who always reveals a goat and always offers the switch, regardless of the tie-breaking rule.

With a uniformly placed car,initial choice door 1,and an informed host who always reveals a goat and offers a switch, P(car 2 given reveal 3)=1/(1+q). The unconditional always-switch strategy wins with probability 2/3 for every tie probability q.
With a uniformly placed car,initial choice door 1,and an informed host who always reveals a goat and offers a switch, P(car 2 given reveal 3)=1/(1+q). The unconditional always-switch strategy wins with probability 2/3 for every tie probability q.

Try it

In a fictional email model, 20% of incoming mail is spam. The word "free" appears in 60% of spam messages and in 4% of legitimate messages. An email arrives containing "free." What is the probability it is spam? Work both steps before reading on.

Worked answer. Step 1, total probability of seeing "free": P(free) = (0.60)(0.20) + (0.04)(0.80) = 0.12 + 0.032 = 0.152. Step 2, Bayes: P(spam | free) = 0.12 / 0.152 = 0.789, about 79%. What we just did: the word is strong but not conclusive evidence, because legitimate mail is four times more common than spam and occasionally says "free" too. Combining several words requires a joint likelihood. Multiplying separate word likelihoods adds a conditional-independence assumption that may not hold.

Where people get stuck

The central hazard is swapping P(A | B) for P(B | A). Sensitivity 99% does not mean a positive person is 99% likely to be ill; those are different denominators, test-takers with the disease versus test-takers with a positive. Courtrooms meet the same swap as the prosecutor's fallacy: "the match probability for an innocent person is 1 in a million" is not "the defendant is innocent with probability 1 in a million." Whenever a conditional arrives, say its denominator out loud before using it. [2]

The second hazard is dropping a path from the denominator. P(evidence) must include every route to the evidence: true positives and false positives; spam saying "free" and ham saying "free." Omitting the route you find unlikely does not make it disappear; it makes your posterior too confident. The tree diagram exists precisely to keep all branches on the page.

Use the base rate appropriate to the population and selection mechanism in the question. The values supplied in these worked examples are model assumptions, not measured population estimates. In an application, their uncertainty and possible mismatch to the target population should be examined. A count table can expose a missing group, but it cannot make an incorrect input accurate.

Common misconceptions

  • "Sensitivity of 99% means a positive is 99% certain." Sensitivity conditions on having the condition; positive predictive value conditions on a positive result. In the fictional example, sensitivity is 99%, specificity is 95%, and positive predictive value is 1/6.
  • "Priors never need justification." A prior is part of the probability model. It may come from measured base rates, substantive knowledge, or an explicit assumption. State its origin and test how consequential plausible alternatives would be.
  • "Two options left means 50-50." Monty Hall's doors and the boy-girl puzzles say otherwise: how the options survived the evidence sets their probabilities, not their count.
  • "Bayes' theorem is advanced mathematics." It is one division applied to the multiplication rule; the 10,000-person table computes it with grade-school arithmetic.

Recap

  • A partition is a disjoint, exhaustive collection of events. Total probability sums case probabilities times their conditionals; omit zero-probability cases from this elementary conditional formula.
  • Bayes gives P(B|A)=P(A|B)P(B)/P(A) when P(A)>0 and the likelihood is defined.
  • Compute the evidence denominator across all possible cases, not just the favored explanation.
  • For fixed sensitivity and false-positive rate, changing prevalence changes the posterior. The test example is a stipulated mathematical model.
  • Tree masses or expected counts in a hypothetical population can organize the arithmetic. Those expected counts need not be the counts in an actual sample.

Retrieve, explain, and revisit

Close the worked examples before answering: Why does reversing a conditional require more than keeping the same numerical value?

Check the reasoning

The conditioning population changes. Bayes uses the likelihood, prior and total evidence probability to obtain the reverse direction.

Return after a day, then again after about a week: An informed Monty Hall host reveals door 3 with probability 1 whenever car 1 gives a choice. Given that reveal, what is the posterior for car 2 under uniform placement and initial choice 1? Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

It is 1/(1+1)=1/2. The overall always-switch win rate remains 2/3, but the door-specific posterior depends on the tie rule.

Sources

  1. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 5; p. 5; conditional calculation under the stated host rule.
  2. Orloff and Bloom, MIT 18.05 (2022), Class 3: Conditional probability, independence and Bayes. Cited passages: pp. 8-9; pp. 9-11; method, not academy model parameters; pp. 9-11.
Key terms
Law of total probability
P(A)=sum P(A|Bi)P(Bi) over a positive-probability partition; zero-probability cases have zero joint contribution.
Bayes' theorem
P(B|A)=P(A|B)P(B)/P(A) when the displayed conditionals and positive evidence denominator are defined.
Prior probability
The probability P(B) of a hypothesis before observing evidence.
Posterior probability
The updated probability P(B | A) after observing evidence A.
Base rate
The overall prevalence P(B) that Bayes weighting must account for.
False positive
A positive test result for someone who does not have the condition.

Module 3: Random Variables and Discrete Distributions

Turning outcomes into numbers, computing expectation and variance, and the four workhorse discrete distributions.

Random Variables, Expectation, and Variance

  • Define a discrete random variable and its probability mass function.
  • Compute the expected value of a random variable.
  • Compute variance and standard deviation and apply the rules for linear transformations.

A random variable X assigns a real number to each outcome so that events such as X less than or equal to x have probabilities. In a finite model every numerical assignment meets this measurability requirement. Its distribution describes the probabilities of its values. Expectation and variance are numerical summaries of that distribution when the required moments exist.

The big picture

Outcomes are often not numbers. "HH" can name an ordered outcome; buying a blue jacket can describe an event. Such records are not automatically numerical quantities. But almost every practical question is numeric: how many heads, how much revenue, what total? A random variable is the bridge, a labeling rule that attaches a number to every outcome. Model two independent fair flips and let X count the heads: the outcome HT gets the label 1, HH gets 2, TT gets 0.

Once outcomes wear numeric labels, two summary questions make sense. Where is the center of the distribution, the long-run average if the experiment repeats forever? That is the expected value. And how far do results wander from that center, are they huddled close or scattered wide? That is the variance and its square root, the standard deviation. Center and spread, a two-number portrait of randomness, carry most of this course from here on.

Key idea: a random variable turns outcomes into numbers; expectation locates the balance point of those numbers, and variance measures the scatter around it.

Discrete random variables and the pmf

A discrete random variable takes separate, countable values (like a count). Its behavior is captured by a probability mass function (pmf), p(x) = P(X = x), which must satisfy two conditions: every p(x) is between 0 and 1, and the values sum to 1. The pmf is the complete inventory of what X can be and how likely each value is. [1]

For a single fair die, X = the number rolled, and p(x) = 1/6 for each x in 1 through 6.

For the two-coin count of heads, read the pmf straight off the sample space {HH, HT, TH, TT}: the value 0 comes only from TT, so p(0) = 1/4; the value 1 comes from HT and TH, so p(1) = 2/4 = 1/2; the value 2 comes only from HH, so p(2) = 1/4. Check the total: 1/4 + 1/2 + 1/4 = 1. That final check is worth the five seconds every time; a pmf that does not sum to 1 has lost or double-counted an outcome somewhere.

Key idea: the pmf is a complete list of values and weights. Nonnegative weights, total weight 1, no exceptions.

Expected value

For a discrete variable, the expected value is the probability-weighted sum of its values. A finite real expectation is guaranteed when sum |x|p(x) is finite. A nonnegative variable may instead have infinite expectation. For a signed variable, if both the positive and negative contributions are infinite, their difference is undefined. All numerical examples below have finite support, so these problems do not arise. [2]

E[X] = sum of x times p(x), over all values x.

Read it aloud: "each value, times how often it happens, added up." Values that occur often count more; rare values count less. That is exactly how you would average a semester grade with weighted assignments, and it is the same arithmetic.

Worked example. For the fair die, E[X] = 1(1/6) + 2(1/6) + ... + 6(1/6) = (1+2+3+4+5+6)/6 = 21/6 = 3.5. The expected value need not be a possible outcome; no face shows 3.5. It is the balance point of the distribution, the spot where the pmf would balance on a fingertip, and the average you would see per roll over thousands of rolls.

Worked example. For the two-coin head count: E[X] = 0(1/4) + 1(1/2) + 2(1/4) = 0 + 0.5 + 0.5 = 1. On average, two flips deliver one head, which squares with common sense.

Expectation is how gambling and insurance are priced. Bet 1 dollar on red at American roulette: the wheel has 38 pockets, 18 red, so you win 1 dollar with probability 18/38 and lose 1 dollar with probability 20/38. Then

E[winnings] = (+1)(18/38) + (-1)(20/38) = -2/38 = -0.0526 dollars.

In this specified 38-pocket, equally likely, unit-payoff model, expected net gain is about -5.3 cents per one-dollar bet. A single play returns either +1 or -1 dollar. Under independent repetitions of this same model, the average net gain converges to the expectation, but a finite run is not guaranteed to lose that precise amount.

Key idea: E[X] is a weighted average and a long-run per-play rate. It predicts totals over many repetitions, not the next single result.

A payout of 0,5,10 with probabilities .5,.3,.2 has mean 3.5 even though 3.5 is not a possible payout. A fixed entry cost 4 gives expected net gain -0.5.
A payout of 0,5,10 with probabilities .5,.3,.2 has mean 3.5 even though 3.5 is not a possible payout. A fixed entry cost 4 gives expected net gain -0.5.

Variance and standard deviation

A variable that is always 4 has the same mean as one that takes 0 and 8 with probability 1/2 each. Their variances are 0 and 16. Center does not determine spread. For a variable with finite second moment, define variance as the expected squared deviation from its mean: [2]

Var(X) = E[(X - mu)^2] = E[X^2] - (E[X])^2.

Why square the distances? Raw deviations average to zero by the definition of the mean, positives canceling negatives, so we square first to make every deviation count positively. The second form (the "computing formula") is usually easier: find the mean of the squares, then subtract the square of the mean. The standard deviation is the square root of the variance and carries the same units as X, which makes it the number you quote.

For a fair die, E[X^2]=91/6 and E[X]=3.5, so Var(X)=91/6-3.5^2=35/12, approximately 2.9167. The SD is sqrt(35/12), approximately 1.7078. This is a root-mean-square deviation, not the mean absolute distance. The latter is (2.5+1.5+0.5+0.5+1.5+2.5)/6=1.5.

Worked example. For the two-coin head count: E[X^2] = 0(1/4) + 1(1/2) + 4(1/4) = 1.5, so Var(X) = 1.5 - 1^2 = 0.5 and the standard deviation is about 0.707. Small numbers, small spread: with only two flips the count cannot wander far from 1.

Variance cannot be negative. A negative computed value signals an error or numerical cancellation, which can occur when subtracting two large nearly equal floating-point numbers. Computing centered squared deviations can be more stable. A variance of zero means the variable equals its mean almost surely; values on probability-zero outcomes do not affect the variance.

The fictional payout contributes 6.125,0.675,8.45 to variance through probability times squared deviation from 3.5. The sum is 15.25,matching 27.5 minus 3.5 squared.
The fictional payout contributes 6.125,0.675,8.45 to variance through probability times squared deviation from 3.5. The sum is 15.25,matching 27.5 minus 3.5 squared.

Linearity and scaling rules

Two rules save enormous effort. For constants a and b: [3]

  • Linearity: when X and Y have finite absolute expectations, E[aX+b]=aE[X]+b and E[X+Y]=E[X]+E[Y]. Independence is not required. Existence conditions prevent undefined expressions involving infinity.
  • Variance scaling: Var(aX + b) = a^2 Var(X). Adding a constant b shifts the data but does not change its spread, so b drops out; multiplying by a stretches spread by a factor of a-squared.

Worked example. Suppose X has mean 5 and variance 4, and we define Y = 2X + 3. Then E[Y] = 2(5) + 3 = 13, and Var(Y) = 2^2 (4) = 16, so the standard deviation of Y is 4. These rules will let us read off the mean and variance of the named distributions in the next lessons without re-deriving them each time.

A physical version makes the rules memorable. Convert daily temperatures from Celsius to Fahrenheit, F = 1.8C + 32. The average converts the same way any temperature does: if the Celsius mean is 20, the Fahrenheit mean is 1.8(20) + 32 = 68. But the +32 does nothing to day-to-day variability; only the stretch factor 1.8 does. A Celsius standard deviation of 5 becomes 1.8 × 5 = 9 Fahrenheit, and the variance multiplies by 1.8^2 = 3.24. Shifts move the center; only rescaling changes the spread.

Worked example: pricing a game. A carnival booth charges 2 dollars to roll one die: you win the face value in dollars if the roll is even, nothing if odd. Let W be the payout. Its pmf: P(W = 2) = P(W = 4) = P(W = 6) = 1/6, and P(W = 0) = 1/2. So E[W] = 2(1/6) + 4(1/6) + 6(1/6) = 12/6 = 2 dollars.

Expected net result: 2 - 2 = 0. This specified game has zero expected net gain before other costs. If a hypothetical operator instead charges 2.50 dollars, its expected receipts minus payouts are 50 cents per play, before expenses. What we just did: build the pmf, weight, add, compare with the price.

Expected values of functions and indicators

If Y=g(X), compute E[g(X)] by weighting g(x) with the original probabilities p(x). You need not derive a new pmf first. For a fair die, E[X^2]=91/6 differs from (E[X])^2=12.25. In general E[g(X)] is not g(E[X]). [2]

An indicator I(A) equals 1 on event A and 0 elsewhere, so E[I(A)]=P(A). If a count is the sum of indicators, its mean is the sum of their success probabilities, even when the indicators are dependent. For two draws without replacement from four red and six blue balls, each draw is red with marginal probability 0.4. The expected red count is 0.8, although the joint chance of two reds is (4/10)(3/9), not 0.4 squared.

Try it

A raffle sells 100 tickets at 1 dollar each; one ticket wins a 60-dollar prize. Let X be your net gain from buying one ticket. Write the pmf of X, then compute E[X]. Work it out before reading on.

Worked answer. Step 1, the values: if you win, you gain 60 - 1 = 59 dollars; if you lose, you are out 1 dollar. Step 2, the pmf: P(X = 59) = 1/100 = 0.01 and P(X = -1) = 99/100 = 0.99. Check: 0.01 + 0.99 = 1. Step 3, weight and add: E[X] = 59(0.01) + (-1)(0.99) = 0.59 - 0.99 = -0.40. On average a ticket costs you 40 cents. What we just did: the same weighted-average recipe, applied to money, with the check that the pmf sums to 1.

Where people get stuck

The name "expected value" causes the most trouble, because E[X] is often a value you never expect on any single trial. No die shows 3.5, and no raffle ticket loses exactly 40 cents. Read E[X] as "long-run average per play," never as "the most likely result." The most likely single value is a different summary (the mode), and the two can disagree sharply.

Next, the squared-versus-unsquared slip in variance. E[X^2] means "square the values first, then weight and add." For the die, that is 91/6. Computing (E[X])^2 = 12.25 instead, or forgetting to subtract it, gives nonsense. Keep the two quantities on separate lines and subtract at the end, and remember the order: mean of squares minus square of the mean, never the reverse, which would go negative.

Variance is expressed in squared units, such as dollars squared. SD restores the original units. If a calculation gives an SD of 1.7078 pips, describe it as the root-mean-square deviation around the mean, not as the literal average absolute distance. The appropriate summary depends on the question.

Linearity does not require independence or identical distributions, but it does require the expectations in the equation to be well defined. For the finite-expectation version used here, check E[|X|] and E[|Y|] are finite. Do not subtract an infinite expectation from another infinite expectation and call the result zero.

Common misconceptions

  • "E[X] is what will happen next." It is the average over many repetitions. Single trials routinely land far from it, and for lopsided bets like raffles, most trials land below it.
  • "Standard deviation is the average distance from the mean." Close but not exact: it is the square root of the average squared distance, which weights big deviations more heavily. It is a usable ruler for "typical distance," not a literal one.
  • "Adding 10 to every value adds 10 to the spread." Shifts move every value together, so distances between values, and hence variance, do not change: Var(X + 10) = Var(X).
  • "A fair game is worth playing." Fair means E = 0, but variance still matters: a fair coin flip for your life savings has expectation zero and enormous spread. Center and spread are separate judgments.

Recap

  • A random variable is a measurable numerical function on a probability space. A discrete variable has a pmf with total mass 1.
  • A finite real expectation requires E[|X|]<infinity. For a discrete law, compute it as the sum of x p(x).
  • With finite second moment, variance is E[X squared]-(E[X]) squared; SD is its nonnegative square root.
  • Finite expectations add without independence. Adding a constant leaves variance unchanged; multiplying by a scales variance by a squared.
  • The long-run average interpretation requires a suitable law of large numbers, such as iid sampling with finite absolute mean.
  • Verify support, total mass, units and existence of the moments before calculating.

Retrieve, explain, and revisit

Close the worked examples before answering: What condition ensures a finite real expectation, and is independence required for adding finite expectations?

Check the reasoning

Finite E[|X|] ensures a finite real mean. For integrable variables, expectations add without independence.

Return after a day, then again after about a week: Let X be equally likely -1 or 1. Compare E[X squared] with (E[X]) squared. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

E[X squared]=1, while E[X]=0 and its square is zero. Nonlinear transformations generally do not commute with expectation.

Sources

  1. Orloff and Bloom, MIT 18.05 (2022), Class 4: Discrete random variables. Cited passages: pp. 2-4.
  2. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 10; p. 11.
  3. Orloff and Bloom, MIT 18.05 (2022), Class 4: Expected value. Cited passages: pp. 2-4.
Key terms
Random variable
A measurable function assigning a numerical value to each outcome; the measurability condition makes its probability events valid.
Probability mass function
p(x) = P(X = x) for a discrete random variable; nonnegative and summing to 1.
Expected value
The probability-weighted mean. A finite expectation requires E[|X|]<infinity; opposite infinite contributions do not define a mean.
Variance
E[(X-E[X]) squared], with the finite-moment computing formula E[X squared]-(E[X]) squared.
Standard deviation
The square root of the variance, in the same units as X.
Linearity of expectation
For integrable X and Y, E[aX+bY]=aE[X]+bE[Y], without requiring independence.

The Bernoulli and Binomial Distributions

  • Recognize a Bernoulli trial and state its mean and variance.
  • Identify the four conditions for a binomial setting.
  • Compute binomial probabilities, mean, and variance.

Many experiments reduce to a single yes-or-no question. Did the coin land heads? Did the customer click? Did the part pass inspection? Repeating that question a fixed number of times and counting the yeses leads to the most important discrete distribution in statistics, the binomial. This lesson builds it from its one-trial ingredient, the Bernoulli distribution, and shows how to compute with it accurately.

The big picture

From here on, the course works with named distributions: standard random variables whose pmf, mean, and variance have been worked out once and for all. A named distribution is a pre-solved template. When a real situation matches the template's conditions, you inherit every formula instantly, no new derivation required. The skill being trained is therefore twofold: recognize when the template applies, and then use its formulas correctly.

For a concrete model, count heads in ten independent fair flips. Each indicator has success probability 1/2, so their sum is binomial. Defects, survey responses and free throws may also be modeled with a binomial distribution, but their independence and common success probability must be examined rather than inferred from the fact that each response is yes or no.

Key idea: a distribution is a reusable answer. Match the setting to the template, then read off probabilities, mean, and variance from stock formulas.

The Bernoulli distribution

A Bernoulli variable takes values 0 and 1, with P(X=1)=p and P(X=0)=1-p, where 0 is less than or equal to p and p is less than or equal to 1. It can be an indicator derived from a richer experiment, such as whether a card is a heart. Success is the name of the event coded 1, not a judgment about whether it is desirable. Its mean and variance follow directly: [1]

  • E[X] = 1(p) + 0(1 - p) = p.
  • Var(X) = E[X^2] - p^2 = p - p^2 = p(1 - p).

The variance line uses a small trick worth seeing: since X is only ever 0 or 1, squaring changes nothing, 0 squared is 0 and 1 squared is 1, so E[X^2] = E[X] = p. Then the computing formula gives p - p², which factors as p(1 - p).

For a fair coin (success = heads, p = 0.5), the mean is 0.5 and the variance is 0.25. For p = 0.6, the mean is 0.6 and the variance is 0.6 x 0.4 = 0.24. For p = 0.9 the variance falls to 0.9 x 0.1 = 0.09. Notice the pattern: variance is largest at p = 0.5, where the trial is most unpredictable, and shrinks toward 0 as p approaches 0 or 1, where the outcome is nearly a foregone conclusion. The formula p(1 - p) is quietly measuring how uncertain a yes-no question is.

The binomial setting

A binomial random variable X counts the number of successes in n Bernoulli trials. Four conditions must hold (the "BINS" checklist): [1]

  1. Binary: each trial is a success or a failure.
  2. Independent: the joint probabilities of the trial indicators factor into products.
  3. Number fixed: the number of trials n is set in advance.
  4. Same probability: the success probability p is the same on every trial.

Practice the checklist on near misses, because they are common. Drawing 5 cards without replacement and counting hearts fails the I: each draw changes the deck, so trials are dependent (that count has its own distribution, the hypergeometric). Flipping until the first head fails the N: the number of flips is not fixed in advance (that is the geometric distribution, next lesson). Free throws in a game where fatigue grows fails the S if p drifts. These conditions justify deriving the count as a sum of independent same-p Bernoulli indicators.

The binomial formula

The probability of exactly k successes in n trials is

P(X = k) = C(n, k) p^k (1 - p)^(n - k).

The formula has two working parts, and each is worth hearing separately. The tail p^k (1 - p)^(n-k) is the probability of one specific ordering of k successes and n - k failures: by independence, the per-trial probabilities multiply. The front C(n, k) counts how many orderings exist, using last module's combinations, because the successes can sit in any k of the n trial slots. [2]

See it concretely with n = 3, k = 2, p = 0.5. The orderings with two successes are SSF, SFS, and FSS, and each has probability (0.5)^2 (0.5)^1 = 1/8. Three disjoint orderings at 1/8 apiece: P(X = 2) = 3/8. The formula packages that count-times-probability argument: C(3, 2) = 3 orderings, each at p^2(1-p).

Worked example. Flip a fair coin independently 5 times. What is the probability of exactly 3 heads? Here n = 5, k = 3, p = 0.5:

P(X = 3) = C(5, 3) (0.5)^3 (0.5)^2 = 10 x (0.5)^5 = 10/32 = 0.3125.

Worked example with p not equal to 0.5. A quiz has 10 questions, each answered correctly with probability 0.3, independently. The probability of exactly 2 correct is

P(X = 2) = C(10, 2) (0.3)^2 (0.7)^8 = 45 x 0.09 x 0.05765 = 0.2335.

Follow the arithmetic order: the combination first (45), then each power separately (0.3 squared is 0.09; 0.7 to the eighth is 0.05765), then multiply the three pieces. Powers before products prevents most calculator slips.

Questions about ranges add the relevant exact probabilities, since different values of k are disjoint events. For the 5-flip coin, P(at least 4 heads) = P(X = 4) + P(X = 5) = 5/32 + 1/32 = 6/32 = 0.1875. And "at most" questions often go fastest by complement: P(at most 3 heads) = 1 - 0.1875 = 0.8125.

The binomial(10,0.3) pmf on integers 0 through 10 sums to one. Its mean is 3 and variance 2.1. Independence and a common success probability justify this count law.
The binomial(10,0.3) pmf on integers 0 through 10 sums to one. Its mean is 3 and variance 2.1. Independence and a common success probability justify this count law.

Mean and variance of a binomial

Because a binomial X is the sum of n independent Bernoulli variables, one per trial, its mean and variance are n times the Bernoulli values: [3]

E[X] = np and Var(X) = np(1 - p).

By linearity, the sum has mean np because each indicator contributes p. For the fictional ten-question model with p=0.3, E[X]=3, Var(X)=2.1, and SD(X) is approximately 1.4491. The mean minimizes expected squared prediction error among constant real-valued predictions. It need not be an attainable count or the most probable count.

In a fictional model with 20 independent attempts and success probability 0.75, the mean count is 15 and the SD is sqrt(3.75), approximately 1.9365. A count of 9 is about 3.10 SD below the mean. That standardized distance is not itself a tail probability; calculate the relevant binomial tail to quantify how unusual the count is under the model. Actual success probabilities can vary with conditions.

For fixed n, the binomial pmf is symmetric when p=1/2, often right-skewed when p is small, and left-skewed when p is large. For 0<p<1, a mode is floor((n+1)p); if (n+1)p is an integer, that integer and the preceding integer are both modes. The endpoints p=0 and p=1 are degenerate at 0 and n. Check the support and formula instead of assuming the most likely count is the mean.

In a fictional inspection model, ten independent items each have defect probability 0.02. Then P(X=0)=0.98^10, approximately 0.81707, so P(X at least 1) is approximately 0.18293. Also P(X=1)=10(0.02)(0.98)^9, approximately 0.16675. A large production volume alone would not establish independence, since batch conditions or a common machine could link defects.

With fixed p=0.3,binomial count SD grows as sqrt(n p(1-p)),while the proportion SD shrinks as sqrt(p(1-p)/n). Both statements refer to the same independent-trial model.
With fixed p=0.3,binomial count SD grows as sqrt(n p(1-p)),while the proportion SD shrinks as sqrt(p(1-p)/n). Both statements refer to the same independent-trial model.

Try it

A 4-question multiple-choice quiz has 4 options per question, and you guess every answer blindly, so p = 0.25 per question, independently. Find the probability of exactly 2 correct. Work it out before reading on.

Worked answer. Step 1, check BINS: binary (right or wrong), independent guesses, n = 4 fixed, same p = 0.25. Step 2, the pieces: C(4, 2) = 6; (0.25)^2 = 0.0625; (0.75)^2 = 0.5625. Step 3, multiply: P(X = 2) = 6 x 0.0625 x 0.5625 = 0.211, about 21%. What we just did: combination, success power, failure power, product, in that order every time.

Where people get stuck

The most frequent slip is dropping the C(n, k) factor. The bare product p^k(1-p)^(n-k) is the probability of one particular arrangement, and unless the question names an exact arrangement ("the first three flips are heads, then two tails"), you must count all the arrangements that deliver k successes. If your binomial answer looks suspiciously small, the missing combination is the first suspect. [1]

Second, exponent swaps. The exponent on p is the success count k; the exponent on 1 - p is the failure count n - k. In the quiz example, writing (0.3)^8(0.7)^2 instead of (0.3)^2(0.7)^8 changes the answer by orders of magnitude. Label each factor in words, "two successes, eight failures," before raising anything to a power.

Third, answering "at least" with "exactly." P(at least one defect) is not P(exactly one); it is 1 - P(none), or a sum of exact terms. Translate the words into a set of k values first, then decide whether direct addition or the complement is shorter.

For a simple random sample without replacement from N items containing K successes, the exact count is hypergeometric: P(X=k)=C(K, k)C(N-K, n-k)/C(N, n) for feasible k. Its variance includes the finite-population factor (N-n)/(N-1), for N greater than 1. A small sampling fraction can motivate a binomial approximation, but a fixed 10% rule does not guarantee a desired error for every tail probability.

Common misconceptions

  • "The most likely count is n/2." The distribution centers at np, not n/2. For n = 10, p = 0.3, counts near 3 are most likely, and 5 heads-style intuition misleads.
  • "np must be a whole number." The mean is an average, not a possible value: n = 5, p = 0.3 gives E[X] = 1.5 successes, a perfectly sensible long-run rate.
  • "Binomial requires p = 0.5." Any p in [0,1] is allowed; the endpoints give constant counts, and p=0.5 gives a symmetric pmf.
  • "The count becomes less variable as n grows." With fixed 0<p<1, the count SD grows as sqrt(np(1-p)), while the proportion X/n has SD sqrt(p(1-p)/n), which decreases. A normal approximation concerns the standardized count as n grows with p fixed; large n alone is not enough if p changes toward an endpoint.

Recap

  • A Bernoulli(p) variable has mean p and variance p(1-p), whose largest value is 1/4 at p=1/2.
  • The sum of n independent Bernoulli trials with a common p is binomial(n, p).
  • Its pmf is C(n, k)p^k(1-p)^(n-k) for integer k from 0 to n, with endpoint parameters interpreted as degenerate laws.
  • The count has mean np and variance np(1-p). Its proportion has variance p(1-p)/n for n>0.
  • Tail probabilities sum the appropriate masses. Moments alone do not determine those tails.

Retrieve, explain, and revisit

Close the worked examples before answering: Which part of the binomial construction fails for draws without replacement from a small mixed population?

Check the reasoning

The success indicators are dependent. Under uniform sampling without replacement, use a hypergeometric count when the population composition is fixed.

Return after a day, then again after about a week: For binomial(n, p), compare the variance of the count with the variance of its proportion X/n. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

Count variance is np(1-p). Dividing the count by n divides variance by n squared, giving p(1-p)/n for the proportion.

Sources

  1. Orloff and Bloom, MIT 18.05 (2022), Class 4: Discrete random variables. Cited passages: pp. 6-7; pp. 7-8; p. 8.
  2. NIST/SEMATECH e-Handbook, Binomial distribution. Cited passages: pmf formula.
  3. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 16.
Key terms
Bernoulli trial
A trial classified by a binary success indicator, with probability p of success; the underlying experiment may have more than two detailed outcomes.
Bernoulli distribution
The distribution of one trial; mean p and variance p(1 - p).
Binomial distribution
The count of successes in n independent trials with fixed success probability p.
Binomial formula
P(X = k) = C(n, k) p^k (1 - p)^(n-k).
BINS conditions
Binary trials, Independent, Number of trials fixed, Same probability p.
Binomial mean and variance
E[X] = np and Var(X) = np(1 - p).

The Poisson and Geometric Distributions

  • Distinguish a Poisson count model from merely knowing an average event rate.
  • Compute Poisson probabilities, mean, and variance.
  • Apply the geometric distribution to model the number of trials until the first success.

Two more discrete distributions round out the essential toolkit: the Poisson, for counting events in a span of time or space, and the geometric, for waiting until the first success. Both are one-parameter templates, both come with clean formulas, and both describe an enormous range of real processes, from help-desk calls and typos to lottery streaks and equipment failures.

The big picture

A window count and a mean do not determine a distribution. Three arrivals could occur regularly, in clusters, or as a Poisson process, even if the mean per window is the same. A Poisson random variable is defined by its pmf. One mechanism that produces it is a homogeneous Poisson process with independent increments and a constant rate.

The geometric model instead counts trials through the first success, provided the Bernoulli trials are independent and share a fixed probability p greater than 0. Real sales calls, repeated start attempts and inspections need not satisfy those conditions. The question suggests a candidate model; the assumptions decide whether its formula is justified.

Key idea: Poisson counts events in an interval at a known average rate; geometric counts the trials spent waiting for the first success.

The Poisson distribution

A Poisson variable has parameter lambda greater than or equal to 0, the expected count in the specified window. For lambda greater than 0, its pmf is the expression below. The case lambda=0 places all mass at 0. In a homogeneous Poisson process with rate r per unit time, the count over duration t is Poisson with lambda=rt. Independent counts in disjoint intervals and the process assumptions are additional structure, not consequences of knowing one interval's average. [1]

P(X = k) = e^(-lambda) lambda^k / k!,

where e is the constant 2.71828..., the base of natural logarithms. Read the formula aloud: "e to the minus lambda, times lambda to the k, divided by k factorial." A defining feature is that the Poisson mean and variance are equal:

E[X] = lambda and Var(X) = lambda.

Worked example. Model a fictional call-center minute as Poisson with mean lambda=3. Find the probability of exactly 2 calls in a given minute:

P(X = 2) = e^(-3) 3^2 / 2! = e^(-3) x 9 / 2 = 0.049787 x 4.5 = 0.2240.

The probability of no calls is P(X = 0) = e^(-3) = 0.0498, using lambda^0 = 1 and 0! = 1. The probability of at most one call is P(X = 0) + P(X = 1) = e^(-3)(1 + 3) = 0.0498 x 4 = 0.1991, and so, by the complement, P(at least 2 calls) = 1 - 0.1991 = 0.8009.

Distinguish rate r from expected count lambda. At r=3 calls per minute in a homogeneous Poisson process, a two-minute window has lambda=rt=6; a 20-second window has lambda=1. Lambda is the expected count for the chosen interval. A rate cannot be inserted into a count formula until the window and units are specified.

Where does this formula come from? The Poisson is the binomial pushed to a limit: many tiny opportunities, each rarely taken, with a steady expected total np. Picture a 1,000-word page where each word independently carries a typo with probability 0.002, so lambda = np = 2 typos on average. The binomial gives P(no typos) = (0.998)^1000 = 0.135, and the Poisson gives e^(-2) = 0.135, agreeing to three decimals. As n grows and p shrinks with np fixed, the agreement becomes exact. That is why the Poisson fits situations with countless small chances: each moment is a micro-trial, and lambda is the budget of expected events.

To see why a matching mean is insufficient, compare two constructed count distributions with mean 2. Model A is Poisson(2), so its variance is 2 and P(X=0)=exp(-2), approximately 0.1353. Model B is 0 or 4 with probability 1/2 each, so its variance is 4 and P(X=0)=0.5. Both average two events, but their chance of an empty window differs sharply. Matching a mean, or even a mean and variance, does not establish an entire distribution.

Key idea: Poisson = counts from many small independent chances at a steady rate. Set lambda to the average for your window, and mean equals variance equals lambda.

A Poisson(2) count and a law placing probability 1/2 on 0 and 4 both have mean 2. Their variances and event probabilities differ. The Poisson panel displays counts through 8,with a remaining tail beyond 8.
A Poisson(2) count and a law placing probability 1/2 on 0 and 4 both have mean 2. Their variances and event probabilities differ. The Poisson panel displays counts through 8,with a remaining tail beyond 8.

The geometric distribution

The geometric distribution models the number of independent Bernoulli trials (each with success probability p) needed to get the first success. The random variable X takes values 1, 2, 3, ... (the trial on which the first success lands). To get the first success on trial k, the first k - 1 trials must fail and the kth must succeed. Independence multiplies those requirements: [2]

P(X = k) = (1 - p)^(k - 1) p.

Read it as a story: "fail, fail, ..., fail (k minus 1 times), then succeed." Its mean and variance are

E[X] = 1 / p and Var(X) = (1 - p) / p^2.

The mean 1/p is intuitive: if each trial succeeds with probability p, you expect to wait about 1/p trials for the first success. A die's 6 shows up in about 6 rolls; a 1-in-100 scratch ticket pays in about 100 tickets. Notice the variance grows fast as p shrinks: rare successes make waits not only long on average but wildly variable.

Worked example. Each attempt to start an old lawnmower succeeds with probability p = 0.2, independently. On average it takes 1/0.2 = 5 pulls. The probability the first success is on the third pull is

P(X = 3) = (0.8)^2 (0.2) = 0.64 x 0.2 = 0.128.

The probability it takes more than 3 pulls is the probability the first 3 all fail: P(X greater than 3) = (0.8)^3 = 0.512. This clean "all failures so far" form, P(X greater than k) = (1 - p)^k, is the geometric's survival function and its fastest computational route.

It also exposes the distribution's signature: memorylessness. Given no success yet, the future looks the same as a fresh start. Ten failed pulls in, the chance the next 3 pulls also fail is still (0.8)^3 = 0.512, exactly as it was at pull one. The mower does not remember your effort. This is the flip side of the gambler's fallacy from the independence lesson: no success is "due," ever, because each trial resets the clock.

Worked example: the coupon collector

Geometric waits stack beautifully. Suppose a cereal brand packs one of 6 toys, chosen uniformly and independently across boxes, in each box, and you want the full set. How many boxes on average? Split the quest into 6 stages, one per new toy, and use linearity of expectation from the random-variables lesson. [2]

  • Stage 1: any toy is new, p = 6/6, expected wait 1 box.
  • Stage 2: 5 of 6 toys are new, p = 5/6, expected wait 6/5 = 1.2 boxes.
  • Stage 3: p = 4/6, expected wait 1.5 boxes. Then 6/3 = 2, then 6/2 = 3, and finally p = 1/6, expected wait 6 boxes.

Total: 1 + 1.2 + 1.5 + 2 + 3 + 6 = 14.7 boxes on average. Each stage is a geometric wait, expectation 1/p, and expectations add even though the stages are random. Notice the shape of the answer: the last missing toy requires six additional boxes on average, the largest individual stage; the preceding five stages total 8.7 boxes on average.

The expected waits for successive new types are 1,1.2,1.5,2,3,6 under independent uniform six-type draws. The last wait is the largest single stage but is less than the combined 8.7-box expectation for the first five stages.
The expected waits for successive new types are 1,1.2,1.5,2,3,6 under independent uniform six-type draws. The last wait is the largest single stage but is less than the combined 8.7-box expectation for the first five stages.

Choosing the right model

  • Binomial: fixed number of trials n, count the successes.
  • Poisson: no fixed n, count events over an interval at a known rate.
  • Geometric: keep trying until the first success, count the trials.

For 50 seeds, a binomial model requires independent sprouting indicators with common p. For customers in an hour, a Poisson model requires a justified count model, not merely an available average. For auditions until a callback, a geometric model requires independent trials and fixed p, conditions that learning or changing opportunities may violate. Identify both what is counted and why the model is plausible. [2]

Try it

Two quick ones. (a) Model a server's one-hour error count as Poisson with mean 1.5. What is the probability of a completely error-free hour? (b) You roll a fair die independently until the first 6. What is the probability the first 6 arrives exactly on roll 4? Work both before reading on.

Worked answer. (a) Poisson with lambda = 1.5 for the one-hour window: P(X = 0) = e^(-1.5) = 0.223, about a 22% chance of a quiet hour. (b) Geometric with p = 1/6: three failures then a success, P(X = 4) = (5/6)^3 (1/6) = (125/216)(1/6) = 125/1296 = 0.096, just under 10%. What we just did: (a) asked for a count in a window, (b) asked for a wait until a hit, and each question picked its own distribution.

Where people get stuck

Distinguish a process rate from the expected count for a window. Under a homogeneous Poisson process with rate 3 calls per minute, a 90-second window lasts 1.5 minutes and has count parameter lambda=3(1.5)=4.5. Insert 4.5 into the Poisson pmf. A measured average of 3 calls per minute alone would not establish the process assumptions. [2]

A homogeneous Poisson process has independent counts in disjoint time intervals and Poisson interval counts with mean proportional to duration. Clustering or changing rates may make that model unsuitable. A sample variance above the sample mean is a useful diagnostic prompt, not proof of a particular alternative, since empirical summaries fluctuate. A Poisson marginal for one count also does not prove independence of successive counts.

Third, conventions. Our geometric counts all trials including the successful one, so X starts at 1 and E[X] = 1/p. Some textbooks count only the failures before the first success, so their variable starts at 0 and has mean (1 - p)/p. Both are fine; mixing them mid-problem is not. Check which count a formula expects before borrowing it.

Fourth, small algebra traps in P(X = 0): lambda^0 = 1 and 0! = 1, so P(X = 0) = e^(-lambda), nothing more. Writing 0 for either piece zeroes out a perfectly good probability.

Common misconceptions

  • "A count and an average automatically imply Poisson." The mean does not determine the distribution. Examine the mechanism and distributional pattern; use the Poisson formula only as an explicit, assessable model.
  • "If lambda = 3, then 3 is far likelier than its neighbors." The pmf is fairly flat near its center: P(X = 2) and P(X = 3) both equal 4.5e^(-3) = 0.224. The mean is a center of mass, not a spike.
  • "After many failures, the first success is overdue." Memorylessness says the wait ahead is distributed as if you had never started; a changing selection mechanism can instead change the next-trial probability.
  • "Mean 1/p means success is guaranteed within 1/p trials." With p = 0.2, the chance of needing more than 5 pulls is (0.8)^5 = 0.328, roughly a third. The mean is a long-run average, not a deadline.

Recap

  • A Poisson(lambda) law assigns exp(-lambda)lambda^k/k! to nonnegative integer k. Mean and variance are lambda; a mean alone does not identify the law.
  • A homogeneous Poisson process with rate r has a length-t count parameter lambda=rt. State both units and process assumptions.
  • For independent Bernoulli(p) trials, 0<p<=1, the number of trials through the first success is geometric with mean 1/p and variance (1-p)/p squared.
  • The geometric survival P(X>k)=(1-p)^k for integer k>=0 gives its discrete memoryless property.
  • For independent uniformly distributed draws among six toy types, the expected collection time is 6(1+1/2+1/3+1/4+1/5+1/6)=14.7 draws.
  • Choose a distribution by its assumptions and support as well as the question being asked. Many count and waiting-time models exist.

Retrieve, explain, and revisit

Close the worked examples before answering: How do the Poisson process rate and count parameter differ?

Check the reasoning

If the rate is r per time unit, a length-t window has count mean lambda=rt. Rate and count parameter have different units.

Return after a day, then again after about a week: A homogeneous Poisson process has rate 2 per hour. What is P(no events in 15 minutes)? Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

Fifteen minutes is 0.25 hour, so lambda=0.5 and P(0)=exp(-0.5), about 0.606531.

Sources

  1. NIST/SEMATECH e-Handbook, Poisson distribution. Cited passages: pmf and moments.
  2. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 16; trials-through-success convention; pp. 10 and 16; linearity and geometric means; pp. 16 and 48-49; pp. 48-49; rate times duration.
Key terms
Poisson distribution
A discrete distribution with pmf exp(-lambda)lambda^k/k!, whose mean and variance are the nonnegative count parameter lambda.
Count parameter (lambda)
The Poisson count mean for the specified window. If a homogeneous process has rate r per time unit, lambda=rt in a window of length t.
Poisson pmf
P(X = k) = e^(-lambda) lambda^k / k! for k = 0, 1, 2, ...
Geometric distribution
The number of iid Bernoulli(p) trials through the first success, with p>0 and pmf (1-p)^(k-1)p for k>=1.
Geometric mean
E[X] = 1/p, the expected number of trials to the first success.
Memoryless property
For a geometric waiting count, P(X>m+n|X>m)=P(X>n), with nonnegative integers m, n and a defined positive-probability condition.

Module 4: Continuous Random Variables

Probability as area under a density curve, and the three key continuous models: uniform, exponential, and normal.

Continuous Random Variables and the Uniform Distribution

  • Explain how a probability density function assigns probability as area.
  • Explain why point probabilities vanish for a variable with a density, without equating probability zero with impossibility.
  • Compute probabilities, mean, and variance for a uniform distribution.

Some quantities, like waiting times, heights, or temperatures, vary continuously and can take any value in an interval. A bus can arrive after 4 minutes, 4.3 minutes, or 4.31779 minutes; between any two possible values sit infinitely many more. For these we replace the probability mass function with a probability density function, and probability itself changes costume: it becomes area under a curve.

The big picture

A density histogram represents each bin's relative frequency by its area: bar height is count divided by sample size and bin width. A density curve describes a probability model that can be compared with such a histogram. Narrowing bins in a fixed sample does not automatically produce a smooth true density. More data and an appropriate choice of bin width are needed for useful estimation.

One habit has to update. In the discrete world we asked "what is the probability X equals this value?" In the continuous world that question always answers zero, and the useful questions are about intervals: the probability the wait is under 5 minutes, or between 4 and 7. Areas answer interval questions, and the whole apparatus of this module, uniform now, exponential and normal next, is machinery for computing such areas.

Key idea: continuous probability is area under a density curve. Individual points carry no area; intervals do.

Density and area

This lesson uses absolutely continuous distributions, which have a probability density f(x). Probability over an interval is the integral of f across that interval. Some continuous distributions do not have a density, and some variables mix point masses with a density; those require a more general distribution function. For the density models studied here, the requirements are: [1]

  • f(x) is greater than or equal to 0 everywhere (no negative density).
  • The total area under f(x) equals 1.

Because f(x) is a height, not a probability, it can legally exceed 1. A uniform density on the interval from 0 to 0.5 has height 2, and nothing is wrong: the rectangle's area is 0.5 × 2 = 1, exactly as required. Densities report probability per unit of x, the way a population-density map reports people per square mile; only when height is multiplied by width does a probability appear.

Under a density model, P(X=c)=0 for every exact c, because integrating over one point gives zero. Intervals are common events with positive probability, but unions and other measurable sets can also have positive probability. A set can be nonempty and still have probability 0. Zero probability is not a general definition of impossibility or of small physical size.

A useful consequence: for continuous variables, P(X is less than c) and P(X is less than or equal to c) are equal, since the endpoint contributes nothing. Endpoint fussiness, which genuinely matters for discrete counts, evaporates here.

One more piece of vocabulary earns its keep now and pays off for the rest of the course. The cumulative distribution function (cdf) is F(x) = P(X less than or equal to x), the total area to the left of x. It climbs from 0 to 1 as x sweeps across the possible values, and any interval probability is a difference of two cdf values: P(a less than X less than or equal to b) = F(b) - F(a). Left-area in, subtraction out.

For uniform[2,6],the event 1<X<3 contributes only the supported interval (2,3). The area is 1/4 and equals the cdf difference F(3)-F(1).
For uniform[2,6],the event 1<X<3 contributes only the supported interval (2,3). The area is 1/4 and equals the cdf difference F(3)-F(1).

The uniform distribution

The uniform distribution on an interval from a to b, with a less than b, spreads probability evenly, so its density is a flat, constant height. To make the total area (a rectangle of width b - a) equal 1, the height must be [2]

f(x) = 1 / (b - a) for x between a and b, and 0 otherwise.

Read that aloud: "one over the length of the interval." A longer interval spreads the same 1 unit of probability thinner, so the flat height drops. The uniform is the continuous version of "equally likely": every sub-interval of the same width captures the same probability, provided the sub-interval lies within the support.

Its mean sits at the midpoint and its variance follows a standard formula:

E[X] = (a + b) / 2 and Var(X) = (b - a)^2 / 12.

To derive the variance, first write X=a+(b-a)U with U uniform on [0,1]. Integrating gives E[U]=integral from 0 to 1 of u du=1/2 and E[U^2]=integral from 0 to 1 of u^2 du=1/3. Thus Var(U)=1/3-1/4=1/12. The scaling rule gives Var(X)=(b-a)^2/12. In particular, [0,8] and [100,108] both have variance 64/12, approximately 5.3333.

Uniform[2,10] has density 1/8 per minute on its support. The interval (4,7) has width 3 and probability 3/8. Density height is not a probability at an exact point.
Uniform[2,10] has density 1/8 per minute on its support. The interval (4,7) has width 3 and probability 3/8. Density height is not a probability at an exact point.

Worked example

A bus arrives at a uniformly random time between 2 and 10 minutes after you reach the stop, so a = 2 and b = 10. The density height is 1 / (10 - 2) = 1/8 = 0.125. Probabilities are just rectangle areas (width times height): [2]

  • P(X is less than 5) = (5 - 2) x (1/8) = 3/8 = 0.375.
  • P(4 is less than X is less than 7) = (7 - 4) x (1/8) = 3/8 = 0.375.

For the interval from 2 to 5, the width is 3 and the density is 1/8, so its probability is 3/8. The interval from 4 to 7 also has width 3 and the same probability. Both intervals lie within the support [2,10]. A requested interval that extends outside the support must first be clipped to the support.

The mean wait is (2 + 10)/2 = 6 minutes, and the variance is (10 - 2)^2 / 12 = 64/12 = 5.333, so the standard deviation is about 2.31 minutes.

Two extensions squeeze more out of the same rectangle. First, tails: P(X greater than 8) = (10 - 8) x (1/8) = 2/8 = 0.25; a quarter of days the bus makes you wait more than 8 minutes. Second, percentiles run the machine backwards.

The 25th percentile is the x with area 0.25 to its left, so solve (x - 2)(1/8) = 0.25 to get x = 4 minutes. The 75th percentile solves (x - 2)(1/8) = 0.75, giving x = 8. The middle half of your waits lands between 4 and 8 minutes. What we just did: forward questions multiply width by height; backward questions divide area by height to find the width.

Why the uniform matters beyond buses

Many simulation methods begin with draws designed to approximate independent uniform values on [0,1]. For example, if U is uniform on [0,1], then a+(b-a)U is uniform on [a, b]. Pseudorandom software uses a deterministic algorithm and finite precision; a recorded seed can reproduce its sequence, but the output is not an ideal continuum. Simulation estimates fluctuate, and a simulation of a model does not validate its assumptions about real observations. [3]

Try it

Let X be uniform on the interval from 1 to 7. Find the density height, P(2 < X < 5), the mean, and the standard deviation. Work all four before reading on.

Worked answer. Step 1: height = 1/(7 - 1) = 1/6 = 0.167. Step 2: the window from 2 to 5 has width 3, so P = 3 x (1/6) = 1/2 = 0.5. Step 3: mean = (1 + 7)/2 = 4. Step 4: variance = (7 - 1)^2 / 12 = 36/12 = 3, so the standard deviation is square root of 3 = 1.73. What we just did: every answer came from the same three numbers, a, b, and the width of the window in question.

Where people get stuck

A density value is not a point probability. For a constant density of 1/8 per minute, a one-minute interval within the support has probability 1/8. For a nonconstant density, use an integral; height times width is generally only an approximation over a short interval. Density has reciprocal units to x, while the integrated probability has no units. [3]

Second, forgetting the support, the interval where the density lives. For the bus, P(X less than 12) = 1, not (12 - 2)/8 = 1.25: the rectangle ends at 10, and area beyond it does not exist. Clip every window to [a, b] before multiplying, and a probability above 1 is the alarm that you forgot.

Third, over-carrying discrete habits. In the discrete world, P(X < 3) and P(X less than or equal to 3) can differ by a whole lump of probability; continuous variables have no lumps, so the two match. Meanwhile the truly continuous novelty, that possible values have probability zero, runs the other direction and takes a while to settle. Both are consequences of one fact: points have no width.

Common misconceptions

  • "Probability zero means impossible." In continuous settings, every exact outcome has probability zero, yet one of them occurs. Impossibility implies probability zero, but not the reverse.
  • "Uniform probability singles out a most likely exact value." Every individual point has probability 0. The usual uniform density is flat, so it has no unique density peak. Equal-width intervals wholly inside the support have equal probabilities.
  • "Densities are capped at 1." Only areas are capped at 1. Heights can be any nonnegative size, provided the total area is exactly 1.
  • "Continuous models are exotic." Rounding aside, most measured quantities, times, weights, voltages, percentages, are modeled continuously, and the next two lessons cover the two most used continuous families after the uniform.

Recap

  • An absolutely continuous law has a nonnegative density integrating to 1. Probabilities are density integrals over events.
  • Every singleton has probability zero under such a law, so including or excluding interval endpoints does not affect interval probability.
  • The cdf F(x)=P(X<=x) works for every real-valued probability law, including laws that have no density.
  • For uniform[a, b] with a<b, the density is 1/(b-a) on the support, mean (a+b)/2 and variance (b-a) squared/12.
  • Clip a proposed interval to the support before multiplying width by height. Equal widths have equal probabilities only within the uniform support.

Retrieve, explain, and revisit

Close the worked examples before answering: Why may a density height exceed one while a probability cannot?

Check the reasoning

Density has probability-per-unit scale. Its integral over the support must be one; a narrow support can require a height above one.

Return after a day, then again after about a week: X is uniform on [2,6]. Find P(1<X<3) and explain how the support changes the interval. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

Only (2,3) contributes. Its length is 1 within total width 4, so the probability is 1/4.

Sources

  1. Scott Sheffield, MIT 18.175 (2014), Lecture 3: Distributions. Cited passages: pp. 6 and 11; cdf and singular counterexample.
  2. NIST/SEMATECH e-Handbook, Uniform distribution. Cited passages: density and common statistics; cdf and uniform parameters.
  3. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 31; affine transformation; p. 19.
Key terms
Continuous random variable
In this lesson, an absolutely continuous real variable whose probabilities are obtained by integrating a density. A continuous cdf alone need not imply a density.
Probability density function
A function f(x) whose area over an interval gives the probability X lands there.
Area equals probability
For a continuous variable, P(a < X < b) is the area under f(x) from a to b.
Zero point probability
For continuous X, P(X = c) = 0 because a single point has no width.
Uniform distribution
A distribution with density 1/(b-a) on [a, b], zero outside, and a<b.
Uniform mean and variance
E[X] = (a + b)/2 and Var(X) = (b - a)^2/12.

The Exponential Distribution

  • Describe the exponential distribution as a model for waiting times.
  • Use the exponential survival function to compute tail probabilities.
  • Relate the exponential rate to its mean and connect it to the Poisson process.

In a homogeneous Poisson process, disjoint time intervals have independent counts and an interval of length t has a Poisson count with mean lambda times t. Its successive waiting times are independent exponential variables with rate lambda. Knowing only an average arrival rate, or a Poisson distribution for a single window, does not establish this process or its waiting-time law.

The big picture

Compare two models with two arrivals per hour on average. Perfectly regular arrivals have half-hour gaps. A Poisson process with rate 2 per hour has exponential gaps with the same half-hour mean but positive variance. Equal average rates do not imply equal waiting-time distributions. The exponential model supplies a specific declining density and a constant conditional failure or arrival rate.

The distribution is run by one number, the rate lambda. Everything else, the mean wait, the spread, every tail probability, is a one-line formula in lambda. That economy plus one strange, powerful property, memorylessness, is the whole lesson.

Key idea: the exponential describes gaps between steady-rate arrivals: frequent short waits, exponentially fading long ones, all controlled by the single rate lambda.

Density and rate

For a rate lambda greater than 0, the exponential density for x greater than or equal to 0 is

f(x) = lambda e^(-lambda x).

Read it aloud: "lambda, times e to the minus lambda x." The density starts at its highest value lambda at x = 0 and decays toward 0, so short waits are more likely than long ones. Its mean and variance are [1]

E[X] = 1 / lambda and Var(X) = 1 / lambda^2.

The mean 1/lambda is the average time between events: if arrivals form a Poisson process with rate 2 per hour, the wait from a fixed observation time has mean 1/2 hour. The reciprocal works both directions. Rate 4 calls per hour means a mean gap of 1/4 hour, 15 minutes; a mean gap of 4 minutes means a rate of 1/4 per minute. Keeping "rate" and "mean" straight is mostly a matter of watching units: lambda carries units of events per time, the mean carries time.

Notice one more signature: the standard deviation is the square root of 1/lambda^2, which is 1/lambda, identical to the mean. An exponential wait is as variable as it is long, which is why arrival gaps feel so irregular even at a steady average rate.

Exponential rates .5,1,2 per hour have mean waits 2,1,.5 hours. Each hazard is constant at its rate,while its density decreases with time.
Exponential rates .5,1,2 per hour have mean waits 2,1,.5 hours. Each hazard is constant at its rate,while its density decreases with time.

The survival function

The survival function gives the probability that a wait exceeds t. For an exponential variable with rate lambda>0, it is

P(X greater than t)=exp(-lambda t) for t greater than or equal to 0. [1]

For t>=0, the cdf is F(t)=1-exp(-lambda t). For 0<=a<b, subtract survivals to obtain P(a<X<=b)=exp(-lambda a)-exp(-lambda b). For negative thresholds, account for the nonnegative support before using these formulas.

To find the median, solve exp(-lambda t)=1/2. Taking logarithms gives t=ln(2)/lambda, approximately 0.693147/lambda. This is less than the mean 1/lambda. Keep ln(2) exact until the last calculation step. This median is a consequence of the stipulated exponential law.

In a fictional exponential lifetime model with rate 0.5 per year, the median is ln(2)/0.5, approximately 1.3863 years, while the mean is 2 years. Conversely, a specified median of 10 years corresponds to rate ln(2)/10, approximately 0.06931 per year. Keep ln(2) unrounded until the final step. These are model calculations, not measured component lifetimes.

Worked example

Suppose the time (in hours) until the next customer arrives is exponential with rate lambda = 0.5 per hour, so the mean wait is 1 / 0.5 = 2 hours. Then:

  • P(wait more than 3 hours) = e^(-0.5 x 3) = e^(-1.5) = 0.2231.
  • P(wait at most 2 hours) = 1 - e^(-0.5 x 2) = 1 - e^(-1) = 1 - 0.3679 = 0.6321.

Walk the first one in steps. Step 1: identify the question as a tail, "more than," so use the survival function. Step 2: multiply rate times time, lambda t = 0.5 × 3 = 1.5, watching that hours multiply hours-to-the-minus-one. Step 3: evaluate e^(-1.5) = 0.2231. A between-times question stacks two of these: P(1 < X < 3) = e^(-0.5 x 1) - e^(-0.5 x 3) = 0.6065 - 0.2231 = 0.3834, the survival at the near edge minus the survival at the far edge.

In the sketch, the shaded region is the tail area beyond t, and its size is the single exponential term e^(-lambda t). Every survival probability is one shaded tail like this one, which is why exponential arithmetic stays so short.

The memoryless property

Like the geometric distribution, the exponential is memoryless: P(X greater than s+t given X greater than s)=P(X greater than t) for s, t greater than or equal to 0. If a machine has already run 5 hours without failing, the chance it lasts 3 more hours is the same as a brand-new machine lasting 3 hours. The exponential does not "age," which makes it the standard model for the lifetime of components with a constant failure rate and for the gaps between random arrivals. [2]

The proof is one division. With lambda = 0.5, ask for P(X > 8 | X > 5): by the conditional-probability definition it is P(X > 8) / P(X > 5) = e^(-4) / e^(-2.5) = e^(-1.5) = 0.2231, exactly P(X > 3). The exponent subtraction wipes out the 5 hours already survived; only the additional 3 hours matter. What we just did: conditioning divided two survival terms, and the exponential's multiplication rule for exponents erased the past.

Memorylessness is a property of this distribution, not a universal claim about equipment or people. For a nonnegative continuous lifetime with density f and positive survival S(t), the hazard is f(t)/S(t), an instantaneous conditional failure rate. The exponential hazard equals lambda. If evidence suggests the hazard changes with time, this constant-hazard model needs reconsideration. A density decreasing in time does not itself mean the conditional hazard decreases.

For exponential rate 0.25 per minute,exp(-.25(5+t))/exp(-.25 times 5)=exp(-.25t). Conditioning on five elapsed minutes leaves the additional wait distribution unchanged under this model.
For exponential rate 0.25 per minute,exp(-.25(5+t))/exp(-.25 times 5)=exp(-.25t). Conditioning on five elapsed minutes leaves the additional wait distribution unchanged under this model.

The bridge to the Poisson process

The exponential and the Poisson are two views of one process, and the link is a single line of algebra. Suppose events arrive as a Poisson process at rate lambda per hour. When is the next event more than t hours away? Exactly when the window of length t contains zero events. The Poisson count in that window has mean lambda t, so [2]

P(wait > t) = P(0 events in the window) = e^(-lambda t),

This establishes the exponential wait from a fixed time in the specified Poisson process. Successive inter-arrival times are independent exponential variables with the same rate. The interval count has Poisson mean lambda times duration, while the waiting time has exponential rate lambda. These parameters have different roles even when their numerical values coincide for a unit-length interval.

Check the support and the moments

The density is zero for negative x. The cdf is zero for negative t and 1-exp(-lambda t) for nonnegative t. Integrating x times the density gives E[X]=1/lambda; integrating x squared times the density gives E[X^2]=2/lambda^2. Therefore Var(X)=2/lambda^2-(1/lambda)^2=1/lambda^2. The rate must be strictly positive for this probability density. [1]

Try it

Support tickets arrive at a steady rate of 4 per hour, exponentially spaced. Find (a) the probability the next ticket arrives within 15 minutes, and (b) the probability of more than 30 quiet minutes. Mind the units, then work both before reading on.

Worked answer. Convert first: 15 minutes = 0.25 hour, 30 minutes = 0.5 hour. (a) P(X less than or equal to 0.25) = 1 - e^(-4 x 0.25) = 1 - e^(-1) = 1 - 0.368 = 0.632. (b) P(X > 0.5) = e^(-4 x 0.5) = e^(-2) = 0.135. What we just did: matched the time units to the rate's units before multiplying, then used the cdf for "within" and the survival function for "more than."

Where people get stuck

The most common slip is feeding the mean where the rate belongs. If the mean gap is 4 minutes, lambda is 1/4 per minute, not 4. Catch it with units: lambda t must come out dimensionless, so a rate in per-minutes needs t in minutes. If your exponent has units left over, the inputs are mismatched.

Second, sign errors. The survival function is e^(-lambda t), decreasing in t: longer waits must be rarer. If your formula's probabilities grow with t, or exceed 1, the minus sign fell off. A quick self-check on any answer: at t = 0 survival is 1, and it should shrink from there.

Third, mixing the two Poisson-process views. "How many events in 2 hours?" is a Poisson count question with mean lambda times 2. "How long until the next event?" is an exponential time question. The nouns give it away, a count versus a duration, and the units of the answer (events versus hours) must match the noun.

Fourth, over-applying memorylessness. It is a property of this model, valid when the failure rate is genuinely constant. Quoting "the machine is as good as new" about a worn bearing is a modeling error, not a probability theorem.

Common misconceptions

  • "With a mean of 2 hours, waits near 2 hours are typical." The distribution is skewed: the median is only 1.39 hours, and P(X > 2) = e^(-1) = 0.368. Most waits fall short of the mean; a long-tail minority stretches far beyond it.
  • "Exponential means growth." The name refers to the exponential function in the formula; here it governs decay of the survival probability as t grows.
  • "The sum of two exponential waits is exponential." Two independent exponential waits with the same rate sum to a gamma variable with shape 2 and that rate. Different rates or dependence require a different calculation. The single-wait formula cannot simply be reused for the sum.
  • "Memorylessness contradicts common sense about aging." It contradicts aging, which is why it applies only to constant-rate mechanisms, and models of living or wearing systems use other distributions.

Recap

  • For rate lambda>0, the exponential density is lambda exp(-lambda x) on x>=0 and zero elsewhere.
  • Mean and SD are 1/lambda, variance is 1/lambda squared, and median is ln(2)/lambda.
  • For t>=0, survival is exp(-lambda t) and the cdf is 1-exp(-lambda t).
  • For s, t>=0, P(X>s+t|X>s)=P(X>t). This is a property of the exponential model, not of arbitrary physical lifetimes.
  • Its hazard is constant. Homogeneous Poisson-process assumptions justify independent exponential gaps, not merely an observed average event rate.

Retrieve, explain, and revisit

Close the worked examples before answering: Which model feature makes an exponential wait memoryless?

Check the reasoning

Its survival is exp(-lambda t), so the ratio of survivals at s+t and s equals the survival at t. Equivalently its hazard is constant.

Return after a day, then again after about a week: An exponential wait has rate 3 per hour. Find its median in minutes. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

The median is ln(2)/3 hours, or 20ln(2) minutes, approximately 13.8629.

Sources

  1. NIST/SEMATECH e-Handbook, Exponential distribution. Cited passages: density with scale beta=1/lambda; survival function; cdf, mean, SD and percent-point function.
  2. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 49; pp. 48-49.
Key terms
Exponential distribution
The continuous law with density lambda exp(-lambda t) for t>=0 and lambda>0; it has a constant hazard.
Rate parameter (lambda)
The positive constant hazard. In a homogeneous Poisson process it also equals the arrival rate per unit time.
Exponential mean
E[X] = 1/lambda, the average waiting time, with variance 1/lambda^2.
Survival function
For an exponential wait and t>=0, P(X>t)=exp(-lambda t).
Cumulative distribution function
For the exponential, F(t)=0 for t<0 and 1-exp(-lambda t) for t>=0.
Memoryless property
For an exponential variable and s, t>=0, P(X>s+t|X>s)=P(X>t).

The Normal Distribution and Standardization

  • Describe the shape and parameters of a normal distribution.
  • Standardize a value to a z-score and use the empirical rule.
  • Find normal probabilities using symmetry and standard normal values.

Suppose a model assigns a measurement a normal distribution with mean 50 and SD 0.2. Standardization turns a value of 50.4 into z=2, and a standard-normal tail gives its exceedance probability. This lesson develops that calculation and its assumptions. Normality is a distributional model, not a consequence of simply measuring a quantity or calculating a mean and SD.

The big picture

Under the classical central limit theorem, standardized sums of iid variables with finite positive variance converge in distribution to a standard normal. That theorem helps explain some approximations for sums and means. It does not establish a normal model for any particular height, examination score or measurement error without further justification. [1]

Working with it takes only two ideas. First, the family has exactly two knobs: the mean mu, saying where the bell sits, and the standard deviation sigma, saying how wide it spreads. Second, every member of the family is the same curve wearing different axis labels, so one conversion, the z-score, translates any normal question into a single standard reference. Learn one curve, answer them all.

Key idea: normals form one two-knob family. Standardizing converts any of them to the standard normal, so a single set of reference values serves every normal distribution.

Shape and parameters

A normal distribution is symmetric and bell-shaped, fully described by two numbers: its mean mu (the center, where the peak sits) and its standard deviation sigma (the spread). The mean, median, and mode all coincide at mu. Changing mu slides the curve left or right; changing sigma makes it wider and flatter or narrower and taller, but the total area always stays 1. [2]

For a normal density with sigma greater than 0, the inflection points occur at mu-sigma and mu+sigma. The density is f(x)=exp(-(x-mu)^2/(2 sigma^2))/(sigma sqrt(2 pi)) for every real x. Write N(mu, sigma^2) when the second parameter denotes the variance. A zero-variance constant can be treated as a degenerate limit, but the density and z-score formulas here require sigma strictly positive.

The standard normal and z-scores

The standard normal distribution Z has mean 0 and standard deviation 1. Any normal value x can be converted to a z-score that says how many standard deviations it lies from the mean: [1]

z = (x - mu) / sigma.

Read the recipe aloud: "distance from the mean, measured in standard deviations." Step 1: subtract the mean, so the answer is a distance with a sign. Step 2: divide by sigma, so the distance is counted in spread-units rather than raw units. A positive z is above the mean, a negative z below, and z = 0 is the mean itself.

Worked example. In a fictional height model, assume a normal distribution with mu=170 cm and sigma=10 cm. A height of 190 cm has z = (190 - 170)/10 = 2.0, two standard deviations above average. A height of 155 cm has z = (155 - 170)/10 = -1.5, one and a half below. The formula also runs backwards: the height with z = 1 is x = mu + z sigma = 170 + 10 = 180 cm.

Consider fictional score scales A with mean 500 and SD 100, and B with mean 21 and SD 5. Scores 650 and 28 yield z=1.5 and z=1.4. The first is farther above its own reference mean in SD units. This does not establish equivalent skill, test validity, population comparability or percentile rank unless the needed distributional and substantive assumptions are supplied. Standardization is not automatic score equating.

Negative z-scores carry no stigma; they are positions, not grades. A golfer whose round has z = -2 relative to the field is doing wonderfully, since low scores win golf. The sign reports which side of the mean a value sits on, and the size reports how far; what counts as good depends entirely on the variable.

Under the stated N(100,100) model,X>120 is equivalent to Z>2. The probability is .0227501 on both scales. Density heights change with the unit conversion; shaded areas agree.
Under the stated N(100,100) model,X>120 is equivalent to Z>2. The probability is .0227501 on both scales. Density heights change with the unit conversion; shaded areas agree.

The 68-95-99.7 empirical rule

For any normal distribution:

  • About 68% of values lie within 1 standard deviation of the mean.
  • About 95% lie within 2 standard deviations.
  • About 99.7% lie within 3 standard deviations.

Symmetry splits the probability outside a central interval equally between the two tails. Using the rounded 68% rule gives about 16% above one SD, compared with a standard-normal tail of approximately 15.8655%. Using the rounded 95% rule gives 2.5% above two SD, compared with approximately 2.2750%. Retain the distinction when reporting a numerical answer.

The exact standard normal central probabilities within 1,2,3 SDs are approximately .682689,.954500,.997300. The familiar 68-95-99.7 rule is rounded; shaded regions are nested.
The exact standard normal central probabilities within 1,2,3 SDs are approximately .682689,.954500,.997300. The familiar 68-95-99.7 rule is rounded; shaded regions are nested.

Worked example: the empirical rule

For a fictional score model, assume a normal distribution with mu=100 and sigma=15. About 68% of people score between 100 plus or minus 15, that is 85 to 115. About 95% score between 100 plus or minus 30, that is 70 to 130. A score of 115 has z = (115 - 100)/15 = 1.0, exactly one standard deviation above the mean.

Worked example: a tail probability

What fraction of people score above 115 (z = 1)? Since 68% lie within one standard deviation, 32% lie outside it, split evenly between the two tails by symmetry, so about 16% lie above 115. The exact standard-normal value is P(Z greater than 1) = 0.1587, close to the empirical-rule estimate of 16%. To find the probability of scoring between 85 and 115 (within 1 SD), the empirical rule gives about 68%; the exact value is 0.6827. [2]

For z-values off the rule's grid, a short table of left-areas covers nearly everything: P(Z < 1) = 0.8413, P(Z < 1.5) = 0.9332, P(Z < 2) = 0.9772. Three moves convert any question into these numbers. "Below" reads the table directly. "Above" subtracts from 1: P(Z > 1.5) = 1 - 0.9332 = 0.0668. "Between" subtracts two left-areas: for these fictional scores from 85 to 130, z runs from -1 to 2, and by symmetry P(Z < -1) = P(Z > 1) = 0.1587, so the answer is 0.9772 - 0.1587 = 0.8185, about 82%.

Two more landmarks are worth memorizing because statistics leans on them constantly: P(Z < 1.645) is approximately 0.95, so z = 1.645 marks the 95th percentile, and the central 95% of the curve sits between z = -1.96 and z = +1.96, the origin of the "plus or minus about 2 standard deviations" habit.

Backwards: from percentile to value

To find the 90th percentile of the fictional N(100,225) score model, use z approximately 1.2815516, the standard-normal 90th percentile. Then x=100+15z, approximately 119.2233. Using the rounded z=1.28 gives 119.2. Phi(1.28) is approximately 0.89973, so the rounded input does not give an exact 0.90 probability. [2]

The 97.5th standard-normal percentile is approximately 1.959964. In the fictional score model it corresponds to approximately 129.3995. This is a distributional percentile calculation. A practical threshold also requires a justified reference population, measurement interpretation and decision objective; a convenient z cutoff does not supply those choices.

Try it

A machine cuts bolts with lengths normal, mu = 50 mm, sigma = 0.2 mm. Find (a) the fraction of bolts longer than 50.4 mm, and (b) the fraction between 49.8 and 50.2 mm. Work both before reading on.

Worked answer. Under the specified normal model, (a) z=(50.4-50)/0.2=2 and P(Z>2) is approximately 0.022750, or 2.2750%. The rough 95% rule would give 2.5%, a different approximation. (b) The interval is one SD on each side, so the probability is approximately 0.682689, or 68.2689%. Both calculations use normality, not just the supplied mean and SD.

Where people get stuck

Order of operations in the z-score causes the first wave of slips: subtract the mean first, then divide the whole difference by sigma. Computing 115/15 and then subtracting something, or dividing only part of the difference, gives garbage. Say the recipe as a sentence, "distance from the mean, in SDs," and the order takes care of itself.

Second, dividing by the variance instead of the standard deviation. If a problem reports variance 225, take its square root, sigma = 15, before standardizing. Units are the tell: z must be a pure number, and a distance in points divided by points-squared is not.

Third, misreading table direction. Standard tables report left-areas, P(Z < z). For "above" questions subtract from 1; for negative z use symmetry, P(Z < -1) = P(Z > 1). Sketch the bell, shade the region you want, and the correct subtraction becomes visible before any arithmetic.

Fourth, applying the empirical rule to data that is not roughly normal. Incomes, house prices, and waiting times are strongly skewed; for them "within 2 sigma" can cover a very different fraction. The rule is a property of the bell shape, not of data in general.

Common misconceptions

  • "Most data is normal." Many measured quantities are approximately normal, especially sums and averages, but plenty are not. Normality is a modeling assumption to check, often with a quick histogram.
  • "Standardizing changes the data." A z-score relabels a value in new units (SDs from the mean); it moves no one and reorders nothing.
  • "z-scores beyond 3 are impossible." Merely rare: about 0.3% of values fall outside 3 sigma, roughly 1 in 370. In large datasets such values are expected visitors.
  • "68-95-99.7 are exact." They round the true values 68.27%, 95.45%, 99.73%, plenty accurate for estimates, while tables or software provide the exact areas.

Recap

  • A nondegenerate normal law is specified by a real mean mu and a positive SD sigma. Its density has inflection points at mu plus or minus sigma.
  • Under that normal model, Z=(X-mu)/sigma has the standard normal law. Reverse the transformation with X=mu+sigma Z.
  • The 68%,95%,99.7% rule rounds the central probabilities within 1,2,3 SDs. Use the normal cdf for more precise tails.
  • Above-threshold probability is 1 minus the cdf; between-threshold probability is the difference of two cdf values.
  • A percentile is mu+sigma times the corresponding standard normal quantile. Standardizing a nonnormal variable does not make it normal.

Retrieve, explain, and revisit

Close the worked examples before answering: Does standardizing an arbitrary distribution make it normal?

Check the reasoning

No. Affine standardization changes its location and scale while preserving its shape. Normality requires a separate model or limiting result.

Return after a day, then again after about a week: A normal variable has mean 20 and SD 4. Write its 90th percentile using z=1.281552. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

20+4(1.281552)=25.126208, approximately 25.1262.

Sources

  1. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 41; pp. 21-22.
  2. NIST/SEMATECH e-Handbook, Normal distribution. Cited passages: density and common statistics; standard normal cdf; percent-point function.
Key terms
Normal distribution
A symmetric bell-shaped distribution set by its mean mu and standard deviation sigma.
Standard normal
The normal distribution with mean 0 and standard deviation 1, whose values are z-scores.
Z-score
z = (x - mu)/sigma, the number of standard deviations x lies from the mean.
Standardizing
Converting any normal value to a z-score so one table serves all normals.
Empirical rule
About 68%, 95%, and 99.7% of normal data lie within 1, 2, and 3 standard deviations.
Symmetry of the normal
The curve is a mirror image about mu, so the two tails have equal area.

Module 5: Joint Distributions and the Central Limit Theorem

Working with two random variables at once, measuring how they move together, and the theorem that makes the normal curve universal.

Joint Distributions and Covariance

  • Read a joint probability table and find marginal distributions.
  • Compute covariance and interpret its sign.
  • Compute the correlation coefficient and use it to judge linear association.

Every distribution so far has described one random variable at a time. Real questions usually arrive in pairs: a person's height and weight, hours studied and exam score, temperature and ice-cream sales. To reason about a pair we need the joint distribution, which records the probability of every combination of values. From it flow the three tools this lesson builds: marginal distributions, covariance, and correlation.

The big picture

A joint probability table assigns weights to pairs. For two binary variables, giving both margins as 1/2 does not tell you whether the variables always match, always disagree, or are independent. The joint distribution supplies that extra information. It describes association under the model, not by itself the effect of intervening on one variable.

This lesson teaches three ways to read the grid. Summing rows or columns recovers each variable's solo distribution, the marginals. Multiplying and averaging in the right pattern produces covariance, a single signed number saying whether the variables rise and fall together. Rescaling covariance gives correlation, a unit-free strength score between -1 and +1. The lesson ends with a warning built into the mathematics: independence forces covariance to zero, but zero covariance does not force independence.

Key idea: the joint table is the complete truth about a pair of random variables. Everything else, marginals, conditionals, covariance, correlation, is computed from its cells.

Joint and marginal distributions

For two discrete variables X and Y, the joint probability mass function p(x, y) = P(X = x and Y = y) gives the probability of each pair of values, and all the entries sum to 1. Each cell is an "and" statement. Consider this joint table, our running example: [1]

Y = 0Y = 1P(X)
X = 00.200.100.30
X = 10.100.300.40
X = 20.100.200.30
P(Y)0.400.601.00

Read a few cells aloud to fix the meaning. The top-left inner entry says P(X = 0 and Y = 0) = 0.20: in 20% of trials both variables come up 0. The 0.30 in the middle row says P(X = 1 and Y = 1) = 0.30. First sanity check, the six inner cells must sum to 1: 0.20 + 0.10 + 0.10 + 0.30 + 0.10 + 0.20 = 1.00. They do, so this is a legitimate probability assignment.

The marginal distribution of X is the distribution of X alone, ignoring Y. To find it, sum each row. If X = 1, then Y was either 0 or 1, two disjoint cases, so P(X = 1) = 0.10 + 0.30 = 0.40. Likewise P(X = 0) = 0.20 + 0.10 = 0.30 and P(X = 2) = 0.10 + 0.20 = 0.30. The marginal of Y comes from column sums: P(Y = 0) = 0.20 + 0.10 + 0.10 = 0.40 and P(Y = 1) = 0.10 + 0.30 + 0.20 = 0.60.

The name is literal: these totals sit in the margins of the table, exactly where the P(X) column and P(Y) row appear above. Each marginal is a complete one-variable distribution and must itself sum to 1. Check both: 0.30 + 0.40 + 0.30 = 1.00 for X, and 0.40 + 0.60 = 1.00 for Y.

The table also answers compound and conditional questions by membership check, the same skill as lesson one. For P(X ≥ 1 and Y = 1), collect the qualifying cells: 0.30 + 0.20 = 0.50. For a conditional, use the definition from module two, cell over margin: P(Y = 1 | X = 2) = 0.20 / 0.30 ≈ 0.667. Compare that with the marginal P(Y = 1) = 0.60: learning that X = 2 nudged the probability of Y = 1 upward, a first hint of dependence.

Key idea: cells are "and" probabilities. Row and column sums give each variable's solo distribution, and cell-over-margin ratios give conditionals.

The joint masses for X=0,1,2 and Y=0,1 have row totals .3,.4,.3 and column totals .4,.6. The (2,1) mass .2 differs from the independence product .18.
The joint masses for X=0,1,2 and Y=0,1 have row totals .3,.4,.3 and column totals .4,.6. The (2,1) mass .2 differs from the independence product .18.

Covariance: do they move together?

Marginals throw away the pairing pattern, and the pattern is the point. We want one number summarizing its direction. The idea: measure each variable's deviation from its own mean, multiply the two deviations, and average over the joint distribution. When X and Y tend to sit above average together and below average together, the product of deviations is usually positive. When one runs high while the other runs low, the product is usually negative. That average product is the covariance: [2]

Cov(X, Y) = E[(X - mu_X)(Y - mu_Y)],

where mu_X and mu_Y are the two means. Expanding the product and applying linearity of expectation gives the shortcut used in practice:

Cov(X, Y) = E[XY] - E[X] E[Y].

Read the shortcut aloud: average the product, then subtract the product of the averages. If pairing carried no information, the two would agree and the covariance would be zero. Covariance measures exactly how far E[XY] drifts from E[X]E[Y].

Worked example, every cell shown. First the means, straight from the margins. E[X] = 0(0.30) + 1(0.40) + 2(0.30) = 0 + 0.40 + 0.60 = 1.0, and E[Y] = 0(0.40) + 1(0.60) = 0.60.

Next E[XY]. The rule for the expectation of a function of the pair: multiply x × y × p(x, y) for every cell, then add. Walk the grid row by row:

  • Cell (X = 0, Y = 0): 0 × 0 × 0.20 = 0.
  • Cell (X = 0, Y = 1): 0 × 1 × 0.10 = 0.
  • Cell (X = 1, Y = 0): 1 × 0 × 0.10 = 0.
  • Cell (X = 1, Y = 1): 1 × 1 × 0.30 = 0.30.
  • Cell (X = 2, Y = 0): 2 × 0 × 0.10 = 0.
  • Cell (X = 2, Y = 1): 2 × 1 × 0.20 = 0.40.

Four of the six terms vanish because a zero value of either variable kills the product; only cells where both variables are nonzero contribute. The sum is E[XY] = 0.30 + 0.40 = 0.70. Now the shortcut:

Cov(X, Y) = 0.70 - (1.0)(0.60) = 0.70 - 0.60 = 0.10.

The covariance is 0.10. In the centered-product calculation, cells (0,0) and (2,1) contribute +0.12 and +0.08, while (0,1) and (2,0) contribute -0.04 and -0.06. The row X=1 contributes zero because it is exactly at E[X]. Adding these contributions gives 0.10, which verifies the shortcut without incorrectly treating every large-probability cell as an above-average pair.

Key idea: covariance is the average of deviation times deviation. Positive means the variables lean the same way, negative means opposite ways, and E[XY] - E[X]E[Y] computes it fast.

Correlation: covariance with the units removed

Covariance has a defect: its size depends on units. Measure height in centimeters instead of meters and every height deviation becomes 100 times larger, so the covariance with weight becomes 100 times larger, though the relationship itself has not changed at all. The raw number 0.10 therefore tells us the direction of association but not, by itself, the strength. [2]

The fix is the same standardizing move as the z-score lesson: measure each deviation in standard-deviation units. Dividing covariance by both standard deviations produces the correlation coefficient:

rho = Cov(X, Y) / (sigma_X sigma_Y).

When both variables have finite, strictly positive variances, correlation lies between -1 and 1. An endpoint value means Y=a+bX almost surely, with positive b for correlation 1 and negative b for -1. Correlation is undefined if either SD is zero, and the usual definition requires the needed finite moments. Values on probability-zero sets do not change it.

Worked example, continued. We need both standard deviations, via the variance shortcut Var = E[X²] - (E[X])².

  • For X: E[X²] = 0²(0.30) + 1²(0.40) + 2²(0.30) = 0 + 0.40 + 1.20 = 1.60, so Var(X) = 1.60 - 1.0² = 0.60 and sigma_X = √0.60 ≈ 0.775.
  • For Y: since Y takes only the values 0 and 1, Y² = Y, so E[Y²] = E[Y] = 0.60 and Var(Y) = 0.60 - 0.60² = 0.60 - 0.36 = 0.24, giving sigma_Y = √0.24 ≈ 0.490.

Now divide: rho = 0.10 / (0.775 × 0.490) ≈ 0.264.

Using the unrounded variances gives rho=0.10/sqrt(0.60 times 0.24), approximately 0.26352. This is a positive standardized linear association for the specified table. Labels such as weak or strong depend on context and do not replace an examination of the joint distribution. A correlation coefficient alone does not quantify every kind of dependence or the accuracy of every prediction.

Key idea: correlation is covariance after standardizing both variables. It is unit-free, lives in [-1, 1], and measures straight-line association only.

Independence and covariance: a one-way street

Two random variables are independent when every joint cell factors into its margins: p(x, y) = P(X = x) P(Y = y) for every pair of values. That is the random-variable version of event independence from module two, and a single failed cell spoils it. Test our table's top-left cell: independence would demand P(X = 0 and Y = 0) = 0.30 × 0.40 = 0.12, but the table says 0.20. So X and Y are dependent, matching the conditional shift we found earlier. [1]

For independent variables with finite second moments, E[XY]=E[X]E[Y], so covariance is zero. Correlation is also zero when both variances are positive. If a moment is undefined, the covariance conclusion cannot be used in its ordinary finite form. A nonzero finite covariance rules out independence.

The converse fails, and one small example shows it. Let X take the values -1, 0, and 1, each with probability 1/3, and let Y = X², so Y is completely determined by X. Compute the ingredients:

  • E[X] = (-1)(1/3) + 0(1/3) + 1(1/3) = 0.
  • XY = X × X² = X³, and for the values -1, 0, and 1 the cube equals the number itself, so E[XY] = E[X] = 0.
  • Therefore Cov(X, Y) = E[XY] - E[X]E[Y] = 0 - 0 × E[Y] = 0.

Zero covariance, yet total dependence: knowing X tells you Y exactly. The factoring test fails concretely, since Y = 0 happens only when X = 0, so P(X = 0 and Y = 0) = 1/3, while P(X = 0) P(Y = 0) = (1/3)(1/3) = 1/9. What went wrong for covariance? The relationship is a symmetric U shape: Y is high when X is very low and when X is very high. The products from the negative side and the positive side cancel exactly. Covariance can miss nonlinear dependence, as in this symmetric example. It can also be nonzero for a nonlinear relation, so it is not a test of whether the underlying function is straight.

Key idea: with finite second moments, independence implies zero covariance; the reverse fails in general. Zero covariance means the centered-product average is zero, not that the variables are unrelated.

If X is equally likely -1,0,1 and Y=X squared,then E[X]=E[XY]=0 and covariance is zero. Yet Y is a deterministic nonconstant function of X,so the variables are dependent.
If X is equally likely -1,0,1 and Y=X squared,then E[X]=E[XY]=0 and covariance is zero. Yet Y is a deterministic nonconstant function of X,so the variables are dependent.

Conditional distributions and the existence of moments

For a discrete joint pmf, P(Y=y | X=x)=p(x, y)/p_X(x) when p_X(x) is positive. In the running table, given X=0 the probabilities for Y=0 and Y=1 are 2/3 and 1/3. These sum to 1, and their mean is E[Y | X=0]=1/3. A row with probability 0 cannot define this conditional law by division. [1]

Covariance is guaranteed finite if both second moments are finite. This is a sufficient condition that covers the examples here. A joint density for continuous variables uses integrals rather than cell sums, and conditioning on an exact continuous value requires a conditional density. The extended lesson on joint densities develops that distinction.

Try it

A fresh 2 × 2 joint distribution: P(X = 0 and Y = 0) = 0.40, P(X = 0 and Y = 1) = 0.10, P(X = 1 and Y = 0) = 0.10, and P(X = 1 and Y = 1) = 0.40. Find the marginals, E[X], E[Y], E[XY], Cov(X, Y), and rho. Work it out before reading on.

Worked answer. Step 1, marginals: P(X = 0) = 0.40 + 0.10 = 0.50, so P(X = 1) = 0.50, and by the same sums P(Y = 0) = P(Y = 1) = 0.50. Step 2, means: E[X] = 0(0.50) + 1(0.50) = 0.50, and E[Y] = 0.50 the same way. Step 3, the cell walk for E[XY]: only the (1, 1) cell has both values nonzero, contributing 1 × 1 × 0.40 = 0.40. Step 4, the shortcut: Cov = 0.40 - (0.50)(0.50) = 0.40 - 0.25 = 0.15.

Step 5, correlation. Each variable is a Bernoulli with p = 0.5, whose variance is 0.5 × 0.5 = 0.25 and standard deviation 0.50. So rho = 0.15 / (0.50 × 0.50) = 0.15 / 0.25 = 0.60, a moderately strong positive association. You can see it in the table: 80% of the probability sits on the matching diagonal, the cells (0, 0) and (1, 1). What we just did: margins, means, cell walk, shortcut, standardize.

Where people get stuck

The most common error is manufacturing joint probabilities by multiplying marginals. P(X = 2) = 0.30 and P(Y = 1) = 0.60 do not entitle you to claim P(X = 2 and Y = 1) = 0.18; the table says 0.20. Multiplying margins is legal only after independence is known or assumed. In every other case the joint table is the ground truth, and the margins are summaries computed from it, not building blocks that recreate it.

Second, the E[XY] step. It is tempting to compute E[X] × E[Y] and call that E[XY], but the entire content of covariance is that these can differ. E[XY] must be earned cell by cell, value times value times probability, summed over the whole grid. A related slip is forgetting that cells with either value zero contribute nothing.

Covariance values depend on the units and marginal spreads. Correlation removes those units when defined, but comparing correlations still requires attention to the populations, measurement range, design and shape. Rescaling does not make unrelated scientific questions comparable.

Fourth, reading rho = 0 as "unrelated." The U-shaped counterexample is the antidote: perfect dependence, zero correlation. Correlation tests one specific pattern, the straight line.

Common misconceptions

  • "The marginals determine the joint." They do not. Our Try-it table and an independent table with the same 0.50 margins assign different probabilities to the same cells; the pairing pattern is extra information.
  • "Zero covariance means independence." It means no linear trend. Y = X² with symmetric X has covariance 0 and complete dependence.
  • "A strong correlation means X causes Y." In the synthetic model X=Z and Y=Z, a common random input makes X and Y perfectly correlated. The joint distribution alone does not determine what an intervention on X would do to Y.
  • "rho = -0.8 is weaker than rho = +0.8." They are equally strong linear associations in opposite directions. The sign is direction; the absolute value is strength.

Recap

  • A discrete joint pmf gives nonnegative masses summing to 1 across pairs. Marginals sum over the other coordinate.
  • A conditional cell probability divides by the conditioning margin, which must be positive.
  • With finite second moments, Cov(X, Y)=E[XY]-E[X]E[Y]. It averages centered products.
  • Correlation divides covariance by both SDs. It is defined here only when both variances are finite and positive, and lies in [-1,1].
  • Independence implies zero covariance when these moments exist. Zero covariance does not generally imply independence.
  • Neither covariance nor correlation alone establishes a causal effect.

Retrieve, explain, and revisit

Close the worked examples before answering: Why does covariance zero fail to prove independence?

Check the reasoning

Opposing centered-product contributions can cancel. For symmetric X taking -1,0,1 equally and Y=X squared, covariance is zero even though Y depends on X.

Return after a day, then again after about a week: If two independent variables each have variance 1, what is their covariance? Would a zero covariance prove independence in reverse? Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

Their covariance is zero. The reverse implication is not valid in general; further joint-model assumptions would be needed.

Sources

  1. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 12; pp. 15 and 32; pp. 13-14.
  2. Orloff and Bloom, MIT 18.05 (2022), Class 7: Covariance and correlation. Cited passages: pp. 1-3; pp. 5-6.
Key terms
Joint distribution
In the discrete setting, p(x, y)=P(X=x and Y=y); the full collection of pair probabilities specifies the joint law.
Marginal distribution
The distribution of one variable alone, found by summing the joint over the other.
Covariance
For finite second moments, E[(X-E[X])(Y-E[Y])]=E[XY]-E[X]E[Y].
Correlation coefficient
For finite positive variances, rho=Cov(X, Y)/(SD(X)SD(Y)), a unitless linear-association measure in [-1,1].
Positive covariance
Above-average X tends to accompany above-average Y.
Independence implies zero covariance
Independent variables with finite second moments have zero covariance; the converse does not hold in general.

Sums of Random Variables

  • Apply linearity of expectation to a sum of random variables.
  • Compute the variance of a sum, using independence when it applies.
  • Find the mean and standard deviation of a sample mean.

Totals and averages are everywhere: the total of two dice, a week of daily sales added up, the average of five lab measurements. Each is a new random variable built by adding old ones, so we need rules for how means, variances, and whole distributions behave under addition. Those rules are this lesson's business, and they are the engine that powers the Central Limit Theorem in the finale.

The big picture

For variables with finite absolute expectations, the expectation of a sum is the sum of the expectations, whether or not the variables are independent. For variables with finite second moments, the variance of a sum includes covariances. Pairwise zero covariances are sufficient for variances to add. Stating these existence conditions prevents algebra with undefined infinite quantities. [1]

The payoff arrives when we add many copies of the same experiment. A total of n independent draws has mean n times mu, and variance n times sigma², so its standard deviation grows like the square root of n. Divide by n to form the average and the spread shrinks like 1 over the square root of n. That one algebraic fact explains why polls of a thousand people work, why labs repeat measurements, and why casinos survive: averaging cancels noise at a predictable rate.

Key idea: finite expectations add without independence; variances add under independence (more precisely, whenever covariances are zero). Everything about averages follows from these two rules.

Expectation of a sum: existence first

The statement first, in symbols and words:

E[X + Y] = E[X] + E[Y], and in general E[X1 + X2 + ... + Xn] = E[X1] + ... + E[Xn].

Assume each variable has finite absolute expectation. Then the expected value of their finite sum is the sum of their expected values. For a discrete pair, E[X+Y] is the sum of (x+y)p(x, y) over all joint outcomes. Absolute integrability justifies separating the x and y terms; the finite tables here automatically satisfy that condition.

Each term splits in two, since (x + y) p = x p + y p. Group the x-parts: summing x p(x, y) over all cells collapses, row by row, to ∑ x P(X = x), which is E[X]. The y-parts collapse the same way to E[Y]. No independence was used anywhere in that argument.

Constants ride along in the natural way: E[aX + bY + c] = a E[X] + b E[Y] + c.

Worked example. Two fair dice each have mean 3.5, so their expected total is 7 whether or not they are independent. If Y is a copy of X, their sum is 2X and its expectation is still 7. The finite-expectation condition holds in both models. Their variances and sum distributions can differ because those calculations depend on the joint law.

Linearity is also why the binomial mean from module three is np. The number of heads in 10 fair flips is a sum of 10 indicator variables, one per flip, each worth 1 with probability 0.5. Each indicator has mean 0.5, so the count has mean 10 × 0.5 = 5. No formula grinding, only addition.

Key idea: expectation distributes over finite sums of integrable variables without an independence condition. When a variable can be written as a sum of simpler pieces, its mean is the sum of the pieces' means.

Variance of a sum: the covariance correction

Variance is where dependence makes itself felt. Write the deviations a = X - mu_X and b = Y - mu_Y, so that Var(X) = E[a²], Var(Y) = E[b²], and, from last lesson, Cov(X, Y) = E[ab]. The sum X + Y deviates from its own mean by exactly a + b, so: [2]

Var(X + Y) = E[(a + b)²] = E[a² + 2ab + b²] = E[a²] + 2 E[ab] + E[b²],

using the school identity (a + b)² = a² + 2ab + b² and then linearity of expectation on the three terms. Translating back:

Var(X + Y) = Var(X) + Var(Y) + 2 Cov(X, Y).

When X and Y are independent, the covariance is 0 and the correction disappears:

Var(X + Y) = Var(X) + Var(Y).

Worked example. Let X and Y be independent with Var(X) = 4 and Var(Y) = 9. Then Var(X + Y) = 4 + 9 = 13, so the standard deviation of the sum is √13 ≈ 3.61. It is not 2 + 3 = 5. Variances add; standard deviations do not. Standard deviations combine like the sides of a right triangle: the answer √(2² + 3²) is the hypotenuse, and a hypotenuse is shorter than the two legs laid end to end, because independent noises partly cancel.

For the earlier joint table, Var(X+Y)=0.60+0.24+2(0.10)=1.04, compared with 0.84 if a different joint model had the same margins and covariance 0. Positive covariance increases a sum's variance relative to the zero-covariance comparison; negative covariance decreases it. Negative covariance does not guarantee the total has smaller variance than each individual component.

Differences behave the same way, not the opposite way. Since X - Y = X + (-Y), and flipping a variable's sign flips the sign of its covariances but leaves its variance alone, Var(X - Y) = Var(X) + Var(Y) - 2 Cov(X, Y), and for independent variables Var(X - Y) = Var(X) + Var(Y). For independent variables, subtracting one adds its variance to the other. With dependence, covariance can change that conclusion; X-X is identically zero.

Key idea: Var(X + Y) = Var(X) + Var(Y) + 2Cov(X, Y). Independence kills the correction; positive covariance inflates the sum's spread; negative covariance dampens it; differences still add variance.

The distribution of a sum: dice totals

Mean and variance summarize a sum, but sometimes we want its full distribution. For independent discrete variables there is a recipe: to find P(T = t) where T = X + Y, list every way to split t between the two variables and add the probabilities, P(T = t) = ∑ P(X = x) P(Y = t - x). The pattern is called a convolution, and the two-dice total shows it at work. [3]

Take T = the total of two independent fair dice, each outcome pair having probability 1/36. Work a few totals:

  • T = 2 needs the split (1, 1) only: P(T = 2) = 1/36.
  • T = 3 needs (1, 2) or (2, 1): P(T = 3) = 2/36.
  • T = 7: first die 1 pairs with 6, 2 with 5, 3 with 4, 4 with 3, 5 with 2, 6 with 1, six splits in all, so P(T = 7) = 6/36 = 1/6.

Counting all totals from 2 to 12 gives the tally 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1 out of 36, a triangle peaking at 7. Something remarkable happened: each die alone is flat, every face equally likely, yet the sum of two flat distributions is not flat. Middle totals win because they can be assembled in many ways, while extremes require both dice to cooperate. Add a third die and the shape smooths further into a mound; keep adding and it approaches a bell. That drift toward the bell is exactly what the Central Limit Theorem formalizes next lesson.

The summary numbers check out too. Each die has variance 35/12 ≈ 2.92 (computed in module three), so the independent total has mean 7 and variance 35/12 + 35/12 = 35/6 ≈ 5.83, standard deviation about 2.42.

Triangular probability mass function for the sum of two independent fair dice: masses 1,2,3,4,5,6,5,4,3,2,1 divided by 36 for totals 2 through 12. Middle totals have more ordered routes.
Triangular probability mass function for the sum of two independent fair dice: masses 1,2,3,4,5,6,5,4,3,2,1 divided by 36 for totals 2 through 12. Middle totals have more ordered routes.

iid versus merely uncorrelated

An iid collection is mutually independent and identically distributed. Having one common distribution does not itself guarantee that a mean or variance exists. When finite moments do exist, they are shared. Independent fair dice provide an iid model. Sampling without replacement from a finite population generally does not, and a large population alone does not remove all forms of dependence. [1]

A weaker condition is being uncorrelated: every pairwise covariance is zero. Independence implies uncorrelated, but last lesson's U-shaped counterexample shows the reverse fails. The distinction earns its keep here because the two headline rules need different strengths. For n variables,

Var(X1 + ... + Xn) = Var(X1) + ... + Var(Xn) + 2 × (sum of all pairwise covariances),

so variances add whenever the variables are merely pairwise uncorrelated; full independence is not required. The convolution recipe, by contrast, and the distribution-level claims built on it, genuinely need independence. Finite expectations add without independence.

Key idea: iid means independent plus same distribution. Uncorrelated is weaker, yet already enough for variances to add; independence is needed for statements about the sum's whole distribution.

The sample mean and the square-root-n law

Now the star application. Take n iid observations X1, ..., Xn, each with finite mean mu and finite standard deviation sigma, and form the sample mean X-bar = (X1 + ... + Xn)/n. Two short computations give its behavior. [4]

Center: by linearity, the total T = X1 + ... + Xn has E[T] = n mu, and dividing by the constant n gives E[X-bar] = mu. The sample mean is aimed at the true mean; statisticians say it is unbiased.

Spread: by independence, Var(T) = n sigma². Constants come out of variance squared, Var(cX) = c² Var(X), so dividing T by n divides its variance by n²: Var(X-bar) = n sigma² / n² = sigma² / n. Taking square roots, the standard deviation of the sample mean, called the standard error, is sigma / √n.

Worked example. A population has sigma = 15. For samples of n = 25, the standard error is 15 / √25 = 15 / 5 = 3. For n = 100 it is 15 / 10 = 1.5. Notice the exchange rate: quadrupling the sample size only halved the error, because n sits under a square root. Precision is bought at an ever-steeper price.

The variance calculation, not a claim that above-mean and below-mean draws occur equally often, establishes SD(X-bar)=sigma/sqrt(n). A skewed distribution can have very unequal probabilities on the two sides of its mean. Random centered deviations still have expectation zero when the mean exists. Averaging reduces this specified sampling variability but does not remove a systematic measurement offset or selection bias.

Key idea: X-bar has mean mu and standard error sigma/√n. Averaging n independent measurements shrinks noise by the factor √n, no faster.

For Xi=Z+epsilon_i with independent components,Var(Z)=1 and iid noise variance 4,the mean variance is 1+4/n. The shared component remains as n grows,unlike independent noise variance 4/n.
For Xi=Z+epsilon_i with independent components,Var(Z)=1 and iid noise variance 4,the mean variance is 1+4/n. The shared component remains as n grows,unlike independent noise variance 4/n.

Try it

Four iid measurements X1, X2, X3, X4 each have mean 10 and variance 8. Find the mean and standard deviation of (a) the total T, (b) the average X-bar, and (c) the shortcut 4X1, meaning one measurement multiplied by four. Work all three before reading on.

Worked answer. (a) E[T] = 4 × 10 = 40; by independence Var(T) = 8 + 8 + 8 + 8 = 32, so sd = √32 ≈ 5.66. (b) E[X-bar] = 10; Var(X-bar) = 8/4 = 2, so the standard error is √2 ≈ 1.41.

(c) E[4X1] = 40, matching the total, but Var(4X1) = 4² × 8 = 128, sd ≈ 11.31, twice the total's 5.66. What we just did: adding four independent copies pools four separate noises that partly cancel; multiplying one copy by 4 amplifies a single noise with no cancellation. Sums and multiples share a mean but not a spread.

Where people get stuck

For independent variables with variances 4 and 9, the sum has variance 13 and SD sqrt(13), approximately 3.6056. Adding the SDs 2 and 3 would give the wrong answer under independence. For dependent variables, retain the covariance term before taking the square root.

Second, the difference trap. Asked about X - Y, many subtract variances, getting 9 - 4 = 5 or even a negative number, which is impossible, since variance is an average of squares. For independent variables, Var(X - Y) = Var(X) + Var(Y) = 13, the same as the sum. Uncertainty accumulates whether you add or subtract a noisy quantity.

Third, confusing 2X with X1 + X2. Doubling one die roll gives Var(2X) = 4 × 35/12 ≈ 11.67, while rolling twice and adding gives 35/6 ≈ 5.83. The first repeats one random outcome twice, so its noise is fully synchronized with itself; the second draws two fresh outcomes that can offset. Betting 20 dollars on one hand is genuinely riskier than 10 dollars on each of two independent hands.

For a concrete shared-noise model, let Xi=mu+Z+Ei, where Z and the Ei are centered, mutually independent, with Var(Z)=a and Var(Ei)=b. Then each Xi has variance a+b and each pair has covariance a. The average has variance a+b/n, so increasing n reduces the independent component but leaves the common component a. Ignoring covariance would incorrectly predict (a+b)/n.

Common misconceptions

  • "Linearity of expectation requires independence." For integrable variables it does not. Existence of finite absolute expectations is the condition used here; dependence changes covariance terms, not this linearity rule.
  • "Standard deviations add." Variances add (when covariances vanish). Standard deviations combine like perpendicular legs of a triangle, √(a² + b²), which is less than a + b.
  • "Every two-dice total from 2 to 12 is equally likely." The convolution triangle says otherwise: 7 occurs six ways (probability 1/6), while 2 and 12 occur one way each (1/36).
  • "Doubling the sample size halves the standard error." The error scales as 1/√n, so doubling n divides the error by √2 ≈ 1.41; it takes four times the data to halve it.

Recap

  • Finite expectations add without independence.
  • For finite second moments, Var(X+Y)=Var(X)+Var(Y)+2Cov(X, Y). A difference changes the covariance term to minus 2Cov(X, Y).
  • Uncorrelated variables have additive variances. Independence is a sufficient, stronger condition.
  • Convolution computes the law of an independent sum. Two independent fair six-sided dice have a total most likely at 7.
  • For n pairwise uncorrelated variables with common finite mean mu and variance sigma squared, the mean has expectation mu and variance sigma squared/n.
  • A shared random offset contributes covariance that averaging may not remove.

Retrieve, explain, and revisit

Close the worked examples before answering: Which operation needs independence: adding integrable expectations or adding variances without covariance terms?

Check the reasoning

Expectations add without independence. Variances require covariance terms unless those terms vanish; independence is sufficient but not necessary for zero covariance.

Return after a day, then again after about a week: Let Y=X with Var(X)=9. Find Var(X+Y) and Var(X-Y). Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

The sum is 2X with variance 36. The difference is zero with variance zero. Marginal variances alone would miss both results.

Sources

  1. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: pp. 15 and 32.
  2. Orloff and Bloom, MIT 18.05 (2022), Class 7: Covariance and correlation. Cited passages: pp. 1-2 and 9.
  3. Grinstead and Snell, Introduction to Probability, 2nd edition, Dartmouth CHANCE text (2006 version). Cited passages: PDF pp. 293-294; discrete convolution.
  4. Orloff and Bloom, MIT 18.05 (2022), Class 6: Central limit theorem and law of large numbers. Cited passages: pp. 7-8.
Key terms
Linearity of expectation
For integrable X and Y, E[X+Y]=E[X]+E[Y], whether or not they are independent.
Variance of a sum
For finite second moments, Var(X+Y)=Var(X)+Var(Y)+2Cov(X, Y).
Independent-sum variance
For independent X and Y, Var(X + Y) = Var(X) + Var(Y); variances add.
Sample mean
X-bar = (X1 + ... + Xn)/n, the average of n observations.
Standard error
The standard deviation of an estimator. For an iid mean with common finite variance sigma squared, it is sigma/sqrt(n).
Square-root-n law
For iid means with a fixed common finite variance, standard error is proportional to 1/sqrt(n).

The Central Limit Theorem

  • State the classical iid finite-variance CLT as convergence of standardized distributions.
  • Distinguish a normal approximation from an exact normal sampling distribution and from the law of large numbers.
  • Calculate and check approximations for sums and means without treating a sample-size rule as a guarantee.

A sample mean has a sampling distribution. For iid observations with finite mean mu and finite positive variance sigma squared, the classical central limit theorem describes the limit of that distribution after centering and rescaling. It does not make the observed data normal or provide a universal sample-size cutoff. This lesson separates the theorem, a finite-sample approximation, and an exact normal-model calculation.

The big picture

Compare a sum of independent die rolls with a sum of independent exponential waits. The observations have very different shapes. After subtracting the sum's mean and dividing by its SD, their distribution functions converge to the same standard-normal function as the number of terms grows. The finite positive variance and iid conditions are doing work in this comparison.

The theorem concerns a sequence of standardized random variables, one for each sample size. It gives a limiting distribution, not an exact distribution at n=30 or n=100. The rate of convergence depends on the underlying distribution and the probability region being approximated. Evaluate a proposed approximation against the model when an exact calculation or a useful error bound is available.

Key idea: under the classical iid finite-positive-variance assumptions, standardized sums converge in distribution to a standard normal. The unstandardized mean instead concentrates around mu.

The statement, in words and in symbols

Let X1, X2,... be iid, with E[X1]=mu and 0<Var(X1)=sigma squared<infinity. Then for each fixed real z, P((X-bar-mu)/(sigma/sqrt(n)) less than or equal to z) tends to Phi(z) as n tends to infinity. Phi is the standard-normal cdf. This is convergence in distribution. [1]

For a finite n, a normal approximation may be written as follows, with the second parameter of Normal denoting variance:

X-bar is approximately Normal(mu, sigma²/n), equivalently z = (X-bar - mu) / (sigma / √n) is approximately standard normal,

The theorem is an asymptotic statement about standardized cdfs. A normal approximation for the sum uses mean n mu and variance n sigma squared; for the average it uses mean mu and variance sigma squared/n. Approximation error need not decrease monotonically at each successive n, and the theorem alone does not supply a finite-sample error bound.

The four panels show exact density curves for standardized means of independent rate-1 exponential observations, at n=1,4,16,64. Each panel compares sqrt(n)(X-bar-1) with the standard-normal density. The individual-observation law remains exponential; the standardized sampling distribution changes with n. These are calculated model densities, not histograms or simulated observations.

For iid rate-1 exponential observations,the standardized mean sqrt(n)(X-bar-1) has an exactly computable transformed gamma density. Its shapes for n=1,4,16,64 approach the standard normal reference. These are exact model curves,not simulations.
For iid rate-1 exponential observations,the standardized mean sqrt(n)(X-bar-1) has an exactly computable transformed gamma density. Its shapes for n=1,4,16,64 approach the standard normal reference. These are exact model curves,not simulations.

Why the bell appears

The dice from last lesson already told the story in miniature. One die is flat. The total of two dice is a triangle, because middle totals like 7 can be assembled six ways while a 2 needs both dice to cooperate on snake eyes. Middling results have many routes; extreme results require every ingredient to lean the same way at once, and independent ingredients rarely coordinate. Each additional die convolves the shape once more, rounding the corners, and by four or five dice the total's histogram is visibly bell-like.

A tail need not require most draws to be extreme together. One unusually large observation can dominate a sum in a heavy-tailed model, and the chance of a large deviation need not decay exponentially. The elementary dice picture is useful intuition, not a general proof. Independent normal variables do have an exactly normal sum, but convergence for nonnormal variables requires the theorem's assumptions.

Key idea: use the precise limit statement. A visual story about smoothing or rare extremes cannot replace its conditions or prove the accuracy of a tail approximation.

How large must n be?

No fixed n guarantees a chosen approximation error for every finite-variance distribution. For normal observations, the mean is exactly normal at every positive n. Skewness, tail weight and the region of interest affect a nonnormal approximation. For a binomial variable, checks on np and n(1-p) can be useful heuristics, but they do not certify a specified tail error. Exact binomial probabilities provide a direct comparison. [2]

For a binomial(30,.001) count,the standardized cdf has a jump of about .970431 at the zero-count value. This is far from a continuous normal cdf despite n=30; the classical CLT is an asymptotic statement.
For a binomial(30,.001) count,the standardized cdf has a jump of about .970431 at the zero-count value. This is far from a continuous normal cdf despite n=30; the classical CLT is an asymptotic statement.

Worked example: an average

Assume 25 independent observations from a normal population with mean 100 and SD 15. What is the probability the sample mean exceeds 106? [1]

Step 1, standard error: sigma / √n = 15 / √25 = 15 / 5 = 3.

Step 2, standardize the average: z = (106 - 100) / 3 = 6 / 3 = 2.0.

Step 3, normal tail: P(Z > 2) = 0.0228, about 2.3%. (The empirical rule's estimate is 2.5%, since 95% lies within 2 standard deviations.)

Under this explicitly normal iid model, a single observation exceeds 106 with probability about 0.3446, while a mean of 25 exceeds it with probability about 0.02275. Their standard deviations are 15 and 3. Using the correct denominator is necessary, but it does not by itself justify a normal model for other populations.

When only the moments are known

The same mean 100 and SD 15 do not determine the distribution of an observation or a mean of 25 observations. Without normality or more distributional information, neither of the preceding tail values is established. An asymptotic theorem by itself does not settle the error at n=25.

For a counterexample to a universal n=30 guarantee, let each observation be Bernoulli with p=0.001. A sample of 30 has probability (0.999)^30, approximately 0.97043, of being entirely zero. Its mean therefore has a large point mass at zero. The standardized variable still satisfies the classical CLT as n grows with p fixed, but a smooth normal curve is a poor description of that n=30 distribution.

Worked example: 100 coin flips

Flip a fair coin independently 100 times. How likely is it to land 60 or more heads? The count H is binomial with n = 100 and p = 0.5, a sum of 100 independent 0-or-1 indicators, so the CLT applies to it directly. Its mean is np = 50 and its standard deviation is √(np(1-p)) = √(100 × 0.5 × 0.5) = √25 = 5. Standardize 60: z = (60 - 50)/5 = 2.0, giving a tail of about 0.0228. [1]

The exact binomial tail is approximately 0.02844397. A continuity correction uses 59.5 on the continuous scale, giving z=1.9 and a normal tail of approximately 0.02871656. In this specific example that is closer than the uncorrected approximation 0.02275013. The success-failure counts of 50 and 50 are favorable heuristics; the exact calculation, not the heuristic alone, quantifies the actual error.

Worked example: the polling margin of error

In an idealized model, take 1,000 iid Bernoulli responses with p=0.5. Their sample proportion has mean 0.5 and SE=sqrt(0.25/1000), approximately 0.015811. A normal approximation describes this model's sampling variation; a real poll may also involve unequal weights, clustering, coverage error, nonresponse and an appreciable sampling fraction. [2]

Multiplying the model SE by 1.959964 gives approximately 0.030990, or 3.10 percentage points. A central normal sampling window around the known p is approximately [0.46901,0.53099]. Constructing an interval for an unknown p is a separate inferential task. Neither this window nor a conventional margin of sampling error includes every source of survey error.

Try it

Suppose 64 iid bag weights have mean 500 grams and SD 20 grams, but their distribution is otherwise unknown. (a) Compute the SE of their mean and the normal-approximation estimate for P(X-bar<495). Is its accuracy guaranteed by the supplied information? (b) If a single bag weight is instead explicitly normal with those moments, compute P(X<495).

Worked answer. (a) The SE is exactly 20/sqrt(64)=2.5 under the iid finite-variance assumptions. Standardizing 495 gives z=-2, so a normal approximation would give about 0.022750. The stated moments and sample size do not guarantee its accuracy. (b) With the additional normal model for an individual bag, z=-0.25 gives probability approximately 0.401294. The individual calculation is model-exact apart from numerical rounding.

What the CLT does not say

Misreadings of the theorem are common enough to deserve their own section, so here are the boundaries, stated bluntly.

  • It does not say the population becomes normal. Incomes stay skewed no matter how many people you survey; only the distribution of the sample average normalizes.
  • It does not say individual observations settle down. Each new draw is as variable as the first; the steadiness belongs to the average alone.
  • It does not repair bias. Averaging a miscalibrated scale gives a very precise wrong answer: the standard error shrinks toward zero while the systematic error stays put.
  • The classical version here requires finite positive variance. Other limit theorems have different hypotheses. For independent standard Cauchy observations, the sample mean is standard Cauchy at every n; its mean and variance are undefined. This provides a counterexample to an unrestricted claim that averaging always produces normality or concentration.
  • It does not make n = 30 a magic threshold, and it does not apply automatically to dependent draws; correlated observations can need very different treatment.

Which limit theorem is being used?

There are many central limit theorems. Some allow nonidentical distributions or dependence under additional hypotheses. This course uses the classical iid version and does not infer those broader results from it. At a finite sample size, check the assumptions, the intended approximation and the error tolerance separately. [1]

The law of large numbers concerns concentration of the mean around its expectation. The CLT concerns the shape of the centered, rescaled fluctuation. They answer different questions. A later lesson derives a finite-variance weak law from Chebyshev's inequality and contrasts it with the CLT.

Where people get stuck

A frequent error is standardizing an average with the observation SD instead of the mean SE. Another is using a standard normal table without a valid normal model or justified approximation. First identify the random quantity, then its joint sampling assumptions and moments, and finally the distributional result that permits the probability calculation.

Second, applying normal-shape reasoning to raw data because n is large. A histogram of 10000 incomes is still skewed; largeness of the sample never reshapes individuals. The bell belongs to X-bar, a quantity you only see by imagining many repeated samples.

Third, forgetting the fine print: independence and finite variance. Averages of strongly correlated measurements, like temperatures on consecutive minutes, do not enjoy the sigma/√n shrinkage, because the covariance terms from last lesson refuse to vanish. The theorem earns its power from assumptions, and checking them is part of using it.

Fourth, treating the empirical rule and table landmarks as exact for small n. For n = 5 draws from a skewed population, the "2.5% beyond two sigma" figure can be badly off in one tail. When n is small and the population is far from normal, the honest answers come from the population itself, not the bell.

Common misconceptions

  • "The CLT makes everything normal." It speaks only about sums and averages of many independent pieces. Quantities built by multiplication or by a single dominant cause have no bell guarantee.
  • "n at least 30 guarantees accuracy." It does not. The sparse Bernoulli example has nearly all its mass at one sample-mean value when n=30. Distributional assumptions and the probability region matter.
  • "More data makes each measurement more reliable." Individual variability never changes; sigma is a property of the population. Data volume shrinks only the average's standard error.
  • "The sample mean equals mu for large n." X-bar still wobbles around mu; the CLT describes the wobble as normal with width sigma/√n, shrinking but never zero.

Recap

  • For iid variables with finite mean mu and finite positive variance sigma squared, the cdf of sqrt(n)(X-bar-mu)/sigma converges to the standard normal cdf.
  • The theorem supports a large-n normal approximation for suitable probabilities of sums or means, but supplies no universal sample-size cutoff or finite-n error bound.
  • An average uses SE sigma/sqrt(n) under these assumptions. A single observation uses SD sigma.
  • Fixed-p independent Bernoulli indicators satisfy this classical CLT when 0<p<1. A survey requires additional sampling-design and inference considerations.
  • The CLT neither changes the population distribution nor corrects bias. Some dependent or infinite-variance settings have different limit theorems.
  • Separate concentration of the raw average, the limiting shape of a standardized average, and accuracy of a particular approximation.

Retrieve, explain, and revisit

Close the worked examples before answering: Why does n=30 not guarantee a good normal approximation for Bernoulli p=0.001?

Check the reasoning

The all-zero sample probability is 0.999^30, about 0.970431. A large point mass remains, which a smooth normal curve cannot reproduce accurately.

Return after a day, then again after about a week: An iid normal sample has mean parameter 10, SD 6, and n=9. Find P(Xbar>14) and say whether the normal result is exact or a CLT approximation. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

SE=2 and z=2, so probability is about 0.022750. The sampling distribution is exactly normal because the observations are iid normal.

Sources

  1. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 41; pp. 21 and 35; independent normal sum; p. 42; pp. 39-42.
  2. Orloff and Bloom, MIT 18.05 (2022), Class 6: Central limit theorem and law of large numbers. Cited passages: pp. 7-10; approximation distinguished from exact law; pp. 9-10; explicitly ideal iid model.
Key terms
Classical iid CLT
For iid variables with finite mean and finite positive variance, the standardized centered sum converges in distribution to standard normal.
Sample mean
The arithmetic average of n observations; its distribution depends on their joint law.
Standard error
The SD of an estimator; for the iid finite-variance mean, sigma/sqrt(n).
Convergence in distribution
Convergence of cdf values at continuity points of the limiting cdf.
Continuity correction
A half-unit boundary adjustment when approximating an integer count probability with a continuous normal law.
Approximation error
The difference between an approximate probability and its model-based reference; it depends on the distribution, event and sample size.

Module 6: Distribution Methods and Limit Reasoning

CDFs and transformations, conditional expectations, probability bounds, and generating functions connect calculations to model assumptions.

Distribution Functions, Quantiles, and Transformations

  • Use cdf jumps and left limits to calculate probabilities with correct endpoints.
  • Distinguish a mixed distribution from a density-only model and compute its quantiles.
  • Derive transformed distributions by solving preimage events and checking moments.
  • Explain inverse-transform simulation and its numerical boundaries.

A variable takes the values 0, 1 and 3 with probabilities 0.2, 0.5 and 0.3. What is the chance it is at most 2? What happens to its distribution if you square it? Both questions can be answered by tracking events. A cumulative distribution function supplies one language for discrete, continuous and mixed distributions, and an event-based approach prevents common mistakes when values are transformed.

The cumulative distribution function

For any real-valued random variable X, define F(x)=P(X less than or equal to x). The cdf is nondecreasing and right-continuous, tends to 0 as x tends to negative infinity, and tends to 1 as x tends to positive infinity. It can have flat stretches and jumps. It need not attain 0 or 1 at a finite x, and it need not have a derivative everywhere. [1]

For the three-value example, F(x)=0 below 0; F(x)=0.2 for 0 less than or equal to x less than 1; F(x)=0.7 for 1 less than or equal to x less than 3; and F(x)=1 at and above 3. Thus F(2)=0.7. The cdf remains flat between possible values because no additional probability is accumulated there.

The size of a jump at c is P(X=c)=F(c)-F(c-), where F(c-) is the left limit. At c=1 the jump is 0.7-0.2=0.5. Right-continuity includes the mass at the threshold in F(c). Drawing an open dot on the lower level and a closed dot on the upper level helps distinguish the two values.

Key idea: the cdf is a probability at a threshold. Its height is already a probability; the height of a density is not.

Endpoints change the event

For a less than b, P(a<X<=b)=F(b)-F(a). The subtraction removes everything at or below a, while keeping the mass at b. To include a, use its left limit instead: P(a<=X<=b)=F(b)-F(a-). These formulas also apply to continuous and mixed laws. [1]

In the three-value example, P(0<X<=1)=0.5, whereas P(0<=X<=1)=0.7. The difference is exactly the mass at 0. For an absolutely continuous variable each point has zero mass, so opening or closing an endpoint makes no difference. Do not carry that convenient property into a count problem.

There is also a useful complement distinction: P(X>c)=1-F(c), while P(X>=c)=1-F(c-). For the example, P(X>1)=0.3 and P(X>=1)=0.8. Before touching a calculator, write the event in symbols and identify which endpoints belong to it.

A distribution can mix a point mass and a density

Construct a fictional payment X as follows. With probability 0.4 it is exactly zero. Otherwise, independently select a value uniformly between 0 and 10. The resulting cdf is 0 below zero, 0.4 at zero, 0.4+0.06x for 0<x<10, and 1 at and above 10. The cdf jumps at zero and then rises continuously.

The density 0.06 over (0,10) accounts for probability 0.6. Integrating that density alone cannot recover the missing 0.4 at zero. In this model P(X=0)=0.4 and P(X<=5)=0.7. Describing X as entirely continuous because some values are fractional would lose a substantial part of its distribution.

The mean can be computed by cases: E[X]=0.4 times 0+0.6 times 5=3. The second moment is 0.6 times 100/3=20, so Var(X)=20-3 squared=11. The conditional distribution within the nonzero component and the overall mixture are different objects.

The mixture has mass .4 at zero and probability .6 spread uniformly on (0,10). Its cdf jumps from 0 to .4 at zero,then rises linearly with slope .06 until it reaches 1 at 10.
The mixture has mass .4 at zero and probability .6 spread uniformly on (0,10). Its cdf jumps from 0 to .4 at zero,then rises linearly with slope .06 until it reaches 1 at 10.

Quantiles without assuming a smooth inverse

For 0<p<1, a general quantile convention is Q(p)=inf{x:F(x) greater than or equal to p}. It selects the leftmost threshold at which the cdf reaches p. A smooth strictly increasing cdf can be inverted in the usual algebraic sense, but a jump or flat region requires this more careful definition. [2]

For the three-value variable, Q(0.5)=1 because F(0)=0.2 and F(1)=0.7. There is no x with F(x)=0.5. A request for a median therefore need not be solvable by setting a discrete cdf equal to exactly 0.5. Under the stated convention Q(0.7)=1 and Q(0.8)=3.

For the payment mixture, Q(p)=0 for p up to 0.4, and Q(p)=(p-0.4)/0.06 for p above 0.4. Its median is 5/3, approximately 1.6667, while its mean is 3. The mass at zero and the spread of positive payments affect those summaries differently.

Transform values by transforming events

Let Y=g(X). Begin with F_Y(y)=P(g(X) less than or equal to y). Solve the inequality to identify which original X values qualify, then use their distribution. This method works when g is increasing, decreasing, or many-to-one. It is safer than assuming the new density is simply the old density with a substituted variable. [3]

For an affine transformation Y=aX+b with nonzero a and an absolutely continuous X, the density is f_Y(y)=f_X((y-b)/a)/|a|. The factor 1/|a| compensates for the stretching of interval widths. A negative a reverses the order but cannot produce a negative density. If a=0, Y is a point mass at b and has no ordinary density on the real line.

For example, if X is uniform on [0,1] and Y=4-2X, the new support is [2,4] and the new density is 1/2 there. An interval of Y-width 0.6 corresponds to an X-width 0.3, so both events have probability 0.3. The mean is 3 and the variance is 4 times 1/12, or 1/3.

Remember: transform the support and interval widths along with the numerical values.

A many-to-one transformation

Let X be uniform on [-1,1] and define Y=X squared. Its support is [0,1]. For 0<=y<=1, the event X squared less than or equal to y is the interval from -sqrt(y) to sqrt(y). That interval has length 2sqrt(y), and the original density is 1/2, so F_Y(y)=sqrt(y). [4]

Differentiating on 0<y<1 gives f_Y(y)=1/(2sqrt(y)). The density grows without bound near zero, but its integral from 0 to 1 is 1. There is no atom at zero because F_Y is continuous there. A density can be unbounded and still describe a valid probability law.

This transformed variable is not uniform: P(Y<=1/4)=1/2, whereas a uniform [0,1] variable would give 1/4. The two original preimages, negative and positive, both matter. Using only sqrt(y) as though the transformation were one-to-one would discard half of the relevant probability.

Its moments can be computed without first deriving its density: E[Y]=E[X squared]=1/3, and E[Y squared]=E[X to the fourth]=1/5. Thus Var(Y)=1/5-1/9=4/45. These values provide an independent check on integration against the new density.

For X uniform[-1,1],Y=X squared has cdf sqrt(y) on [0,1] and density 1/(2sqrt(y)) on (0,1). The density grows without bound near zero and is clipped vertically in the plot; the cdf is continuous and there is no atom at zero.
For X uniform[-1,1],Y=X squared has cdf sqrt(y) on [0,1] and density 1/(2sqrt(y)) on (0,1). The density grows without bound near zero and is clipped vertically in the plot; the cdf is continuous and there is no atom at zero.

Inverse-transform simulation

If U is uniform on (0,1), Q(U), using the generalized quantile, has cdf F. For the discrete example, map U up to 0.2 to 0, values above 0.2 up to 0.7 to 1, and the remainder to 3. The interval lengths supply the required masses. Endpoint conventions do not alter ideal uniform probabilities, but software should handle boundary values explicitly. [2]

For an exponential distribution with rate lambda, solve u=1-exp(-lambda x). The result is x=-ln(1-u)/lambda. With lambda=2 and u=0.75, x=ln(4)/2, approximately 0.693147. Substituting this x back into the cdf returns 0.75. The transformation shows why the logarithm appears in one method for simulating exponential waits.

A pseudorandom implementation must avoid taking ln(0) at an endpoint and should document its algorithm, seed and parameterization. Increasing the number of simulated draws reduces ordinary Monte Carlo sampling error under the simulation assumptions; it does not correct a wrong target distribution or data-generating model.

Why the inverse construction works. For 0<u<1, the generalized quantile satisfies Q(u)<=x exactly when u<=F(x). Monotonicity and right continuity of F justify the boundary case in this equivalence. Therefore P(Q(U)<=x)=P(U<=F(x))=F(x) for an ideal uniform U on (0,1). This argument also covers jumps and flat sections, without differentiating F.

Common misconceptions

  • A cdf and a density have interchangeable heights. A cdf height is a cumulative probability. A density must be integrated.
  • A derivative captures every distribution. A cdf can have jumps or a singular part. Differentiating the payment mixture loses the point mass unless it is retained separately.
  • Every quantile solves F(x)=p. A jump can skip p. The generalized inverse still defines a threshold.
  • Squaring a uniform variable leaves it uniform. The preimage lengths change; the worked square transformation gives a nonconstant density.

Recap

A cdf works across discrete, continuous and mixed distributions. Keep its endpoint conventions explicit. For transformations, solve the event g(X)<=y, retain every contributing preimage, and verify the support and total probability. Check moments by more than one route when possible. Quantiles provide thresholds and a constructive route to simulation.

Retrieve, explain, and revisit

Close the worked examples before answering: What cdf expression gives the probability exactly at c?

Check the reasoning

F(c)-F(c-), the jump at c.

Return after a day, then again after about a week: For X uniform on [-1,1], find P(X squared<=0.09). Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

The preimage is [-0.3,0.3], whose length 0.6 is 0.3 of the full length 2.

Sources

  1. Scott Sheffield, MIT 18.175 (2014), Lecture 3: Distributions. Cited passages: p. 6; p. 6; cdf and probability measure characterization.
  2. MIT 14.381 (2018), Lecture 1: Distributions and normal random variables. Cited passages: p. 1; p. 1; generalized inverse definition, academy proof follows.
  3. Orloff and Bloom, MIT 18.05 (2022), Class 5: Transforming continuous random variables. Cited passages: pp. 1-3.
  4. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: pp. 31-32; transform via cdf.
Key terms
CDF
The function F(x)=P(X less than or equal to x).
Left limit
The limiting cdf value approaching a threshold from below, before its point mass is included.
Point mass
A positive probability assigned to one exact value, represented by a cdf jump.
Quantile
Under the stated convention, the leftmost threshold whose cdf reaches the requested probability.
Preimage
The original input values that satisfy a condition on a transformed variable.
Inverse-transform simulation
Constructing a target random variable by applying its generalized quantile to a uniform variable.

Joint Densities and Conditional Expectation

  • Derive marginal and conditional densities from a joint density and its support.
  • Use iterated expectation to calculate means and mixed moments.
  • Decompose variance into within-group and between-group components.
  • Explain the squared-error prediction role and limits of a conditional mean.

A joint density puts probability over a region of the plane. Knowing one coordinate changes the available values of the other. This lesson connects that geometry to conditional means and variances. You will derive one complete model, then use a second, discrete mixture to separate variation within groups from variation between group means.

Start with the support

Define the joint density f(x, y)=2 when 0<x<y<1, and zero elsewhere. Its support is the triangular region above the diagonal y=x inside the unit square. The triangle has area 1/2, so the total probability is 2 times 1/2=1. The nonnegative function therefore defines a valid joint density. [1]

The support is as much a part of the model as the formula 2. Extending that formula to the whole unit square would produce total mass 2 and would be invalid. The boundary lines have area zero, so changing density values on those lines does not change probabilities.

For a region A, calculate P((X, Y) in A) by integrating the joint density over the part of A inside the support. In this constant-density example, that is twice the qualifying area. For instance, X>1/2 describes a small triangle with area 1/8, giving probability 1/4.

Marginals integrate out the other variable

Fix x between 0 and 1. The allowed y values run from x to 1. Thus f_X(x) is the integral of 2 with respect to y from x to 1, which equals 2(1-x). Fix y instead: x runs from 0 to y, so f_Y(y) is the integral of 2 with respect to x from 0 to y, or 2y. Both marginals are zero outside (0,1). [1]

Each marginal integrates to 1. Their shapes also make sense: small X values allow longer vertical slices, while large Y values allow longer horizontal slices. Although the joint density is constant over a triangle, neither coordinate is uniform on (0,1).

X and Y are dependent. In the region x>y, the joint density is zero, while the product 2(1-x) times 2y is positive for interior values. Independence would require the joint density to equal the product of its marginals almost everywhere. Factoring the expression 2 without considering its support misses this dependence.

Conditioning on a continuous value

For y with f_Y(y)>0, a conditional density is f_X|Y(x|y)=f(x, y)/f_Y(y). Here it is 1/y on 0<x<y, and zero elsewhere. Thus X given Y=y is uniform on (0, y). When y=0.6, the conditional density is 1/0.6 and its interval has width 0.6, so its integral is 1. [2]

This is not the event formula P(A and Y=y)/P(Y=y): both numerator and denominator would be zero. Conditional densities are defined through the joint density and provide a version of a conditional distribution for almost every y under the marginal law. Values at exceptional points with zero marginal density need not be uniquely specified by the joint law.

For y=0.6, P(X<0.2 given Y=0.6)=0.2/0.6=1/3. The unconditional probability is instead the integral of 2(1-x) from 0 to 0.2, or 0.36. Conditioning changes the distribution used in the calculation.

The joint support is the triangle 0<x<y<1 with density 2. At y=.6,the conditional support is 0<x<.6 and density is 1/.6,so the shaded first .2 units have conditional probability 1/3.
The joint support is the triangle 0<x<y<1 with density 2. At y=.6,the conditional support is 0<x<.6 and density is 1/.6,so the shaded first .2 units have conditional probability 1/3.

A conditional mean is a function

Given Y=y, the uniform mean is y/2. Write m(y)=E[X|Y=y]=y/2. Once a specific y has been supplied, m(y) is a number. Before Y is observed, E[X|Y]=m(Y)=Y/2 is itself a random variable. The notation distinguishes the random predictor from its value at an observed input. [2]

The law of iterated expectation says E[E[X|Y]]=E[X] when E[|X|] is finite. Here E[Y]=2/3, found by integrating y times 2y over (0,1). Therefore E[X]=E[Y/2]=1/3. Direct integration of x times 2(1-x) also gives 1/3. Two independent routes agree.

In the discrete case, the same calculation is a weighted average over groups: E[X]=sum over y of E[X|Y=y]P(Y=y). Include groups with positive probability. A zero-probability group contributes no mass and does not require division by zero to define a conditional mean for this calculation.

Key idea: average the conditional means using the probabilities of the conditioning groups, not equal weights unless the groups are equally probable.

Why the conditional mean is a useful predictor

Suppose X has a finite second moment and you predict it by g(Y). Set m(Y)=E[X|Y]. For any predictor with finite mean squared error, E[(X-g(Y)) squared]=E[(X-m(Y)) squared]+E[(m(Y)-g(Y)) squared]. The cross term vanishes because E[X-m(Y)|Y]=0. [2]

The second term is nonnegative, so the conditional mean minimizes mean squared prediction error among predictors based on Y. This optimality is specific to squared loss. A different loss function defines a different prediction problem.

In the triangle model, observing Y=0.6 gives a squared-error-optimal prediction of X=0.3. It does not make X deterministic: its conditional variance is 0.6 squared/12=0.03. A prediction and the uncertainty remaining around it belong together.

Separate two sources of variance

For finite E[X squared], the law of total variance is Var(X)=E[Var(X|Y)]+Var(E[X|Y]). The first term measures the average variation left within conditional distributions. The second measures how much the conditional means vary. Both terms are nonnegative. [2]

For the triangle model, Var(X|Y=y)=y squared/12. Since E[Y squared]=1/2, the average conditional variance is 1/24. Also Var(Y)=1/2-(2/3) squared=1/18, so Var(Y/2)=1/72. Adding gives 1/24+1/72=1/18.

Check directly: E[X squared] is the integral of 2x squared(1-x) from 0 to 1, or 1/6. Then Var(X)=1/6-(1/3) squared=1/18. The decomposition reproduces the marginal variance and explains where it comes from.

The average conditional variance cannot exceed the unconditional variance. A particular conditional group can still have variance greater than the overall variance. The theorem concerns the weighted average across groups, not an inequality that must hold for every individual group.

A discrete mixture calculation

Consider a fictional output X from two operating modes. Mode A occurs with probability 1/4 and produces either 1 or 3 with equal conditional probability. Mode B occurs with probability 3/4 and produces either 6 or 10 with equal conditional probability. The conditional means are 2 and 8; the conditional variances are 1 and 4.

The overall mean is (1/4)2+(3/4)8=6.5. The within-mode variance term is (1/4)1+(3/4)4=3.25. The between-mode term is (1/4)(2-6.5) squared+(3/4)(8-6.5) squared=6.75. Total variance is therefore 10.

A direct check uses marginal probabilities 1/8,1/8,3/8,3/8 at values 1,3,6,10. The second moment is 52.25 and the squared mean is 42.25, giving variance 10. Averaging only the two within-mode variances would omit the separation between the mode means.

A two-mode mixture with weights .25,.75,conditional means 2,8 and variances 1,4 has mean 6.5. Its variance is within-mode contribution 3.25 plus between-mode contribution 6.75,total 10.
A two-mode mixture with weights .25,.75,conditional means 2,8 and variances 1,4 has mean 6.5. Its variance is within-mode contribution 3.25 plus between-mode contribution 6.75,total 10.

Connect conditional expectation to covariance

In the triangle model, E[XY]=E[Y E[X|Y]]=E[Y squared]/2=1/4. Thus Cov(X, Y)=1/4-(1/3)(2/3)=1/36. Both marginal variances are 1/18, so the correlation is (1/36)/(1/18)=1/2.

This calculation saves a double integral, but the identity still depends on the joint law. Marginal means alone cannot determine E[XY]. Conditioning organizes the dependence already present in the model; it does not invent missing joint information.

Likewise, a conditional difference does not by itself identify a causal effect. The two operating modes describe groups in a specified joint distribution. Predicting output after observing a mode and predicting what would happen after an intervention that changes the mode are different questions. A causal claim needs assumptions beyond these probability calculations.

Common misconceptions

  • A constant joint density makes both marginals uniform. Slice lengths and support geometry matter.
  • Conditioning on an exact continuous value is division by its point probability. Use a conditional density, with a positive marginal density and the stated version qualifications.
  • Total variance is just average conditional variance. Add the variation in conditional means.
  • Conditional means predict perfectly. Residual conditional variance usually remains.
  • Observed conditional differences establish causation. They describe a joint model; interventions require further justification.

Recap

Draw the support before integrating. Obtain marginals by integrating out one coordinate, then normalize a joint slice to obtain a conditional density. Treat E[X|Y] as a function of a random input. Iterated expectation and total variance let you compute marginal moments while retaining the meaning of within-group and between-group variation.

Retrieve, explain, and revisit

Close the worked examples before answering: What term is missing when someone says Var(X)=E[Var(X|Y)]?

Check the reasoning

The variance of the conditional mean, Var(E[X|Y]).

Return after a day, then again after about a week: For the triangular model, find E[X|Y=0.8] and the residual conditional variance. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

The conditional law is uniform on (0,0.8), with mean 0.4 and variance 0.8 squared/12=4/75, about 0.053333.

Sources

  1. Orloff and Bloom, MIT 18.05 (2022), Class 7: Joint distributions. Cited passages: p. 3; pp. 7-8.
  2. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 24; pp. 25 and 33; pp. 65-66; p. 33.
Key terms
Joint density
A nonnegative function whose integral over a region gives joint probability.
Marginal density
The density of one coordinate after the other is integrated out.
Conditional density
For a positive marginal density, a normalized joint slice describing one variable given the other.
Conditional expectation
A mean conditional on specified information, which is a function of that information.
Iterated expectation
The identity E[E[X|Y]]=E[X] for an integrable X.
Total variance
The decomposition Var(X)=E[Var(X|Y)]+Var(E[X|Y]) for a finite second moment.
Squared-error loss
The squared difference between an outcome and its prediction.

Probability Bounds and the Law of Large Numbers

  • Derive and apply Markov and Chebyshev inequalities with their assumptions.
  • Use a variance bound to prove a finite-variance weak law and obtain a sufficient sample size.
  • Distinguish exact probabilities, bounds and approximations.
  • Compare weak and strong laws with the classical central limit theorem.

You know a nonnegative quantity has mean 12, but you do not know its distribution. Can you still say anything about its chance of reaching 60? Yes: its probability is at most 1/5. Probability inequalities turn limited information into valid bounds. They also explain why averages can become reliable under suitable assumptions, without requiring a normal approximation.

Markov's inequality

If X is nonnegative, E[X] is finite, and a>0, then P(X>=a)<=E[X]/a. On the event X>=a, X contributes at least a to the expectation. More formally, X is at least a times the indicator of that event. Taking expectations gives E[X]>=a P(X>=a), which is the inequality. [1]

For E[X]=12 and a=60, the bound is 12/60=0.2. This does not say that the probability equals 0.2. X could be constantly 12, in which case the probability is zero. Alternatively, X could equal 60 with probability 0.2 and zero otherwise; that distribution has mean 12 and attains the bound.

If a=5, the calculation gives 12/5=2.4. A probability is already at most 1, so use the stronger bound min(1, E[X]/a). A numerical bound above 1 is not an invalid probability model. It is an uninformative application of the inequality.

Nonnegativity is essential. A variable equally likely to be -100 or 100 has mean zero but probability 1/2 of being at least 50. Substituting its mean into Markov's formula would incorrectly give a bound of zero. Apply the theorem to a nonnegative variable such as |X| or X squared when the required expectation exists.

Chebyshev's inequality

If X has mean mu and finite variance sigma squared, then for t>0, P(|X-mu|>=t)<=sigma squared/t squared. Apply Markov's inequality to the nonnegative variable (X-mu) squared with threshold t squared. No normality assumption is needed. [1]

Suppose a fictional measurement has mean 20 and standard deviation 3. The probability of being at least 6 units from its mean is at most 9/36=1/4. Therefore the probability of being strictly between 14 and 26 is at least 3/4. If the distribution were known to be normal, a more specific calculation would give a central probability about 0.9545. The normal value uses additional information.

For k>0 and positive sigma, the equivalent form is P(|X-mu|>=k sigma)<=1/k squared. At k=3, the upper bound is 1/9. It does not yield the normal 99.7% rule. Chebyshev's result is broader and often less sharp because it works across all distributions with the specified finite variance.

Endpoint choices matter. The displayed inequality bounds an event with greater-than-or-equal-to. Its complementary guarantee concerns the strict central interval. Replacing an endpoint silently can change an exact probability for a discrete law, even when the same upper bound still provides a valid weaker statement.

Apply the bound to an average

Let X1,..., Xn be independent and identically distributed, with mean mu and finite variance sigma squared. Their average has mean mu and variance sigma squared/n. Chebyshev therefore gives P(|Xbar-mu|>=epsilon)<=sigma squared/(n epsilon squared) for each epsilon>0. [1]

For a fixed positive epsilon, the right-hand side tends to zero as n grows. Thus Xbar converges in probability to mu. This is the finite-variance version of the weak law of large numbers. The theorem says that large deviations from the mean become improbable; it does not say the observed running average must get closer at every step.

Independent, identically distributed observations are sufficient for this version. They are not necessary for every law of large numbers. For example, the same variance argument works for pairwise uncorrelated variables sharing a mean and a common finite variance. More general theorems require their own assumptions and should not be invoked merely because a data set is large.

A concrete sample-size guarantee

Suppose independent observations have a known common mean and variance, with standard deviation 4. To make P(|Xbar-mu|>=0.5) at most 0.05 using Chebyshev, require 16/(n times 0.25)<=0.05. Solving gives n>=1280. This is a sufficient sample size under the stated assumptions.

The number 1280 need not be the smallest adequate sample size for the actual distribution. A distribution-specific calculation might need fewer observations. Also, replacing the known variance with an estimate does not automatically retain the same rigorous guarantee. The proof used the actual variance.

A claim about the sample mean's random error is not a guarantee about systematic error. If every observation contains the same additive calibration error, averaging cannot remove that shared component. Identify what the model includes before interpreting a numerical sample-size result.

Compare a bound with an exact probability

Let K be binomial with n=1000 and p=0.5, and let Xbar=K/1000. The mean is 0.5 and the variance is 0.25/1000. For epsilon=0.05, Chebyshev gives P(|Xbar-0.5|>=0.05)<=0.1.

The exact event is K<=450 or K>=550. Its probability is the sum of the two binomial tails, about 0.001731. The upper bound 0.1 remains correct, but it is much larger. A valid bound can be conservative without being a computational mistake.

Do not change this event to K<450 or K>550 when comparing methods. Those events omit the endpoint masses. State the integer event first, then calculate it. A continuity-corrected normal approximation is another estimate, while the binomial calculation is exact under the binomial model, apart from numerical rounding.

For K binomial(1000,.5),the inclusive two-tail probability is .001730536. The continuity-corrected normal approximation is .001744170 and the Chebyshev upper bound is .1. The vertical scale is logarithmic; the bound is not an estimated event probability.
For K binomial(1000,.5),the inclusive two-tail probability is .001730536. The continuity-corrected normal approximation is .001744170 and the Chebyshev upper bound is .1. The vertical scale is logarithmic; the bound is not an estimated event probability.

The weak law and the strong law

Convergence in probability means that for every fixed epsilon>0, the probability of an error exceeding epsilon tends to zero. Almost-sure convergence means that, except on a probability-zero set of complete infinite sequences, the running averages converge. These are different mathematical statements about random sequences. [1]

The standard independent, identically distributed strong law holds when E[|X1|] is finite: the averages converge almost surely to E[X1]. It does not require finite variance. The finite-variance Chebyshev proof above is a convenient proof of a sufficient version of the weak law, not the most general possible law of large numbers.

For example, a Pareto variable with P(X>x)=x to the power -3/2 for x>=1 has finite mean 3 but infinite second moment. Independent copies satisfy the integrable strong law. They do not satisfy the finite-variance assumptions of the classical normal central limit theorem taught in this course. A theorem's failure to apply does not mean all limiting behavior disappears.

Why dependence can prevent averaging from helping

Let Z be a Bernoulli variable with probability 1/2 of 1, and set every observation Xi=Z. Each observation has mean 1/2 and variance 1/4. But their average is always Z, regardless of n. Consequently P(|Xbar-1/2|>=1/4)=1 for every n. [2]

The usual variance formula sigma squared/n fails because all cross-covariances equal 1/4. Repeating the same random information is not equivalent to obtaining independent observations. This counterexample identifies exactly which assumption fails in the simple weak-law argument.

A less extreme model is Xi=Z+Ei, with independent zero-mean noises Ei independent of the common component Z. If Var(Z)=a and Var(Ei)=b, then Var(Xbar)=a+b/n. Averaging reduces the individual noise contribution, while the common component remains.

Independent Bernoulli(.5) observations have average variance 1/(4n). If every observation is a copy of one Bernoulli Z,the average is always Z and retains variance 1/4. Marginal laws alone do not imply concentration.
Independent Bernoulli(.5) observations have average variance 1/(4n). If every observation is a copy of one Bernoulli Z,the average is always Z and retains variance 1/4. Marginal laws alone do not imply concentration.

Distinguish concentration from standardized shape

The law of large numbers concerns Xbar itself approaching a constant. The classical iid central limit theorem concerns sqrt(n)(Xbar-mu)/sigma approaching a standard normal distribution when the common variance is finite and positive. One result describes concentration; the other describes the shape after rescaling the remaining fluctuations. [3]

These statements are compatible. As the raw average becomes more concentrated, multiplying its centered error by sqrt(n) compensates for the shrinking spread. The raw average does not converge to a fixed normal law with positive variance under these assumptions.

The distinction also explains why an error tolerance must be specified. A fixed tolerance such as 0.05 becomes generous relative to a shrinking standard error. A tolerance proportional to 1/sqrt(n) keeps pace with that standard error and can retain a nonzero limiting tail probability.

Common misconceptions

  • A bound is the exact probability. It is an inequality, and equality may or may not be attainable for the particular model.
  • A large sample corrects bias or shared errors. Averaging addresses only variation governed by the model's assumptions.
  • The law says every new observation improves the running mean. Convergence allows fluctuations along the way.
  • Finite variance is required for every law of large numbers. The integrable iid strong law is more general than the elementary variance proof.
  • The CLT and LLN say the same thing. They concern different scalings and different forms of convergence.

Recap

Key idea: Use Markov for a nonnegative variable with finite mean and Chebyshev when finite variance is available. Treat their answers as bounds. Apply Chebyshev to an average to derive a weak law under the stated variance assumptions. Distinguish convergence in probability, almost-sure convergence, and the distributional limit of a standardized average.

Retrieve, explain, and revisit

Close the worked examples before answering: What does a probability bound of 0.2 actually claim?

Check the reasoning

The probability is at most 0.2; it need not equal 0.2.

Return after a day, then again after about a week: A nonnegative X has mean 8. Bound P(X>=40), and give a distribution attaining the bound. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

Markov gives 0.2. Take X=40 with probability 0.2 and X=0 with probability 0.8.

Sources

  1. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 39; pp. 39-40; pp. 40 and 42.
  2. Orloff and Bloom, MIT 18.05 (2022), Class 7: Covariance and correlation. Cited passages: pp. 1-2 and 9; covariance contribution.
  3. Orloff and Bloom, MIT 18.05 (2022), Class 6: Central limit theorem and law of large numbers. Cited passages: pp. 7-8.
Key terms
Markov inequality
For nonnegative X and a>0, P(X>=a)<=E[X]/a when the mean is finite.
Chebyshev inequality
For finite variance and t>0, P(|X-E[X]|>=t)<=Var(X)/t squared.
Convergence in probability
For each fixed positive error tolerance, the probability of exceeding it tends to zero.
Almost-sure convergence
Convergence along every infinite outcome sequence except a set of probability zero.
Weak law of large numbers
A theorem giving convergence in probability of averages to a mean under specified assumptions.
Strong law of large numbers
A theorem giving almost-sure convergence of averages to a mean under specified assumptions.
Conservative bound
A valid inequality that can lie well above or below the exact quantity it bounds.

Generating Functions, Convolution, and Approximation

  • Compute a sum distribution by convolution and probability generating functions.
  • Recover moments from pgf and mgf derivatives with their finiteness conditions.
  • Derive independent binomial, Poisson and same-rate exponential sum laws.
  • Distinguish exact sum identities from finite-sample approximations and random-sum variation.

Two independent devices produce an alert with probabilities 0.2 and 0.8. Their total alert count has mean 1, just like a binomial count with two trials and probability 0.5. Their distributions are nevertheless different. Convolution and generating functions show exactly how independent contributions combine, while keeping the assumptions and the entire distribution visible.

Discrete convolution lists the ways to reach a total

For independent integer-valued X and Y, P(X+Y=k)=sum over j of P(X=j)P(Y=k-j). Each pair (j, k-j) is one mutually exclusive route to the required total. Independence is what permits multiplying the two marginal probabilities. Without it, use the corresponding joint probabilities instead. [1]

Let X be Bernoulli(0.2) and Y be independent Bernoulli(0.8). The total S is zero with probability 0.8 times 0.2=0.16. It is two with probability 0.2 times 0.8=0.16. It is one with probability 0.2 times 0.2+0.8 times 0.8=0.68.

These masses total 1. The mean is 0.68+2(0.16)=1, and the second moment is 0.68+4(0.16)=1.32, so the variance is 0.32. The variance also equals 0.2(0.8)+0.8(0.2). A binomial(2,0.5) variable instead has masses 0.25,0.50,0.25 and variance 0.5. Equal means do not identify equal laws.

Convolving independent Bernoulli(.2) and Bernoulli(.8) gives masses .16,.68,.16 and variance .32. Binomial(2,.5) has the same mean 1 but masses .25,.5,.25 and variance .5.
Convolving independent Bernoulli(.2) and Bernoulli(.8) gives masses .16,.68,.16 and variance .32. Binomial(2,.5) has the same mean 1 but masses .25,.5,.25 and variance .5.

Encode a count distribution in a function

For a nonnegative integer-valued X, define its probability generating function G_X(s)=E[s to the power X]=sum over k>=0 of P(X=k)s to the power k. On 0<=s<=1, the series converges because its nonnegative terms are bounded by the probabilities. At s=0, use the convention 0 to the power 0=1, so G_X(0)=P(X=0). Also G_X(1)=1. [1]

The coefficient of s to the power k is P(X=k). For example, G(s)=0.16+0.68s+0.16s squared encodes the two-device law. Reading the coefficient of s squared gives the probability of two alerts. Evaluating G at a general s such as 0.5 does not instead mean P(X<=0.5); a generating function is not a cdf.

For independent nonnegative integer X and Y, G_X+Y(s)=G_X(s)G_Y(s). This follows from s to the power (X+Y) being the product of s to the power X and s to the power Y, together with independence. Multiplying their power series performs exactly the convolution of the coefficients.

For the devices, (0.8+0.2s)(0.2+0.8s)=0.16+0.68s+0.16s squared. The algebra reproduces the direct enumeration. If Y were a copy of X rather than an independent variable, multiplying the marginal generating functions would not describe their sum.

Generate moments from derivatives

Differentiating a probability generating function gives G'(s)=sum k P(X=k)s to the power (k-1). As s approaches 1 from below, this tends to E[X], with an infinite limit allowed. If the mean is finite, write G'(1-)=E[X]. The left-limit notation avoids assuming that the series remains finite for s>1. [1]

The second derivative gives G''(1-)=E[X(X-1)] when that expectation is finite. Since X squared=X(X-1)+X, the variance is G''(1-)+G'(1-)-(G'(1-)) squared. The second derivative alone is a factorial moment, not the second ordinary moment or the variance.

For G(s)=0.16+0.68s+0.16s squared, the derivatives at 1 are 1 and 0.32. The variance formula gives 0.32+1-1=0.32. This independent calculation is useful for catching a missing coefficient or a mistaken derivative.

Recognize binomial and Poisson sums

A Bernoulli(p) variable has G(s)=1-p+ps. The sum of n independent Bernoulli variables with the same p has G(s)=(1-p+ps) to the power n. Expanding by the binomial theorem gives the binomial pmf. Equal success probabilities and independence are both present in this construction. [2]

If X and Y are independent binomial variables with counts n and m and a common success probability p, multiplying their generating functions gives a binomial(n+m, p) law. If their success probabilities differ, this particular binomial conclusion generally fails, as the two-device example demonstrates.

A Poisson variable of mean lambda has G(s)=exp(lambda(s-1)). This follows by factoring exp(-lambda) from the pmf series and recognizing the exponential series. Independent Poisson variables with means lambda and nu therefore have a Poisson sum with mean lambda+nu.

Independence is essential to that sum rule. If X is Poisson(lambda) and Y=X, their sum is 2X and takes only even values. For positive lambda it cannot have a Poisson(2lambda) law, which assigns positive probability to odd counts. Matching the means does not repair the missing assumption.

Moment generating functions and their domains

Define M_X(t)=E[exp(tX)]. It may be infinite for some t, but M_X(0)=1 for every real-valued X. The usual moment-generation and uniqueness results apply when M_X is finite throughout an open interval containing zero. Under that condition, its derivatives at zero give the ordinary moments: M'_X(0)=E[X] and M''_X(0)=E[X squared]. [2]

If two mgfs are finite and agree throughout such an interval, the corresponding probability distributions agree. Equality at one or a few input values is insufficient. For a general distribution, do not assume an mgf is finite near zero merely because you can write the expectation symbol.

For an exponential variable with rate lambda>0, integrate lambda exp(-(lambda-t)x) over x>=0. The result is M(t)=lambda/(lambda-t) for t<lambda. The integral diverges for t>=lambda. The restriction belongs beside the formula; substituting t=2lambda into the rational expression does not create a negative mgf.

For independent X and Y, their sum has M_X+Y(t)=M_X(t)M_Y(t) wherever the two factors are finite. For a count variable, G_X(s)=M_X(ln(s)) for s>0 where finite. The functions use different inputs and generate different types of moments at different evaluation points.

Continuous convolution

For independent variables with densities, the sum density is f_X+Y(z)=the integral over all x of f_X(x)f_Y(z-x) dx. The supports determine the actual integration bounds. Multiplying density heights without integrating over all ways to obtain z does not yield the sum density. [1]

Let X and Y be independent exponential variables with the same rate lambda. For a positive sum value z, the admissible x values run from 0 to z. The integrand is lambda squared exp(-lambda z), which is constant with respect to x. Integrating gives f_X+Y(z)=lambda squared z exp(-lambda z) for z>=0, and zero for z<0.

This is a gamma density with shape 2 and rate lambda. Its mean is 2/lambda and variance 2/lambda squared, also obtained by adding the independent moments. Unlike an exponential density, it is zero at the origin and initially rises. The mgf is the square of lambda/(lambda-t), consistent with the convolution calculation.

For lambda=2, the density is 4z exp(-2z). Integrating it from 0 to 1 gives P(X+Y<=1)=1-3exp(-2), about 0.5940. A single rate-2 exponential instead has probability 1-exp(-2), about 0.8647, of finishing by time 1. Two sequential waits require a different model from one wait.

Two independent exponential waits of rate 2 sum to a gamma shape-2 law with density 4z exp(-2z),mean 1 and variance .5. The sum cdf at 1 is .593994,not the one-wait cdf .864665.
Two independent exponential waits of rate 2 sum to a gamma shape-2 law with density 4z exp(-2z),mean 1 and variance .5. The sum cdf at 1 is .593994,not the one-wait cdf .864665.

A random number of contributions

Let N be a nonnegative integer count independent of an iid sequence X1, X2,..., and let S be the sum of the first N values, with S=0 when N=0. If the relevant moments are finite, E[S]=E[N]E[X1] and Var(S)=E[N]Var(X1)+Var(N)(E[X1]) squared. [3]

Condition on N=n to derive these identities: the conditional mean is n times the increment mean, and the conditional variance is n times the increment variance. Iterated expectation and total variance then give the two displayed results. The second variance term represents uncertainty in how many contributions occur.

For a fictional model with Poisson count mean 3 and independent increments having mean 2 and variance 1, the total mean is 6 and total variance is 3 times 1+3 times 4=15. This is not obtained by pretending there are exactly three contributions, which would give variance 3.

Separate an exact identity from an approximation

A binomial(1000,0.002) zero count has exact probability (0.998) to the power 1000, about 0.135065. A Poisson distribution with the same mean 2 gives exp(-2), about 0.135335. The absolute difference for this event is about 0.000271. Matching a rare-event binomial to a Poisson law is an approximation at finite n. [3]

Checking one event does not prove the error is small for every event or every pair of parameters. Record the parameters, the event, the exact or numerical reference, and the approximation separately. Use exact formulas when practical, and use approximation theory with its assumptions when a general error guarantee is required.

Common misconceptions

  • Means determine distributions. The two-device and binomial examples have equal means but different probabilities.
  • All binomial sums are binomial. The familiar sum rule needs independent variables and a common success probability.
  • An mgf formula is valid at every real argument. Check the domain where its expectation is finite.
  • The second pgf derivative is variance. It gives a factorial moment; add and subtract the appropriate mean terms.
  • The sum of exponential waits is exponential. Independent same-rate sums with more than one term have gamma laws.

Recap

Key idea: Convolution accumulates all ways to reach a sum. Generating functions encode the same operation as multiplication under independence. Keep support, parameter conventions, derivative evaluation points and finiteness conditions explicit. Verify a derived law by its total probability, moments and at least one direct event calculation.

Retrieve, explain, and revisit

Close the worked examples before answering: At which point do pgf derivatives give factorial moments and mgf derivatives give ordinary moments?

Check the reasoning

Pgf derivatives approach s=1 from the left; mgf derivatives are evaluated at t=0 under the stated finiteness condition.

Return after a day, then again after about a week: Find the pgf and mean of the sum of independent Poisson counts with means 1.5 and 2.5. Try it from memory first, then compare your reasoning. Revisit earlier material if you cannot explain the assumptions.

Check the later practice

The pgf is exp(4(s-1)), so the sum is Poisson(4) and its mean is 4.

Final probability portfolio

Submit a report with labeled figures, derivations, assumptions, and calculations that another reader can reproduce. The 20-question final checks knowledge;this portfolio checks whether you can build and critique a model. Use the seven rubric rows on the course overview. Score each row from 1 to 4 and multiply by its task weight divided by 4;missing work receives 0. The total is out of 100. Use the rubric to identify which derivations need revision before moving on.

  1. Spaces and counting,10 points. Model three independent fair flips both as ordered sequences and as a head count. Explain the induced weights and calculate P(at least two heads) by both methods.
  2. Conditional reasoning,15 points. Derive the supply-defect posterior from this course. Then make the two suppliers equally common while holding their conditional defect probabilities fixed and recompute. Draw and label the two trees.
  3. Single-variable models,15 points. Analyze a binomial(12,1/6) count and a rate-0.5 exponential wait. State supports and units, and calculate means, variances, and one nontrivial tail for each. Explain which assumptions would need evidence in an application.
  4. Joint analysis,20 points. For density 2 on 0<x<y<1, derive both marginals, E[X|Y], E[X], Cov(X, Y), and both terms in total variance. Check one result using a direct integral.
  5. Transformation,10 points. For X uniform on [-1,1], derive the cdf and density of X squared, including its support. Verify its first two moments by using the original X.
  6. Limits and bounds,15 points. For binomial(1000,0.5), compare the exact probability of counts at most 450 or at least 550 with Chebyshev and a continuity-corrected normal approximation. Record absolute approximation error. Explain why a bound is not an estimated probability.
  7. Sums and verification,15 points. Convolve independent Bernoulli(0.3) and Bernoulli(0.6) laws. Verify with a pgf and moments. Provide calculation inputs, software or hand-work steps, source passages, and a short explanation of why a binomial law with matching mean gives a different answer.
Open the portfolio check values after attempting the tasks

Task 1:head-count masses 1/8,3/8,3/8,1/8, and P(at least two)=1/2. Task 2:original posterior for B=0.625;with equal supplier shares it becomes 0.05/(0.02+0.05)=5/7. Task 3:count mean 2, variance 5/3;wait mean 2 and variance 4. Example tails are P(count at least one)=1-(5/6)^12 and P(wait>3)=exp(-1.5). Task 4:marginals 2(1-x) and 2y;conditional mean y/2;mean 1/3;covariance 1/36;variance terms 1/24 and 1/72. Task 5:cdf sqrt(y) on [0,1], density 1/(2sqrt(y)) on (0,1), first moment 1/3, second moment 1/5. Task 6:exact probability about 0.001730536;Chebyshev upper bound 0.1;use normal boundaries 450.5 and 549.5 with mean 500 and SD sqrt(250). Task 7:masses 0.28,0.54,0.18;mean 0.9;variance 0.45, compared with binomial(2,0.45) variance 0.495. Correct numbers alone do not satisfy the derivation, assumption or reproducibility requirements.

Sources

  1. Grinstead and Snell, Introduction to Probability, 2nd edition, Dartmouth CHANCE text (2006 version). Cited passages: PDF pp. 293-294; PDF pp. 376-377; PDF p. 377; PDF pp. 299-301.
  2. MIT 6.436J (2018), Lecture 13: Moment generating functions. Cited passages: pp. 4-5; generating-function product principle; pp. 2-5.
  3. Bertsekas and Tsitsiklis, Introduction to Probability, 2nd edition (2008), selected summary materials, MIT RES.6-012. Cited passages: p. 36; p. 47.
Key terms
Convolution
A sum or integral over all combinations of values producing a specified total.
Probability generating function
G(s)=E[s to the power X] for a nonnegative integer-valued variable.
Factorial moment
An expectation such as E[X(X-1)], obtained from pgf derivatives at 1 from the left.
Moment generating function
M(t)=E[exp(tX)], with its domain of finiteness specified.
MGF uniqueness
Agreement of finite mgfs on an open interval containing zero implies agreement of distributions.
Gamma distribution
A continuous family parameterized here by shape and rate; integer shapes arise from sums of independent same-rate exponential waits.
Random sum
A sum whose number of contributions is itself a random variable.

Open the interactive version with quizzes and progress →