WDC Learn

Probability & Expected Value

Equally likely outcomes, conditional probability and Bayes' theorem, independence, geometric probability, and expected value via linearity, symmetry, and state methods for repeated games and random walks.

≈4–5 problems per paper9 lessons6 worked examples30 practice problems3 videos

On the AMC 12, probability appears as one of three things: a counting problem wearing probability clothes (equally likely outcomes), a conditional or Bayes question about a hidden cause, or an expected-value question where linearity does most of the work. The early problems, around #5 to #10, are single dice, coins or cards with a complement or a conditional restriction. Problems around #11 to #15 combine several ideas, such as Bayes' theorem, independence across three events, or a geometric area. The hardest problems, #20 to #25, ask for expectations of repeated games, random walks and stopping times, where you must set up a small system of states and solve it.

Escalation is best understood as a change of method rather than a change of arithmetic. A difficulty-1 problem is solved by listing outcomes. A difficulty-3 problem needs a partition of cases and an honest choice of universe. A difficulty-5 problem needs a state description: you decide what information about the past matters for the future, write one equation per state, and then solve. Many strong solvers spend more time choosing the state and the events than doing arithmetic, and that choice is what this topic trains.

To study this topic, practise writing every probability as a ratio inside a named universe, and always say what you condition on. Learn to recognise the symmetry that shortcuts a problem, and check every answer on a tiny case, such as two flips or three steps, before trusting it. Use the verification snippets in this file: each one computes its answer by exhaustive enumeration or exact fractions, so you can test your own reasoning against them.

Helpful first: Counting & Combinatorics, Sequences & Series

1.Equally likely outcomes and complementary counting

Most AMC probability problems are, at heart, counting problems. When every outcome of an experiment is equally likely, the probability of an event EE is P(E)=∣E∣∣S∣P(E)=\frac{|E|}{|S|}, the number of favourable outcomes divided by the total number of outcomes in the sample space SS. Nothing more is needed. The whole difficulty lies in describing SS so that its outcomes really are equally likely.

Why does the formula hold? Suppose each of the N=∣S∣N=|S| outcomes has the same probability pp. The probabilities of all outcomes sum to 11, so Np=1Np=1 and p=1Np=\frac1N. Additivity over disjoint outcomes then gives P(E)=∑ω∈E1N=∣E∣NP(E)=\sum_{\omega\in E}\frac1N=\frac{|E|}{N}. The argument is one line, but it tells you what to check: the outcomes you list must be equally likely, not merely possible.

The most common error is listing outcomes that are not equally likely. The two dice can be listed as the sums 2,3,…,122,3,\dots,12, but these eleven sums are not equally likely (a sum of 77 has six ways to occur and a sum of 22 has one), so dividing by 1111 is wrong. Always list outcomes at the level of the physical experiment: ordered pairs of faces, ordered strings of coin results, or ordered arrangements of distinct objects.

Complementary counting is the second essential tool. For an event described as 'at least one', count the complement 'none occurs' instead, because the complement is usually a single product: P(at least one)=1−P(none)P(\text{at least one})=1-P(\text{none}). For nn fair coins, P(at least one head)=1−(12)nP(\text{at least one head})=1-\left(\tfrac12\right)^n. Check this on n=1n=1: 1−12=121-\frac{1}{2}=\frac{1}{2}, which is correct.

Ordered and unordered counting must agree. You may count sequences or count subsets, but if the numerator counts ordered pairs, the denominator must count ordered pairs too. A helpful check is to compute one probability two ways: when two distinct objects are drawn, the ordered and the unordered counts give the same fraction, because the same factor of 22 appears on top and bottom.

Inclusion–exclusion repairs double counting. For the multiples of 44 or 66 in {1,…,100}\{1,\dots,100\}, count 25+1625+16 and subtract the 88 multiples of 1212 that were counted twice, giving 3333. This is the same idea as P(A∪B)=P(A)+P(B)−P(A∩B)P(A\cup B)=P(A)+P(B)-P(A\cap B), and it is the first formula to reach for whenever two conditions overlap.

On the AMC the counting is often hidden in a clever sample space: rolls of dice, flips of coins, or random permutations. A space of 64=12966^4=1296 rolls is still a finite list. By hand you exploit structure, such as symmetry or a recursion, rather than listing every case; the verification snippets in this topic do the full list by computer as a check.

KEY FACTS
  • P(E)=∣E∣∣S∣P(E)=\frac{|E|}{|S|} when all outcomes are equally likely
  • P(at least one)=1−P(none)P(\text{at least one})=1-P(\text{none})
  • ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A\cup B|=|A|+|B|-|A\cap B|
  • P(at least one head in n fair flips)=1−(12)nP(\text{at least one head in } n \text{ fair flips})=1-\left(\tfrac12\right)^n

Spot it: The problem says 'equally likely', 'random' or 'uniform', and the outcomes can be listed at the level of the experiment. Use the complement when the event is phrased as 'at least one'.

COMMON MISTAKES
  • Treating outcomes that are not equally likely (such as the possible sums of two dice) as if they were.
  • Mixing ordered and unordered counts, so the numerator and denominator count different objects.
TRY IT

A fair coin is flipped five times. What is the probability that at least two flips show heads?

