Session 2: Bayes' Rule and Sequential Updating

Movement I: Belief and Conditioning

EE 520: Random Processes (Fall 2026). Instructor: John Lipor.

Session 1 ended with a promise. We had turned a prior of 0.700.70 on a cell into a posterior of 0.5380.538 after one failed look, using nothing but the definition ℙ(A|B)=ℙ(A∩B)/ℙ(B)\mathbb{P}(A \,|\,B) = \mathbb{P}(A \cap B)/\mathbb{P}(B), and we called the move restriction and renormalization. Today we give that move its name, Bayes’ rule, and a formula that updates a belief over any number of cells, for any sensor, in one line. The session thesis: Bayes’ rule is the unique consistent way to move belief when evidence arrives, and applied repeatedly it is a learning algorithm.

Launch

Reopen the state of the Session 1 search game. Suppose the class looked in cell 11 twice and came up empty both times. Watch what happened to the votes: on the first ballot the room still favored cell 11 (it had the largest prior), but after the second failure the votes drifted toward cell 22. Nobody in the room was doing arithmetic; they were running an approximation to a law. Our job today is to write that law down exactly, prove it, and then push it further than intuition can follow: what does belief do after ten failed looks, or a hundred? By the end of the hour you will be able to answer, on paper, questions the voting could only gesture at.

Everything rests on two results that upgrade last session’s definition into a machine: the law of total probability, which assembles the probability of an observation from its possible causes, and Bayes’ rule, which runs that assembly backward to update belief about the cause.

Development

The law of total probability

Start with a warm-up that already contains the whole idea. Suppose we know ℙ(A)\mathbb{P}(A), ℙ(B)\mathbb{P}(B), and ℙ(A∪B)\mathbb{P}(A \cup B), and we want ℙ(A∩B𝖼)\mathbb{P}(A \cap B^{\mathsf{c}}), the probability that AA happens but BB does not. Cut A∪BA \cup B into the part inside BB and the part outside it: A∪B=B∪(A∩B𝖼),B∩(A∩B𝖼)=∅.\begin{equation} A \cup B = B \cup (A \cap B^{\mathsf{c}}), \qquad B \cap (A \cap B^{\mathsf{c}}) = \emptyset. \end{equation} The pieces are disjoint, so additivity gives ℙ(A∪B)=ℙ(B)+ℙ(A∩B𝖼)\mathbb{P}(A \cup B) = \mathbb{P}(B) + \mathbb{P}(A \cap B^{\mathsf{c}}), and therefore ℙ(A∩B𝖼)=ℙ(A∪B)−ℙ(B)\mathbb{P}(A \cap B^{\mathsf{c}}) = \mathbb{P}(A \cup B) - \mathbb{P}(B). (The value ℙ(A)\mathbb{P}(A) turned out not to be needed, and the event B∪(A∩B𝖼)B \cup (A \cap B^{\mathsf{c}}), which looks new, is just A∪BA \cup B again.) Cut an event into disjoint pieces, then add is the entire content of the first theorem below; all we lack is vocabulary for a cut into many pieces at once.

That vocabulary is “a complete list of mutually exclusive possibilities.”

Definition 1 (Partition). A collection of events {B1,…,Bn}\left\{B_1, \dots, B_n\right\} is a partition of Ω\Omega if the BiB_i are pairwise disjoint (Bi∩Bj=∅B_i \cap B_j = \emptyset for i≠ji \neq j) and together they exhaust the sample space (⋃i=1nBi=Ω\bigcup_{i=1}^n B_i = \Omega).

In the search problem the events Bi={the wreck is in cell i}B_i = \left\{\text{the wreck is in cell } i\right\} form a partition: the wreck is in exactly one cell.

Theorem 1 (Law of total probability). Let {B1,…,Bn}\left\{B_1, \dots, B_n\right\} be a partition of Ω\Omega with ℙ(Bi)>0\mathbb{P}(B_i) > 0 for every ii. Then for any event AA, ℙ(A)=∑i=1nℙ(A|Bi)ℙ(Bi).\begin{equation} \mathbb{P}(A) = \sum_{i=1}^{n} \mathbb{P}(A \,|\,B_i)\,\mathbb{P}(B_i). \end{equation}

