medium · Order statistics and uniform spacings
Drop points independently and uniformly on the interval . Let the order statistics be , and define the spacings
Find the marginal distribution of a single spacing and its mean.
Fix a deterministic point . Let be the length of the spacing that contains (i.e. the gap with , with the convention that the endpoints and serve as boundaries when no sample point lies below or above ). Compute in closed form.
Now let be drawn independently of the points, and let be the length of the spacing containing . Compute , and reconcile the answer with the mean spacing found in part 1.
By exchangeability of the spacings (the vector is uniformly distributed on the simplex ), all share one marginal law. Take , the minimum of i.i.d. uniforms: Differentiating, has density , i.e. , with
Write , where The step candidates miss is that is not a typical spacing: conditioning on containing length-biases the gap, and there is a boundary correction. The clean route is the tail-integral formula .
For , the event means no sample point falls in the interval of length : Since always (there is an atom of mass at , automatically included by the tail integral), Symmetrically, for , so Adding,
Sanity check at : , roughly twice the mean spacing — the inspection paradox: a fixed point is more likely to fall inside a long gap.
Integrate the part-2 result over :
Reconciliation (length-biased sampling). Given the spacings, the probability that lands in gap is exactly . Hence the length-biased mean. For , , so agreeing with the integral. The random point sees gaps weighted by their length, so its expected gap is the size-biased mean, strictly larger than the plain mean whenever .
Tempting wrong answer: quoting (the plain spacing mean) for either part 2 or part 3 — this ignores that requiring a gap to contain a given point biases toward longer gaps.
medium · Metropolis-Hastings, Gibbs sampling and detailed balance
Let be a probability distribution on the finite state space , with states written and probabilities
| state | ||||
|---|---|---|---|---|
Consider the two single-coordinate Gibbs kernels. leaves fixed and redraws from the exact conditional ; leaves fixed and redraws from .
Show that each satisfies detailed balance with respect to , and deduce that the random-scan Gibbs kernel is -reversible.
Let be the systematic-scan kernel that updates coordinate and then coordinate . Using the numbers above, compute and for , , and conclude that is not -reversible. Confirm nonetheless that .
Prove the general criterion behind part 2: for two kernels that are each -reversible, the composition is -reversible if and only if . Use it to name one deterministic scan order that is guaranteed to be reversible.
Throughout, write and regard a kernel as a matrix. The identity that organizes everything: is -reversible (detailed balance) the matrix is symmetric is self-adjoint on with .
only connects states sharing the same , with Hence which is symmetric under swapping . For transitions that change both sides are . So satisfies detailed balance; by symmetry so does .
Detailed balance is preserved by convex combinations: if for , then averaging the two identities gives . Thus is -reversible.
First the conditionals. Marginals of : , ; marginals of : , . Then
Under we redraw from , then redraw from , so
For :
For :
Since , detailed balance fails: is not -reversible.
Stationarity still holds, however. is a left eigenvector of each factor ( because a full conditional resample leaves the joint invariant, likewise ), so . This is the point candidates most often miss: a systematic-scan Gibbs sampler has the correct invariant distribution yet is generically not reversible.
Reversibility is self-adjointness on . If are each self-adjoint, then using and . Hence is self-adjoint (i.e. -reversible) iff .
In the numeric example the two updates do not commute, which is exactly why detailed balance broke.
A scan order guaranteed reversible: the palindromic sweep (update , then , then again). Indeed so it is self-adjoint regardless of whether and commute. (One must halve the effective work of the repeated block, but reversibility is restored.)
Note. A tempting error is to reason "detailed balance for each block detailed balance for the sweep." Convex combinations inherit detailed balance (part 1), but compositions do not, because self-adjoint operators need not have self-adjoint products. Reversibility is not required for a valid MCMC sampler — only invariance is — but many CLT and spectral-gap results assume it, which is one practical reason the palindromic (or random) scan is preferred.
Two new problems every morning at 8am · every day so far