Practise this lesson (5 problems) →

2.Conditional probability

Conditional probability answers the question 'how likely is AA, given that BB has happened?' We write P(A∣B)P(A\mid B). Learning that BB happened changes the universe: outcomes where BB fails are discarded, and we ask what fraction of the surviving outcomes also make AA true. The word 'given' is a signal to shrink the sample space, not to multiply by something.

Formally, P(A∣B)=P(A∩B)P(B)P(A\mid B)=\frac{P(A\cap B)}{P(B)}, defined whenever P(B)>0P(B)>0. Rearranging gives the multiplication rule P(A∩B)=P(B) P(A∣B)P(A\cap B)=P(B)\,P(A\mid B), which is exactly the rule used along the branches of a probability tree. When outcomes are equally likely the formula reads P(A∣B)=∣A∩B∣∣B∣P(A\mid B)=\frac{|A\cap B|}{|B|}: count inside BB only.

Why the formula is right. Restrict attention to BB. Inside BB the outcomes are still equally likely, there are ∣B∣|B| of them, and the ones in AA are exactly the ∣A∩B∣|A\cap B| elements of A∩BA\cap B. Dividing gives the ratio. Nothing beyond the definition of a uniform probability on the smaller universe is assumed.

Consider drawing two cards from a deck without replacement. Given that the first card is an ace, P(second is an ace∣first is an ace)=351P(\text{second is an ace}\mid\text{first is an ace})=\frac{3}{51}, because three aces remain among 5151 cards. The denominator is not 5252: the given information changes both the numerator and the denominator. A student who writes 452\frac{4}{52} has forgotten the conditioning.

Order matters. P(A∣B)P(A\mid B) and P(B∣A)P(B\mid A) are generally different: P(ace∣spade)=113P(\text{ace}\mid\text{spade})=\frac{1}{13} while P(spade∣ace)=14P(\text{spade}\mid\text{ace})=\frac{1}{4}. Confusing the two is the source of the base-rate errors discussed under Bayes' theorem, and the cure is always to ask which event forms the new universe.

Conditioning on a sum of dice is a frequent AMC move. Given that two dice sum to 77, only six outcomes remain, and the question becomes a count inside those six. Writing the restricted list explicitly takes seconds and removes almost every error, because you can see the double counting of (1,6)(1,6) and (6,1)(6,1) directly.

Conditioning can reveal hidden structure. Once we know the first flip is heads, the remaining flips form a fresh uniform universe, with the same rules as before. Recasting 'given' as a new universe is exactly what makes the recursive arguments later in this topic work.

KEY FACTS
  • P(A∣B)=P(A∩B)P(B)P(A\mid B)=\frac{P(A\cap B)}{P(B)} for P(B)>0P(B)>0
  • P(A∩B)=P(B) P(A∣B)P(A\cap B)=P(B)\,P(A\mid B), the multiplication rule along a tree branch
  • With equally likely outcomes, P(A∣B)=∣A∩B∣∣B∣P(A\mid B)=\frac{|A\cap B|}{|B|}, counting inside BB only
  • P(A∣B)≠P(B∣A)P(A\mid B)\neq P(B\mid A) in general

Spot it: The phrases 'given that', 'knowing that' or 'if we condition on' appear, or the problem restricts attention to a smaller set of outcomes.

COMMON MISTAKES
  • Dividing by the size of the original sample space instead of the size of the conditioning event.
  • Confusing P(A∣B)P(A\mid B) with P(B∣A)P(B\mid A).
TRY IT

A card is drawn from a standard 5252-card deck. Given that it is a heart, what is the probability that it is a queen?

Practise this lesson (2 problems) →

3.Total probability and Bayes' theorem

Many problems describe a two-stage experiment: first a hidden cause is chosen (a bag, a coin, a disease status), then something is observed. Such problems ask for the overall probability of the observation, or for the probability of a cause given the observation. The two tools are the law of total probability and Bayes' theorem, and both are consequences of the definition of conditional probability.

Total probability. Suppose B1,…,BkB_1,\dots,B_k partition the sample space: they are pairwise disjoint and together cover everything. Then for any event AA, P(A)=∑iP(Bi) P(A∣Bi)P(A)=\sum_i P(B_i)\,P(A\mid B_i). Proof: AA is the disjoint union of the pieces A∩BiA\cap B_i, so P(A)=∑iP(A∩Bi)P(A)=\sum_i P(A\cap B_i), and each term equals P(Bi) P(A∣Bi)P(B_i)\,P(A\mid B_i) by the multiplication rule.

Bayes' theorem. Using the definition twice, P(Bj∣A)=P(A∩Bj)P(A)P(B_j\mid A)=\frac{P(A\cap B_j)}{P(A)}, and then the total probability formula gives P(Bj∣A)=P(Bj) P(A∣Bj)∑iP(Bi) P(A∣Bi)P(B_j\mid A)=\frac{P(B_j)\,P(A\mid B_j)}{\sum_i P(B_i)\,P(A\mid B_i)}. The prior P(Bj)P(B_j) is updated by the likelihood P(A∣Bj)P(A\mid B_j) to give the posterior. The denominator is only a normalising constant: the numerators already tell you which cause is most likely.