Proof. Because the BiB_i partition Ω\Omega, the sets A∩BiA \cap B_i are pairwise disjoint and their union is A=A∩Ω=A∩⋃iBi=⋃i(A∩Bi)A = A \cap \Omega = A \cap \bigcup_i B_i = \bigcup_i (A \cap B_i). Finite additivity gives ℙ(A)=∑i=1nℙ(A∩Bi)\mathbb{P}(A) = \sum_{i=1}^n \mathbb{P}(A \cap B_i), and the chain rule rewrites each term as ℙ(A∩Bi)=ℙ(A|Bi)ℙ(Bi)\mathbb{P}(A \cap B_i) = \mathbb{P}(A \,|\,B_i)\,\mathbb{P}(B_i). ◻

Key idea. The law of total probability is a bookkeeping identity: to find how likely an observation AA is overall, average its conditional probability ℙ(A|Bi)\mathbb{P}(A \,|\,B_i) over every possible state of the world, weighting each by how likely that state is. It is how we compute the denominator in what follows.

Bayes’ rule

Total probability runs “causes →\to observation.” We want the reverse: an observation has arrived, and we want to revise belief about its cause.

Theorem 2 (Bayes’ rule). Let {B1,…,Bn}\left\{B_1, \dots, B_n\right\} be a partition of Ω\Omega with each ℙ(Bi)>0\mathbb{P}(B_i) > 0, and let AA be an event with ℙ(A)>0\mathbb{P}(A) > 0. Then for each ii, ℙ(Bi|A)=ℙ(A|Bi)ℙ(Bi)ℙ(A)=ℙ(A|Bi)ℙ(Bi)∑j=1nℙ(A|Bj)ℙ(Bj).\begin{equation} \label{eq:bayes} \mathbb{P}(B_i \,|\,A) = \frac{\mathbb{P}(A \,|\,B_i)\,\mathbb{P}(B_i)}{\mathbb{P}(A)} = \frac{\mathbb{P}(A \,|\,B_i)\,\mathbb{P}(B_i)}{\sum_{j=1}^{n} \mathbb{P}(A \,|\,B_j)\,\mathbb{P}(B_j)}. \end{equation}

Proof. The chain rule gives ℙ(A∩Bi)\mathbb{P}(A \cap B_i) two ways: ℙ(Bi|A)ℙ(A)=ℙ(A|Bi)ℙ(Bi)\mathbb{P}(B_i \,|\,A)\,\mathbb{P}(A) = \mathbb{P}(A \,|\,B_i)\,\mathbb{P}(B_i). Divide by ℙ(A)>0\mathbb{P}(A) > 0 for the first equality; the second substitutes the law of total probability (Theorem 1) for ℙ(A)\mathbb{P}(A). ◻

The four pieces of [eq:bayes] carry names we will use for the rest of the course. Read BiB_i as a hypothesis about the world and AA as the data: ℙ(Bi|A)⏟posterior=ℙ(A|Bi)⏞likelihood⋅ℙ(Bi)⏞priorℙ(A)⏟evidence.\begin{equation} \underbrace{\mathbb{P}(B_i \,|\,A)}_{\text{posterior}} = \frac{\overbrace{\mathbb{P}(A \,|\,B_i)}^{\text{likelihood}} \cdot \overbrace{\mathbb{P}(B_i)}^{\text{prior}}}{\underbrace{\mathbb{P}(A)}_{\text{evidence}}}. \end{equation} The prior ℙ(Bi)\mathbb{P}(B_i) is what we believed before the data; the likelihood ℙ(A|Bi)\mathbb{P}(A \,|\,B_i) is how well hypothesis ii predicts the data we saw; the evidence ℙ(A)\mathbb{P}(A) is the total-probability normalizer; and the posterior ℙ(Bi|A)\mathbb{P}(B_i \,|\,A) is the updated belief. In three words: posterior ∝\propto prior ×\times likelihood, with the evidence fixing the constant so the posterior sums to one.

