betaFeedback

WorksComputer Science

Revisiting Generalized Median Estimators: Exact Bitwise Computation and Gray Code Acceleration

Abstract

Generalized median estimators evaluate the median of a symmetric kernel over all M=(nk)M = \binom{n}{k} subsets of size kk. Exhaustive evaluation was considered impractical even for n=29,k=5n = 29, k = 5 (M=118,755M = 118,755), prompting stochastic subsampling (Wilde and Grimshaw, 2013). We show that this barrier is computational, not combinatorial: storing all subsets requires Θ(kM)Θ(kM) space, whereas stateful enumeration uses O(k)\mathcal{O}(k) auxiliary state and retains only MM kernel values. We combine two exhaustive traversals with three-way Quickselect and a deterministic median-of-medians fallback, giving worst-case O(M)\mathcal{O}(M) selection. Gosper's successor takes O(k)\mathcal{O}(k) kernel work per subset for n<wn < w; a Revolving Door Gray code changes one element out and one in, enabling O(1)\mathcal{O}(1) kernel updates between recalibrations and O(M+kM/P)\mathcal{O}(M + kM/P) total time. We derive floating-point error bounds for the location (h1h_1) and mean-centered sample variance (h2h_2) kernels and their resulting median. For n=29,k=5n = 29, k = 5, our ANSI C implementation evaluates all 118,755118,755 subsets in 0.740.74 ms and 0.710.71 ms, respectively. A direct C sweep places the crossover with partial lexicographic unranking at approximately 18,00018,000-23,00023,000 subsets (15%15\%-19%19\% of MM), below the 32,16032,160-45,42045,420 subsets required by Wilde and Grimshaw's sequential approximation at ε=0.01ε= 0.01.

Paper details

vlnc:W_d47j8cmr
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
arXiv nonexclusive license
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…