Why the prior matters. A test with 95%95\% sensitivity sounds accurate, but if only 1%1\% of people have the condition, most positive results can be false positives. The posterior P(condition∣+)P(\text{condition}\mid +) depends on the prior 1100\frac{1}{100} as well as the test's two error rates. The naive answer 1920\frac{19}{20} ignores the prior entirely, and that is the base-rate fallacy the AMC likes to test.

The tree method is almost always faster than the formula on a contest. Draw first-stage branches with priors, second-stage branches with likelihoods, and multiply along each path. The total probability of the observation is the sum of the paths that end in it, and the Bayes answer is the path through the cause of interest divided by that sum. There is no formula to memorise and no branch to confuse.

Sanity checks. Posteriors over a partition must sum to 11; if they do not, a numerator was computed with the wrong prior. A plausibility check also catches many slips: the posterior should lie between the prior and 11 when the observation favours that cause, and it should move in the expected direction when a likelihood grows.

KEY FACTS
  • Total probability: P(A)=∑iP(Bi) P(A∣Bi)P(A)=\sum_i P(B_i)\,P(A\mid B_i) for a partition {Bi}\{B_i\}
  • Bayes: P(Bj∣A)=P(Bj) P(A∣Bj)∑iP(Bi) P(A∣Bi)P(B_j\mid A)=\frac{P(B_j)\,P(A\mid B_j)}{\sum_i P(B_i)\,P(A\mid B_i)}
  • Posteriors over a partition always sum to 11

Spot it: A hidden choice is made first, an observation follows, and the question asks about the hidden choice given the observation, or about the overall probability of the observation.

COMMON MISTAKES
  • Stopping at P(A∣Bj)P(A\mid B_j) without dividing by the total probability of AA.
  • Ignoring the prior, for example treating every bag as equally likely when the selection rule says otherwise.
TRY IT

Bag XX contains 11 red and 22 green balls, and bag YY contains 22 red and 11 green. Bag XX is chosen with probability 13\frac{1}{3} and bag YY with probability 23\frac{2}{3}, and then a ball is drawn at random from the chosen bag. Given that the ball is red, what is the probability that it came from bag XX?

Practise this lesson (2 problems) →

4.Independence

Two events are independent when learning that one occurred tells you nothing about the other: P(A∣B)=P(A)P(A\mid B)=P(A). Because P(A∣B)=P(A∩B)P(B)P(A\mid B)=\frac{P(A\cap B)}{P(B)}, this is equivalent, when P(B)>0P(B)>0, to the product rule P(A∩B)=P(A) P(B)P(A\cap B)=P(A)\,P(B). The product form is the one used in calculations; the conditional form explains why it is reasonable.

Independence is a property of the probability model, not of the words used to describe it. Flips of different coins and rolls of different dice are independent because the physical processes do not interact, so the probability of any combination of outcomes factors into a product. Draws without replacement from the same bag are dependent: the first draw changes the composition of what remains.

Independence passes to complements, and this is what makes many AMC calculations short. If AA and BB are independent, then P(A∩Bc)=P(A)−P(A∩B)=P(A)−P(A)P(B)=P(A)(1−P(B))=P(A)P(Bc)P(A\cap B^c)=P(A)-P(A\cap B)=P(A)-P(A)P(B)=P(A)\bigl(1-P(B)\bigr)=P(A)P(B^c), so AA and BcB^c are independent as well. The same reasoning applies to AcA^c and BcB^c.

Mutual independence is stronger than pairwise independence. Several events are mutually independent when the product rule holds for every subfamily, not merely for pairs. Three events can be pairwise independent without being mutually independent. On the AMC the events are almost always given as mutually independent (separate flips, separate players), and then you may multiply over any subfamily.

Do not confuse independence with disjointness. Two events with positive probability that are mutually exclusive satisfy P(A∩B)=0≠P(A)P(B)P(A\cap B)=0\neq P(A)P(B), so they are never independent. Knowing that AA happened tells you that BB did not: that is strong dependence, the opposite of independence.

Independence turns 'at least one' into a complement computation. For independent events EiE_i with probabilities pip_i, P(none occurs)=∏i(1−pi)P(\text{none occurs})=\prod_i(1-p_i), so P(at least one occurs)=1−∏i(1−pi)P(\text{at least one occurs})=1-\prod_i(1-p_i). For 'exactly one' you add the products over the choices of which single event occurs, as the worked examples show.

KEY FACTS
  • AA and BB are independent exactly when P(A∩B)=P(A) P(B)P(A\cap B)=P(A)\,P(B)
  • Independence passes to complements: if A,BA,B are independent, so are AA and BcB^c
  • P(at least one of independent Ei)=1−∏i(1−P(Ei))P(\text{at least one of independent } E_i)=1-\prod_i\bigl(1-P(E_i)\bigr)
  • Mutually exclusive events with positive probability are never independent

Spot it: The problem describes separate trials, separate players or separate dice, or says 'independently'. It is also the right model when the events come from different random processes.

COMMON MISTAKES
  • Assuming independence for draws without replacement, where the first draw changes the second.
  • Multiplying the probabilities of mutually exclusive events, which are in fact strongly dependent.
TRY IT