Pitfall. The likelihood ℙ(A|Bi)\mathbb{P}(A \,|\,B_i) is a function of the hypothesis ii with the data AA held fixed. It is not a probability distribution over the hypotheses: the numbers ℙ(A|B1),…,ℙ(A|Bn)\mathbb{P}(A \,|\,B_1), \dots, \mathbb{P}(A \,|\,B_n) need not sum to 11, and there is no reason they should. (In the search game each is a single sensor probability like α\alpha or 11.) Only after multiplying by the prior and dividing by the evidence do we get something that sums to one across ii.

The failed-search update

We now specialize Bayes’ rule to the search problem and get a formula worth memorizing. Let the target lie in one of nn cells with prior (p1,…,pn)(p_1, \dots, p_n). We search cell ii. As in Session 1, a search of the cell that holds the target fails with the overlook probability α\alpha, while a search of a cell that does not hold the target always fails. Write q=1−αq = 1 - \alpha for the per-look detection probability, and let FiF_i be the event “the search of cell ii fails.”

Proposition 1 (Failed-search update). With the setup above, ℙ(cell i|Fi)=αpi1−qpi,ℙ(cell j|Fi)=pj1−qpi(j≠i).\begin{equation} \label{eq:failed} \mathbb{P}(\text{cell } i \,|\,F_i) = \frac{\alpha\, p_i}{1 - q\,p_i}, \qquad \mathbb{P}(\text{cell } j \,|\,F_i) = \frac{p_j}{1 - q\,p_i} \quad (j \neq i). \end{equation}

Proof. The cells partition the possibilities, so Bayes’ rule applies with likelihoods ℙ(Fi|cell i)=α\mathbb{P}(F_i \,|\,\text{cell } i) = \alpha (the target is there but the look overlooks it) and ℙ(Fi|cell j)=1\mathbb{P}(F_i \,|\,\text{cell } j) = 1 for j≠ij \neq i (the look cannot find a target that is elsewhere). The evidence is, by the law of total probability, ℙ(Fi)=αpi+∑j≠ipj=αpi+(1−pi)=1−(1−α)pi=1−qpi.\begin{equation} \mathbb{P}(F_i) = \alpha\, p_i + \sum_{j \neq i} p_j = \alpha\, p_i + (1 - p_i) = 1 - (1-\alpha)\,p_i = 1 - q\,p_i. \end{equation} Dividing each likelihood-times-prior by this evidence gives [eq:failed]. ◻

Corollary 1 (Probability flows out of the searched cell). If α<1\alpha < 1 and pi<1p_i < 1, then the searched cell’s probability strictly decreases, ℙ(cell i|Fi)pi=α1−qpi<1,\begin{equation} \frac{\mathbb{P}(\text{cell } i \,|\,F_i)}{p_i} = \frac{\alpha}{1 - q\,p_i} < 1, \end{equation} while every other cell’s probability increases by the same factor 1/(1−qpi)>11/(1 - q\,p_i) > 1. Belief leaves the cell we searched and is redistributed among the rest in proportion to their current probabilities.

Proof. The ratio for cell ii is below 11 exactly when α<1−qpi\alpha < 1 - q\,p_i, i.e. q(1−pi)>0q(1 - p_i) > 0, which holds since q=1−α>0q = 1 - \alpha > 0 and pi<1p_i < 1. For j≠ij \neq i the ratio ℙ(cell j|Fi)/pj=1/(1−qpi)\mathbb{P}(\text{cell } j \,|\,F_i)/p_j = 1/(1 - q\,p_i) exceeds 11 because qpi>0q\,p_i > 0, and it does not depend on jj. ◻

The failed-search update of Proposition 1 with prior (0.4,0.3,0.2,0.1)(0.4,0.3,0.2,0.1) and α=0.5\alpha = 0.5: one empty look in region 11 moves mass out of region 11 and into the others by the common factor 1/(1−qp1)=1.251/(1-q\,p_1) = 1.25.

