This page is a drill. Its parent, MAP estimation, showed you the machinery: θ^MAP=argmaxθ[logP(x∣θ)+logP(θ)]. Here we throw every kind of situation at that machinery so no exam question can surprise you.
First, one symbol we will use on every line:
Now a tiny reminder of the words, in plain language, each anchored to a picture below:
MAP is just "find the highest point of likelihood times prior." Everything below is that one sentence, stress-tested.
Every MAP problem falls into one of the eight cells A–H below. Read the table as "cell → what makes it tricky → which example drills it." Each worked example later is tagged with its cell letter, so you can hunt any scenario by its label. Think of A–H as a checklist: if you can do all eight, no MAP question is new to you.
Cell
Cell class
What makes it tricky
Example
A
Prior disagrees with data
prior pulls estimate one way, data pulls the other
Ex 1
B
Data-scarce vs data-rich limit
small n (prior dominates) → large n (data dominates)
Ex 2
C
Degenerate: zero successes (k=0)
MLE gives 0; does MAP?
Ex 3
D
Degenerate: uniform prior
MAP must collapse exactly to MLE
Ex 4
E
Mode = mean (asymmetric posterior)
which number to report
Ex 5
F
Regularization face (Gaussian prior = L2)
see the penalty become a prior
Ex 6
G
Real-world word problem
translate English → likelihood + prior
Ex 7
H
Exam twist: prior with α<1 or β<1 forcing a boundary solution
Figure 1 (read me first). The blue curve is the likelihood P(x∣θ), the pink curve is the prior P(θ), and the yellow curve is their point-by-point product, the posterior. The dashed yellow line marks its peak — the MAP estimate. This single picture is the template for Examples 1–5 and 8: those all live on this [0,1] axis, just with different blue and pink shapes. Keep it in view.
Whenever the data is "successes out of trials," the likelihood is Binomial and the natural prior is a Beta. Recall the Beta(α,β) shape P(θ)∝θα−1(1−θ)β−1 for θ∈[0,1]. Because Beta is the conjugate prior for the Binomial, the posterior is again Beta:
Why this mode formula, and why the edge checks? Take log[θa−1(1−θ)b−1] and differentiate: the slope is θa−1−1−θb−1. Setting it to 0 gives the fraction. But a stationary point only exists inside(0,1) when both a−1 and b−1 have the sign that makes the two terms trade off. If, say, a−1≤0, the first term never pulls the slope positive, so the function only falls — its highest point is the boundary θ=0. That is why you cannot blindly plug in: the "−1"s can push you onto an edge. (The same "−1" mismatch also makes the mode differ from the mean — a distinction Ex 5 hammers home.)
Figure 2 (this is Example 2). Each curve is the posterior for one of the three sample sizes in Example 2. As n climbs (blue → pink → yellow), the peak slides from ≈0.69 toward 0.70 (the dashed white MLE line) and narrows — more data buys both accuracy and confidence. The dotted vertical lines are the three MAP peaks you computed above.
For continuous parameters with Gaussian noise, the likelihood peak is the sample mean xˉ, and a Gaussian prior shrinks it toward the prior mean. This shrinkage is L2 regularization — see Regularization in ML, Ridge Regression.
Recall Quick self-test (cover the answers)
What does MAP report, mode or mean? ::: The mode (peak) of the posterior.
Beta(1,1) prior turns MAP into what? ::: Exactly the MLE (uniform prior).
Before using the Beta mode formula, what must you check? ::: That both posterior shape numbers exceed 1 (a>1 and b>1); otherwise the peak is on an edge (0 or 1).
Zero heads in n flips: why is MLE dangerous but MAP safe? ::: MLE gives 0 (impossible-heads-forever); a Beta prior with α>1 keeps a>1 so MAP stays inside (0,1).
L2 regularization with strength λ is MAP with which prior? ::: Gaussian N(0,σ2) with λ=1/(2σ2).
When does the "set derivative to zero" step fail? ::: When a≤1 or b≤1 — the maximum is on the boundary, so check the endpoints.