Events AA and BB are independent with P(A)=12P(A)=\frac{1}{2} and P(B)=13P(B)=\frac{1}{3}. What is the probability that exactly one of AA and BB occurs?

Practise this lesson (2 problems) →

5.Geometric probability

Geometric probability replaces counting by measure. If a point is chosen uniformly at random from a region RR, every subregion of equal area is equally likely to contain it, and for a subregion F⊆RF\subseteq R we have P(point∈F)=area(F)area(R)P(\text{point}\in F)=\frac{\text{area}(F)}{\text{area}(R)}. On a segment the same idea uses length. This is the continuous analogue of ∣E∣∣S∣\frac{|E|}{|S|} from counting, and the ratio is dimensionless.

Why area is the right measure. Cut RR into many tiny cells of equal area. The point is uniform, so each cell has the same probability of containing it, and the probability of landing in FF is the number of cells inside FF divided by the total number of cells. Taking the cells smaller and smaller turns this count into the ratio of areas. Only uniformity matters; a non-uniform density would weight parts of the region differently.

A standard recipe. First draw the region and write its boundary as inequalities. Second, identify the favourable region by its boundary lines. Third, compute its area as a polygon or as the whole region minus corner pieces. Coordinates are usually simpler than geometric reasoning: write ∣x−y∣<1|x-y|<1 as the pair of linear inequalities x−y<1x-y<1 and y−x<1y-x<1, and then the region is a polygon cut out by lines.

Corner triangles are the most common shortcut. In a unit square, the event ∣x−y∣≤c|x-y|\le c with 0≤c≤10\le c\le 1 excludes two right isosceles triangles, each with legs 1−c1-c. Each has area (1−c)22\frac{(1-c)^2}{2}, so the favourable area is 1−(1−c)21-(1-c)^2. For c=12c=\frac{1}{2} this gives 1−14=341-\frac{1}{4}=\frac{3}{4}. The same pattern works in any square of side ss with the band of half-width cc.

Piecewise linear boundaries reduce to polygons. Probabilities involving y<f(x)y<f(x) for a function ff are areas under graphs divided by the area of the region. When ff is piecewise linear, split the domain at its corners; the resulting pieces are trapezoids and triangles, and the area is exact with fractions.

Two independent numbers. If aa and bb are chosen independently and uniformly from [0,1][0,1], the point (a,b)(a,b) is uniform on the unit square. Problems about two such numbers are therefore area problems in a square, and conditions like a<ba<b split the square along a diagonal, which is why answers often come out as 12\frac{1}{2} or 34\frac{3}{4}.

Sanity checks: the probability must lie between 00 and 11, and the favourable region must actually sit inside the sample region. Many wrong answers come from forgetting a corner or from a favourable region that extends outside the square.

KEY FACTS
  • For a uniform point in RR: P(point∈F)=area(F)area(R)P(\text{point}\in F)=\frac{\text{area}(F)}{\text{area}(R)}
  • On a segment the analogous ratio uses lengths
  • In the unit square, ∣x−y∣≤c|x-y|\le c has favourable area 1−(1−c)21-(1-c)^2
  • Two independent uniform numbers on [0,1][0,1] give a uniform point of the unit square

Spot it: A point or number is chosen 'uniformly at random' from a region or an interval, and the event is described by inequalities or distances.

COMMON MISTAKES
  • Subtracting a corner triangle from the whole region but forgetting to remove it from the right place.
  • Dividing a length by an area, or forgetting that the probability is a ratio of like quantities.
TRY IT

A point is chosen uniformly at random from the triangle with vertices (0,0)(0,0), (4,0)(4,0) and (0,4)(0,4). What is the probability that its xx-coordinate exceeds 22?

Practise this lesson (4 problems) →

6.Expected value and linearity of expectation

The expected value of a random quantity XX taking values xx with probabilities P(X=x)P(X=x) is E[X]=∑xx P(X=x)E[X]=\sum_x x\,P(X=x). It is the long-run average of XX over many independent repetitions, and it need not be a possible value: the expected roll of a fair die is 72\frac{7}{2}, which no single roll ever shows.

Linearity. For any two random quantities XX and YY defined on the same sample space, E[X+Y]=E[X]+E[Y]E[X+Y]=E[X]+E[Y], and E[cX]=cE[X]E[cX]=cE[X] for constants cc. Proof: E[X+Y]=∑ω(X(ω)+Y(ω))P(ω)=∑ωX(ω)P(ω)+∑ωY(ω)P(ω)E[X+Y]=\sum_\omega\bigl(X(\omega)+Y(\omega)\bigr)P(\omega)=\sum_\omega X(\omega)P(\omega)+\sum_\omega Y(\omega)P(\omega). The proof uses only the definition of expectation, so no independence is needed.

Why this is powerful. The expected value of a sum is the sum of the expected values even when the summands are heavily dependent. A count of successes can be decomposed into indicator variables, each with an easy probability, and then added. You never need the full distribution of the count, which is usually the hard part.

Indicators. For an event AA, the indicator IAI_A equals 11 if AA occurs and 00 otherwise, and E[IA]=P(A)E[I_A]=P(A). Writing a count as N=∑iIAiN=\sum_i I_{A_i} gives E[N]=∑iP(Ai)E[N]=\sum_i P(A_i). This is the key move for 'expected number of' questions: choose the events so that each probability is simple to compute, even if the events overlap heavily.