Read the numbers off Figure 1. With prior (0.4,0.3,0.2,0.1)(0.4, 0.3, 0.2, 0.1) and α=0.5\alpha = 0.5, the evidence is 1−qp1=1−(0.5)(0.4)=0.81 - q\,p_1 = 1 - (0.5)(0.4) = 0.8, and Proposition 1 gives the posterior (0.25,0.375,0.25,0.125)(0.25,\, 0.375,\, 0.25,\, 0.125). Region 22 has already overtaken region 11: a single empty look was enough to unseat the favorite. This exact update has guided real searches. When the submarine USS Scorpion was lost in 1968, John Craven’s team placed a prior over the seafloor and updated it as sonar sweeps came back empty, recovering the wreck near the posterior’s peak; the 2011 search for Air France 447’s flight recorders used the same bookkeeping after earlier sweeps had failed. In both, a failed look was treated not as wasted effort but as data.

Pitfall. After writing down likelihood times prior, you must divide by the evidence. Skipping the division leaves you with the unnormalized numbers αpi\alpha\, p_i and pjp_j, which do not sum to one and are not probabilities. The evidence 1−qpi1 - q\,p_i is exactly the sum of those numerators; dividing by it is the renormalization step from Session 1.

Repeated failed searches

What if we search the same cell again and again and keep failing? Model the looks as conditionally independent given the target’s location: if the target is in cell ii, each look fails independently with probability α\alpha, so mm looks all fail with probability αm\alpha^m; if the target is elsewhere, all mm looks fail with probability 11. (This conditional-independence assumption is the quiet workhorse of the whole course; Session 3 examines it directly.)

Proposition 2 (Vanishing belief under repeated failure). After mm failed searches of cell ii, starting from prior pip_i, ℙ(cell i|m failures)=piαmpiαm+(1−pi).\begin{equation} \label{eq:repeat} \mathbb{P}(\text{cell } i \,|\,m \text{ failures}) = \frac{p_i\,\alpha^m}{p_i\,\alpha^m + (1 - p_i)}. \end{equation} For any α<1\alpha < 1 this tends to 00 as m→∞m \to \infty.

Proof. Group the world into the two hypotheses “cell ii” (prior pip_i) and “not cell ii” (prior 1−pi1 - p_i). The likelihood of mm failures is αm\alpha^m under the first and 11 under the second, so Bayes’ rule gives [eq:repeat]. As m→∞m \to \infty, αm→0\alpha^m \to 0, so the numerator →0\to 0 while the denominator →1−pi>0\to 1 - p_i > 0; hence the ratio →0\to 0. ◻

One reading, worth stating aloud: unless the sensor is perfect (α=0\alpha = 0) the belief drops fast, and unless the target is certainly in cell ii to begin with, persisting in searching a cell that keeps coming up empty is eventually irrational. The only way repeated failure fails to erode belief is α=1\alpha = 1, a sensor that never detects anything and therefore whose failures carry no information.

The odds form

For two hypotheses, Bayes’ rule has an especially clean shape. Define the prior odds of hypothesis BB against its complement as ℙ(B)/ℙ(B𝖼)\mathbb{P}(B)/\mathbb{P}(B^{\mathsf{c}}), and likewise the posterior odds ℙ(B|A)/ℙ(B𝖼|A)\mathbb{P}(B \,|\,A)/\mathbb{P}(B^{\mathsf{c}} \,|\,A). Dividing the two instances of Bayes’ rule [eq:bayes] (for BB and for B𝖼B^{\mathsf{c}}) cancels the shared evidence ℙ(A)\mathbb{P}(A): ℙ(B|A)ℙ(B𝖼|A)⏟posterior odds=ℙ(B)ℙ(B𝖼)⏟prior odds⋅ℙ(A|B)ℙ(A|B𝖼)⏟likelihood ratio L(A).\begin{equation} \label{eq:odds} \underbrace{\frac{\mathbb{P}(B \,|\,A)}{\mathbb{P}(B^{\mathsf{c}} \,|\,A)}}_{\text{posterior odds}} = \underbrace{\frac{\mathbb{P}(B)}{\mathbb{P}(B^{\mathsf{c}})}}_{\text{prior odds}} \cdot \underbrace{\frac{\mathbb{P}(A \,|\,B)}{\mathbb{P}(A \,|\,B^{\mathsf{c}})}}_{\text{likelihood ratio } L(A)}. \end{equation} The update is now a single multiplication: posterior odds == prior odds ×\times likelihood ratio. No normalizer appears, because odds are ratios and the evidence cancels.

