Predicting an address from density
For events a₀ < … < aₜ₋₁ in a period R I write ρ=T/R. I estimate the address of rank k by (k+1/2)/ρ. An exact prefix count at that position tells me how many events I must move past to correct the estimate.
Let C(X) count events strictly before X. With X uniform on the integer thresholds 0,…,R−1, put V=Var(C(X)−ρX). With K uniform on the T event ranks the centred address error satisfies
Var(a_K−(K+1/2)/ρ) = [V+(ρ²−1)/12]/ρ².
I get the relation by integrating the squared difference between the distribution function and the diagonal, then reading the integral by quantile. Integration within each discrete cell supplies the correction. This is a discrete application of the Cramér–von Mises relation. It measures mean-square error; a particular query can require a much larger correction. Statistic and references
Computing V
For a positive pattern the indicator autocorrelation factors by prime via the Chinese remainder theorem. I contract those factors against the quadratic Green kernel of the cycle. Three partial moments and a wraparound correction aggregate whole groups of residue pairs. The original exact gap-two fractions reach level 47 and the grouped C++ calculation reaches 71. The Python check reaches 67. Moments of reduced residues have an earlier literature. Montgomery and Vaughan · Dilation and dispersion
Reproduce the experiment
In IX/src, transport.py checks the moments on small periods. green_twins.csv gives exact reference fractions.
Download research files ↓