Expectations of functions. For any function gg, E[g(X)]=∑xg(x) P(X=x)E[g(X)]=\sum_x g(x)\,P(X=x). For example, the expected larger value of two dice is ∑kk P(max⁡=k)\sum_k k\,P(\max=k) with P(max⁡=k)=2k−136P(\max=k)=\frac{2k-1}{36}, giving 16136\frac{161}{36}. Note that E[max⁡]≠max⁡EE[\max]\neq\max E and, more generally, E[g(X)]≠g(E[X])E[g(X)]\neq g(E[X]) for nonlinear gg, so linearity cannot be applied through a max⁡\max or a product.

Fair games. A game is fair when the expected net gain is 00, and a player is favoured when that expectation is positive. A common trap is averaging over the possible payoffs without weighting them by their probabilities; the weights are essential, and they must come from the actual experiment.

Waiting times. If each trial succeeds independently with probability pp, the number of trials until the first success has expectation 1p\frac1p. This is derived with the state method below: a single state with E=1+(1−p)EE=1+(1-p)E gives E=1pE=\frac1p.

KEY FACTS
  • E[X]=∑xx P(X=x)E[X]=\sum_x x\,P(X=x)
  • E[X+Y]=E[X]+E[Y]E[X+Y]=E[X]+E[Y] always, even when XX and YY are dependent
  • E[IA]=P(A)E[I_A]=P(A) for an indicator IAI_A
  • The expected number of trials until the first success of probability pp is 1p\frac1p

Spot it: The question asks for an average, an expected number or a fair price, and the quantity decomposes into a sum of simpler pieces.

COMMON MISTAKES
  • Assuming E[g(X)]=g(E[X])E[g(X)]=g(E[X]) for a nonlinear gg, such as the maximum of two dice.
  • Forgetting to weight outcomes by their probabilities when averaging.
TRY IT

Two fair six-sided dice are rolled. What is the expected value of the larger of the two numbers?

Practise this lesson (8 problems) →

7.Symmetry arguments

A symmetry argument says that two situations are identical after relabelling, so they have the same probability or the same expected value. It is the cheapest tool in the kit. If you can see that a quantity does not depend on which of several objects you consider, you need not compute anything, and the same observation often replaces pages of casework.

Exchangeability. Random variables are exchangeable when every permutation of them has the same joint distribution. A uniformly random ordering of distinct objects is the standard example: each object is equally likely to occupy each position, so the probability that a particular object lands in position kk is 1n\frac1n for a row of nn objects.

Ranking arguments. Among m+1m+1 specified distinct objects arranged in uniformly random order, each is equally likely to come first, so the probability that a given one precedes all the others is 1m+1\frac{1}{m+1}. Only the relative order of those objects matters, and all (m+1)!(m+1)! relative orders are equally likely. The same reasoning shows that the expected position of the largest of kk random distinct values is determined by symmetry rather than by computation.

Expectations from symmetry. Consider a uniformly random 33-element subset of {1,…,9}\{1,\dots,9\}. The reflection x↦10−xx\mapsto 10-x maps 3-element subsets bijectively to 3-element subsets, so it preserves the uniform distribution. Under this map the middle element mm becomes 10−m10-m. Hence E[m]=E[10−m]=10−E[m]E[m]=E[10-m]=10-E[m], forcing E[m]=5E[m]=5, with no need to list the 8484 subsets.

Symmetry plus linearity is the strongest combination. For a uniformly random permutation of nn distinct numbers, each of the (n2)\binom n2 unordered pairs is equally likely to appear in either order, so P(pair inverted)=12P(\text{pair inverted})=\frac{1}{2}. Linearity then gives E[number of inversions]=(n2)⋅12E[\text{number of inversions}]=\binom n2\cdot\frac{1}{2}.

Adjacency. In a uniformly random line of nn people, the probability that two specified people stand next to each other is 2n\frac{2}{n}. Count the ways: there are n−1n-1 adjacent slot pairs, each with 22 orders, out of n(n−1)n(n-1) ordered placements of the two people, which gives 2(n−1)n(n−1)=2n\frac{2(n-1)}{n(n-1)}=\frac2n.

Warning. Symmetry must be exact. If the process treats the objects differently (a biased coin, a player who moves first, a position with a privilege), the symmetry is broken and the simple answer is wrong. Before invoking symmetry, state explicitly the bijection that exchanges the cases you want to identify.

KEY FACTS
  • In a uniform random permutation of nn distinct objects, P(object a is in position k)=1nP(\text{object }a\text{ is in position }k)=\frac1n
  • Among m+1m+1 specified objects, each is equally likely to come first, so P=1m+1P=\frac{1}{m+1}
  • E[number of inversions]=(n2)⋅12E[\text{number of inversions}]=\binom n2\cdot\frac{1}{2} for a uniform random permutation
  • A bijection that preserves the random law forces equal expectations of the images

Spot it: All objects play identical roles in the random process, or the process is unchanged by a relabelling of its elements.

COMMON MISTAKES
  • Invoking symmetry when the process is biased or positional, such as a first-mover advantage.
  • Counting unordered pairs as ordered pairs when computing inversions or adjacencies.
