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

[Thread A] 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

We first need vocabulary for “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.

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.

Worked examples

Take the Session 1 prior (p1,p2,p3,p4)=(0.4,0.3,0.2,0.1)(p_1,p_2,p_3,p_4) = (0.4, 0.3, 0.2, 0.1) and α=0.5\alpha = 0.5, so q=0.5q = 0.5. We search region 11 and fail.

First failed look. The evidence is 1−qp1=1−(0.5)(0.4)=0.81 - q\,p_1 = 1 - (0.5)(0.4) = 0.8. Proposition 1 gives ℙ(cell 1|F1)=(0.5)(0.4)0.8=0.200.8=0.25,ℙ(cell 2|F1)=0.30.8=0.375,ℙ(cell 3|F1)=0.20.8=0.25,ℙ(cell 4|F1)=0.10.8=0.125.\begin{align} \mathbb{P}(\text{cell } 1 \,|\,F_1) &= \frac{(0.5)(0.4)}{0.8} = \frac{0.20}{0.8} = 0.25, & \mathbb{P}(\text{cell } 2 \,|\,F_1) &= \frac{0.3}{0.8} = 0.375, \\ \mathbb{P}(\text{cell } 3 \,|\,F_1) &= \frac{0.2}{0.8} = 0.25, & \mathbb{P}(\text{cell } 4 \,|\,F_1) &= \frac{0.1}{0.8} = 0.125. \end{align} The four posteriors sum to 11, and every unsearched cell grew by the factor 1/0.8=1.251/0.8 = 1.25 promised by Corollary 1. Notice already that region 22, at 0.3750.375, has overtaken region 11, at 0.250.25: a single empty look was enough to unseat the favorite.

Second failed look in region 11. Treat the posterior above as the new prior; now p1=0.25p_1 = 0.25 and the evidence is 1−(0.5)(0.25)=0.8751 - (0.5)(0.25) = 0.875. Then ℙ(cell 1|F1F1)=(0.5)(0.25)0.875≈0.143,ℙ(cell 2|F1F1)=0.3750.875≈0.429,\begin{equation} \mathbb{P}(\text{cell } 1 \,|\,F_1 F_1) = \frac{(0.5)(0.25)}{0.875} \approx 0.143, \qquad \mathbb{P}(\text{cell } 2 \,|\,F_1 F_1) = \frac{0.375}{0.875} \approx 0.429, \end{equation} with regions 33 and 44 at ≈0.286\approx 0.286 and ≈0.143\approx 0.143. Equivalently, the two-failure formula [eq:repeat] gives region 11 directly as 0.4(0.5)20.4(0.5)2+0.6=0.10.7≈0.143\tfrac{0.4\,(0.5)^2}{0.4\,(0.5)^2 + 0.6} = \tfrac{0.1}{0.7} \approx 0.143, a useful check.

When does region 2 overtake region 1?. Region 22 passes region 11 after the first failed look (posteriors 0.3750.375 vs. 0.250.25), and the gap only widens with more failures. The crossover happens as soon as the searched favorite has enough probability drained to fall below the runner-up, which here is immediate.

Historical sidebar. This exact update 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 Bayesian bookkeeping after earlier sweeps had failed. In both, a failed look was treated not as wasted effort but as data.

(b) A base-rate problem in odds form

A cognitive-radio node must decide whether a licensed channel is occupied. Occupancy is rare: the prior is ℙ(occupied)=0.02\mathbb{P}(\text{occupied}) = 0.02. The node’s 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. The detector raises a flag. How strongly should the node now believe the channel is occupied?

Work in odds. The prior odds of occupied against free are 0.02/0.98=1/490.02/0.98 = 1/49, i.e. 1:491{:}49. The likelihood ratio of a flag is L(flag)=ℙ(flag|occupied)ℙ(flag|free)=0.950.05=19.\begin{equation} L(\text{flag}) = \frac{\mathbb{P}(\text{flag} \,|\,\text{occupied})}{\mathbb{P}(\text{flag} \,|\,\text{free})} = \frac{0.95}{0.05} = 19. \end{equation} By the odds form [eq:odds], the posterior odds are 149×19=1949\tfrac{1}{49} \times 19 = \tfrac{19}{49}, i.e. 19:4919{:}49, so ℙ(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.

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. (Odds form.) A test for a rare fault has prior ℙ(fault)=0.01\mathbb{P}(\text{fault}) = 0.01, detection probability 0.90.9, false-alarm probability 0.10.1. The test fires. Give the posterior odds and probability of a fault.
    Answer: prior odds 1:991{:}99, L=9L = 9, posterior odds 9:99=1:119{:}99 = 1{:}11, so ℙ(fault|fire)=9/108=1/12≈0.083\mathbb{P}(\text{fault}\,|\,\text{fire}) = 9/108 = 1/12 \approx 0.083.

  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).