The likelihood ratio is the evidence’s whole content. Equation [eq:odds] says an observation influences belief only through its likelihood ratio L(A)=ℙ(A|B)/ℙ(A|B𝖼)L(A) = \mathbb{P}(A \,|\,B)/\mathbb{P}(A \,|\,B^{\mathsf{c}}). Two different observations with the same likelihood ratio move belief identically. This one number is the entire evidentiary payload of the data; it returns in Session 10 as the detection statistic that decides target-or-no-target.

One illustration shows why the odds form earns its place. A cognitive-radio node must decide whether a licensed channel is occupied; occupancy is rare, ℙ(occupied)=0.02\mathbb{P}(\text{occupied}) = 0.02. Its detector has probability of detection PD=ℙ(flag|occupied)=0.95\mathrm{PD} = \mathbb{P}(\text{flag} \,|\,\text{occupied}) = 0.95 and probability of false alarm PFA=ℙ(flag|free)=0.05\mathrm{PFA} = \mathbb{P}(\text{flag} \,|\,\text{free}) = 0.05, and it raises a flag. The prior odds are 0.02/0.98=1:490.02/0.98 = 1{:}49, the likelihood ratio of a flag is L(flag)=0.95/0.05=19L(\text{flag}) = 0.95/0.05 = 19, so by [eq:odds] the posterior odds are 19:4919{:}49 and ℙ(occupied|flag)=1919+49=1968≈0.28.\begin{equation} \mathbb{P}(\text{occupied} \,|\,\text{flag}) = \frac{19}{19 + 49} = \frac{19}{68} \approx 0.28. \end{equation}

Pitfall. A detector that is right 95%95\% of the time fires, yet the channel is probably still free. That feels wrong until the odds form makes it obvious: the flag multiplied the odds by 1919, but it started 4949 times more likely to be free than occupied, and 1919 cannot overcome 4949 in a single step. Ignoring the small prior and reading PD=0.95\mathrm{PD} = 0.95 as “95%95\% sure” is base-rate neglect, the most common error in applied inference. The likelihood ratio is strong; the prior is stronger.

Worked examples

Three cards in a hat

A hat holds three cards: one red on both sides (RR), one black on both sides (BB), and one red on one side and black on the other (RB). You draw a card at random and look at one side, each side equally likely to face you. It is red. What is the probability that you hold RR, i.e. that the other side is red too?

The tempting answer is 1/21/2: the red face rules out BB, which leaves RR and RB, “so it is a coin flip.” Set the problem up as Bayes’ rule instead.

By the law of total probability the evidence is ℙ(R)=1⋅13+0⋅13+12⋅13=12,\begin{equation} \mathbb{P}(R) = 1 \cdot \tfrac13 + 0 \cdot \tfrac13 + \tfrac12 \cdot \tfrac13 = \tfrac12, \end{equation} and Bayes’ rule gives ℙ(RR|R)=1⋅1312=23,ℙ(BB|R)=0,ℙ(RB|R)=12⋅1312=13.\begin{equation} \mathbb{P}(\text{RR} \,|\,R) = \frac{1 \cdot \frac13}{\frac12} = \frac23, \qquad \mathbb{P}(\text{BB} \,|\,R) = 0, \qquad \mathbb{P}(\text{RB} \,|\,R) = \frac{\frac12 \cdot \frac13}{\frac12} = \frac13. \end{equation} The answer is 2/32/3, not 1/21/2. A counting check confirms it: there are three red faces, each equally likely to be the one facing you, and two of them belong to RR.

Pitfall. The tempting argument did half of Bayes’ rule. It discarded the hypothesis with likelihood 00 and then split the prior evenly over the survivors, as if every hypothesis consistent with the data predicted it equally well. But RR shows red with certainty and RB only half the time; Bayes’ rule weights each survivor by its likelihood, and that weighting is the whole difference between 1/21/2 and 2/32/3. Notice also that the likelihoods 1,0,1/21, 0, 1/2 sum to 3/23/2: as the earlier pitfall warned, likelihoods are not a distribution over hypotheses.