TRY IT

Three distinct numbers are chosen uniformly at random from {1,2,…,9}\{1,2,\dots,9\} and written in increasing order. What is the expected value of the middle number?

Practise this lesson (4 problems) →

8.States and first-step analysis

Many repeated games stop when something happens: a player reaches a score, a pattern appears, a counter hits a boundary. To analyse them, describe the situation by a state, meaning the smallest piece of information that determines the future. In a pattern game the state is the longest suffix of the results so far that is also a prefix of the target pattern; in a score race it is the current score.

First-step analysis. Let EsE_s be the expected number of further steps from state ss until the game stops. Conditioning on the first move from ss gives the equation Es=1+∑tP(s→t) EtE_s=1+\sum_t P(s\to t)\,E_t, where the sum runs over the states tt reachable in one step and Et=0E_t=0 for absorbing (stopping) states. The 11 is the cost of the move just made, and the rest is the expected future from wherever the move lands. Probabilities of ending in a given absorbing state satisfy the same kind of equation with boundary values 00 or 11.

Why the equations determine the answer. Each undecided state gives one linear equation in the unknowns of its neighbours, so there are as many equations as undecided states. The system has a unique solution because the game ends with probability 11, which makes the matrix I−QI-Q invertible, where QQ records transitions among undecided states. In practice, substitution is usually fastest on the AMC.

Example: waiting for two heads in a row. Let E0E_0 be the expected remaining time with no progress and E1E_1 the expected remaining time after one head. A tail returns to 00 and a head moves to 11 or ends the game, so E0=1+12E0+12E1E_0=1+\frac{1}{2}E_0+\frac{1}{2}E_1 and E1=1+12E0E_1=1+\frac{1}{2}E_0. Substituting the second equation into the first gives 14E0=32\frac{1}{4}E_0=\frac{3}{2}, so E0=6E_0=6 and E1=4E_1=4.

Geometric waiting times are the simplest case: one state that stays put with probability 1−p1-p, giving E=1+(1−p)EE=1+(1-p)E and so E=1pE=\frac1p. Coupon-collector problems use a chain of states, one for each number of distinct items already collected, and the expected time spent in each state is the reciprocal of the success probability there.

Choosing states is the real skill. The state must capture everything that matters for the future and nothing that does not. If the future depends on the last two results, the state needs both; if only the last result matters, one suffices. Merge states that have the same future, which is often exactly what symmetry does, because it keeps the system small.

Checking. Substitute the solution back into every equation, and test plausibility. An expected time must be at least the minimum number of steps needed to finish, and it should grow as the stopping pattern becomes harder to reach.

KEY FACTS
  • First-step equation: Es=1+∑tP(s→t) EtE_s=1+\sum_t P(s\to t)\,E_t, with E=0E=0 at stopping states
  • A geometric wait with success probability pp has expectation 1p\frac1p
  • Each undecided state gives one linear equation, and the system has a unique solution
  • The state must capture everything about the future that matters

Spot it: Repeated trials continue until a stopping rule (a pattern, a score, a boundary) and the future depends only on a small amount of recent information.

COMMON MISTAKES
  • Forgetting the 11 for the step just taken, so the equations omit the cost of the move.
  • Choosing a state that does not determine the future, so the equations look neat but are wrong.
TRY IT

A fair coin is flipped repeatedly until heads has appeared twice, not necessarily in a row. What is the expected number of flips?

Practise this lesson (4 problems) →

9.Random walks and gambler's ruin

A random walk on the integers moves up or down by one at each step according to independent coin flips. It models a gambler who wins or loses one unit per round. Most AMC walk problems ask for the probability of reaching one boundary before another, the expected duration of the game, or the probability of returning to the start, and all three have clean answers.

Gambler's ruin with a fair coin. Let xkx_k be the probability of reaching NN before 00 starting from kk, with 0≤k≤N0\le k\le N. First-step analysis gives xk=12xk−1+12xk+1x_k=\frac{1}{2}x_{k-1}+\frac{1}{2}x_{k+1} for 0<k<N0<k<N, with boundary values x0=0x_0=0 and xN=1x_N=1. The sequence has equal increments, so it is linear: xk=kNx_k=\frac kN. The probability of winning from kk is simply kN\frac kN.

Expected duration with a fair coin. Let DkD_k be the expected number of steps until absorption from kk. First-step analysis gives Dk=1+12Dk−1+12Dk+1D_k=1+\frac{1}{2}D_{k-1}+\frac{1}{2}D_{k+1} with D0=DN=0D_0=D_N=0. The solution is Dk=k(N−k)D_k=k(N-k). To check, expand 12[(k−1)(N−k+1)+(k+1)(N−k−1)]=k(N−k)−1\frac{1}{2}\bigl[(k-1)(N-k+1)+(k+1)(N-k-1)\bigr]=k(N-k)-1, so the right side of the recursion matches k(N−k)k(N-k).

Biased walk. With up-probability p≠12p\neq\frac{1}{2} and q=1−pq=1-p, set r=qpr=\frac qp. The recursion pxk+1+qxk−1=xkpx_{k+1}+qx_{k-1}=x_k has characteristic roots 11 and rr, so the probability of hitting NN before 00 from kk is 1−rk1−rN\frac{1-r^k}{1-r^N}. For p=12p=\frac{1}{2} this formula is indeterminate, and the linear answer kN\frac kN takes over as its limit.

Harmonic functions. The fair equation xk=12(xk−1+xk+1)x_k=\frac{1}{2}(x_{k-1}+x_{k+1}) says that the value at each point is the average of its neighbours. Such functions are called harmonic, and bounded harmonic functions on a segment are linear. This viewpoint explains why the answer is linear in kk, and it is the reason the optional-stopping argument gives the same result quickly.

Returning to the origin. For the simple symmetric walk, P(S2n=0)=(2nn)/4nP(S_{2n}=0)=\binom{2n}{n}/4^n. A classical companion identity says that the walk avoids 00 at all the times 1,2,…,2n1,2,\dots,2n with the same probability, namely (2nn)/4n\binom{2n}{n}/4^n. For n=1n=1 both sides equal 12\frac{1}{2}, which is a quick sanity check.

Practice. For each walk problem, identify the boundary values, write the first-step equation, solve the recurrence, and check that the boundary conditions hold. For a long game, verify the formula on a small case: with N=2N=2 and k=1k=1, the walk ends after exactly one step, and k(N−k)=1k(N-k)=1 agrees.

KEY FACTS
  • Fair gambler's ruin: P(reach N before 0 from k)=kNP(\text{reach }N\text{ before }0\text{ from }k)=\frac kN
  • Fair expected duration on {0,…,N}\{0,\dots,N\} from kk is k(N−k)k(N-k)
  • Biased walk with r=qp≠1r=\frac qp\neq1: P=1−rk1−rNP=\frac{1-r^k}{1-r^N}
  • For the simple symmetric walk, P(S1,…,S2n≠0)=(2nn)4nP(S_1,\dots,S_{2n}\neq0)=\frac{\binom{2n}{n}}{4^n}

Spot it: A quantity changes by a fixed step at each trial, the game stops at boundaries, and the question asks about a boundary, a duration or a return to the start.

COMMON MISTAKES
  • Using the fair formula kN\frac kN for a biased walk, which needs the ratio rr.
  • Forgetting the boundary values x0=0x_0=0 and xN=1x_N=1, which are needed to pin down the solution of the recurrence.
TRY IT

A fair walk starts at 22 and stops when it reaches 00 or 55, moving up or down by 11 with equal probability. What is the probability that it stops at 55?

Practise this lesson (3 problems) →

Build the conditional sample space before dividing.

Conditioning discards outcomes that do not satisfy the information given. It can destroy independence even when the original experiment used independent trials. List the remaining equally likely outcomes when possible; otherwise use P(A∣B)=P(A∩B)/P(B)P(A\mid B)=P(A\cap B)/P(B).

A count of favourable outcomes over total outcomes is valid only when those outcomes are equally likely. For sampling without replacement, either use ordered draws with changing denominators or use unordered subsets consistently. Mixing the two creates missing factors.

Before you commit to a method

  • State the conditioning event in words and symbols.
  • Check that the denominator is the probability of the information actually given.
  • For expectations of counts, indicator variables avoid unnecessary independence assumptions.

Two problems to work through

Try the question on paper before opening its solution. For each step, explain why it follows from the previous one.

Conditioning on a dice sum

Two fair dice are rolled. Given that their sum is at least 1010, what is the probability of a double?

Show the full reasoning
  1. Treat outcomes as ordered pairs. Sum ten gives (4,6),(5,5),(6,4)(4,6),(5,5),(6,4).
  2. Sum eleven gives (5,6),(6,5)(5,6),(6,5); sum twelve gives (6,6)(6,6).
  3. These six ordered outcomes are equally likely after conditioning.
  4. Two are doubles, so the conditional probability is 2/6=1/32/6=1/3.

Answer: 1/31/3

Check or vary it: Before conditioning the probability of a double is 1/61/6. Keeping that original denominator would ignore the information about the sum.

At least one is not exactly one

A bag has three red and two blue balls. Two are drawn in order without replacement. Given that at least one is red, what is the probability that the first is red?

Show the full reasoning
  1. Let AA be first-red and BB be at-least-one-red. Every outcome in AA is already in BB.
  2. The complement of BB is two blue balls, with probability (2/5)(1/4)=1/10(2/5)(1/4)=1/10. Thus P(B)=9/10P(B)=9/10.
  3. P(A∩B)=P(A)=3/5P(A\cap B)=P(A)=3/5.
  4. Therefore P(A∣B)=(3/5)/(9/10)=2/3P(A\mid B)=(3/5)/(9/10)=2/3.

Answer: 2/32/3

Check or vary it: If the information were exactly one red, symmetry between the two positions would give 1/21/2. Those are different conditioning events.

Make the method stick

Close the solutions and rewrite both arguments from memory. In the topic practice below, begin with an untimed warm-up, then work through the medium problems. If you miss one, write down the first step you could not justify before checking the solution. Retry it on another day without your notes.

Complement first

For 'at least one' or 'not all' events, count the single bad configuration and subtract from 11. Most independent-trial problems collapse to a short product this way, and the complement is usually the one case you can list.

Shrink the universe explicitly