Consolidation

Work these in class.

  1. (Mechanical.) Prior (0.5,0.3,0.2)(0.5, 0.3, 0.2) over three cells, overlook probability α=0.4\alpha = 0.4 (so q=0.6q = 0.6). Search cell 11 and fail. Compute the full posterior.
    Answer: evidence 1−qp1=1−(0.6)(0.5)=0.71 - q\,p_1 = 1 - (0.6)(0.5) = 0.7;
    posterior (0.4⋅0.50.7,0.30.7,0.20.7)=(0.286,0.429,0.286)\big(\tfrac{0.4\cdot 0.5}{0.7}, \tfrac{0.3}{0.7}, \tfrac{0.2}{0.7}\big) = (0.286,\, 0.429,\, 0.286).

  2. (Sequential evidence in odds form.) A box holds two fair coins and one two-headed coin. You pick a coin at random and toss it repeatedly; the tosses are independent given which coin you hold. (i) After nn heads in a row, what are the posterior odds that you hold the two-headed coin? Evaluate the posterior probability after three heads. (ii) What does a single tail do?
    Answer: (i) prior odds 1:21{:}2; each head has likelihood ratio 1/(1/2)=21/(1/2) = 2, so after nn heads the odds are 12⋅2n=2n−1\tfrac12 \cdot 2^n = 2^{n-1}, i.e. 4:14{:}1 and probability 4/54/5 after three heads. (ii) A tail has likelihood 00 under the two-headed coin, so its posterior drops to exactly 00 and no later heads can restore it. Contrast Proposition 2: with α>0\alpha > 0 each failed look only erodes belief, and it never reaches 00 after finitely many looks.

  3. (Conceptual.) In Proposition 2, what happens to the posterior of cell ii under repeated failure if α=1\alpha = 1? Explain in one sentence why this is the only exception to “belief erodes.”
    Answer: it stays at pip_i forever, because an α=1\alpha = 1 sensor fails with probability 11 whether or not the target is present, so its failures have likelihood ratio 11 and carry no information.

Synthesis

Bayes’ rule is the answer to the third question of the course slogan: how should observation change belief? It does so in one identity, posterior ∝\propto prior ×\times likelihood, with the evidence renormalizing. Applied once, it turns a prior over cells into a posterior; applied repeatedly, with each posterior serving as the next step’s prior, it is a learning algorithm that drove the belief in a fruitlessly searched cell to zero and, in the odds form, reduced an observation’s whole effect to a single multiplier, the likelihood ratio. Every later session is a new home for this machinery: continuous data in Movement II, vectors in Movement IV, whole functions in Movement V, but always posterior ∝\propto prior ×\times likelihood. One assumption, though, has been running silently underneath the repeated-search formula: that successive looks are independent given the target’s location. Session 3 asks when that is legitimate, and what a belief is finally for once we have it, which is to choose an action.

Self-check questions

  1. In Bayes’ rule, which factor is a function of the hypothesis with the data fixed, and why need it not sum to one over hypotheses?
    Answer: the likelihood ℙ(A|Bi)\mathbb{P}(A \,|\,B_i); it is a list of predictions of one fixed observation, not a distribution over ii, so nothing forces ∑iℙ(A|Bi)=1\sum_i \mathbb{P}(A \,|\,B_i) = 1.

  2. After a failed search of cell ii, by what common factor do all the other cells’ probabilities grow, and why is it the same for each?
    Answer: by 1/(1−qpi)1/(1 - q\,p_i); it is common because each unsearched cell’s likelihood of the failure is 11, so only the shared evidence rescales them.

  3. Prior odds 1:491{:}49 and a likelihood ratio of 1919 give what posterior probability, and what is the lesson?
    Answer: posterior odds 19:4919{:}49, probability 19/68≈0.2819/68 \approx 0.28; a strong likelihood ratio can still lose to a strong prior (base-rate neglect).