When a condition is given, write out the outcomes that satisfy it and count inside that list. Writing the six pairs of two dice that sum to 77 takes seconds, and it removes the double counting that formulas hide.

Partition by the hidden cause

For problems with a hidden first stage (which bag, which coin, which player moves first), split into cases that partition the sample space, use total probability for the overall answer, and use Bayes only when the question asks about the cause.

Use linearity, not distributions

For an expected count, write the quantity as a sum of indicators and add their probabilities. Never derive the full distribution of a count when only its mean is needed, and never pass an expectation through a max⁡\max or a product.

Look for symmetry before computing

Ask whether two cases differ by a relabelling that preserves the random process. Symmetry replaces long casework with one observation, such as the middle element of a random subset having expectation equal to the centre of the set.

One equation per state

For repeated games, first list the states that capture the future, then write one first-step equation per state, then solve the small linear system. Check the answer against a one-step or two-step case before trusting it.

Try each one first. “How do I start?” gives the way in; then reveal the solution one step at a time.

Example 1: Two socks from a drawer

Warm-up · #1–5

A drawer holds 44 black socks and 22 white socks. Two socks are taken out at random, one after the other, without replacement. What is the probability that both socks are black?

  1. (A)15\frac{1}{5}
  2. (B)415\frac{4}{15}
  3. (C)25\frac{2}{5}
  4. (D)12\frac{1}{2}
  5. (E)35\frac{3}{5}
How do I start?

This is an equally likely problem. Each pair of socks that could be drawn is equally likely, so count pairs rather than tracking the order.

Example 2: Even product, then a sum

Easy · #6–10

Two fair six-sided dice are rolled. Given that the product of the two numbers is even, what is the probability that their sum is 77?

  1. (A)16\frac{1}{6}
  2. (B)29\frac{2}{9}
  3. (C)14\frac{1}{4}
  4. (D)13\frac{1}{3}
  5. (E)512\frac{5}{12}
How do I start?

Condition on the event that the product is even, and count inside it. The complement (both dice odd) gives the size of that event quickly.

Example 3: Which coin was it?

Medium · #11–15

A box contains two coins. Coin PP is fair. Coin QQ has heads on both faces. One coin is chosen uniformly at random from the box and flipped twice, and both flips show heads. What is the probability that the chosen coin is QQ?

  1. (A)14\frac{1}{4}
  2. (B)13\frac{1}{3}
  3. (C)12\frac{1}{2}
  4. (D)23\frac{2}{3}
  5. (E)45\frac{4}{5}
How do I start?

This is Bayes with two hypotheses. Compare the likelihood of the observed two heads under each coin, weighted by the equal priors.

Example 4: Two sixes in a row

Hard · #16–20

A fair six-sided die is rolled repeatedly. What is the expected number of rolls until a 66 appears on two consecutive rolls for the first time?

  1. (A)3636
  2. (B)3838
  3. (C)4040
  4. (D)4242
  5. (E)4848
How do I start?

Track one bit of state: whether the last roll was a 66. Write one first-step equation for each of the two states.

Example 5: Descents in a random permutation

Hard · #16–20

A permutation σ\sigma of 1,2,3,4,5,61,2,3,4,5,6 is chosen uniformly at random from all 6!6! orderings. A descent is a position ii with 1≤i≤51\le i\le5 and σ(i)>σ(i+1)\sigma(i)>\sigma(i+1). What is the expected number of descents?

  1. (A)52\frac{5}{2}
  2. (B)114\frac{11}{4}
  3. (C)33
  4. (D)134\frac{13}{4}
  5. (E)72\frac{7}{2}
How do I start?

Write the count as a sum of five indicators, one for each adjacent pair of positions, and use symmetry to find the probability of each.

Example 6: Four doors, one host

Final five · #21–25

A prize is hidden uniformly at random behind one of four closed doors. You pick one door. The host then opens one of the other doors that does not hide the prize, chosen uniformly at random among those available. You may keep your door or switch to one of the two remaining closed doors, chosen uniformly at random. What is the probability that switching wins?

  1. (A)14\frac{1}{4}
  2. (B)38\frac{3}{8}
  3. (C)12\frac{1}{2}
  4. (D)23\frac{2}{3}
  5. (E)34\frac{3}{4}
How do I start?

Split the cases by whether your first pick hid the prize. That partition makes both the host's choice and your switch easy to track.

Bayes theorem, the geometry of changing beliefs
3Blue1Brown
Builds Bayes' theorem from a human-judgment example and explains the prior, likelihood and posterior, so watch it before attempting the Bayes problems.
The quick proof of Bayes' theorem
3Blue1Brown
A four-minute proof showing that the Bayes formula is just the definition of conditional probability applied twice; watch it after the intuition video.
L05.11 Linearity of Expectations
MIT OpenCourseWare
A short MIT lecture on linearity of expectation, the single most useful property for expected-value problems; watch it before the indicator-variable problems.

30 problems, easy to hard

6 × Warm-up · #1–56 × Easy · #6–108 × Medium · #11–156 × Hard · #16–204 × Final five · #21–25
30 problems
All 30 problemsWarm-up (#1–10)Medium (#11–15)Hard (#16–25)

Next topic: Plane Geometry →