Median trick


The median trick is a generic approach that increases the chances of a probabilistic algorithm to succeed. Apparently first used in 1986 by Jerrum et al. for approximate counting algorithms, the technique was later applied to a broad selection of classification and regression problems.
The idea of median trick is very simple: run the randomized algorithm with numeric output multiple times, and use the median of the obtained results as a final answer. For example, if an algorithm takes a set of data as input, and has sublinear runtime, then the same algorithm can be run repeatedly over randomly sampled subsets of input data, and, per Chernoff inequality, the median of the results will converge to solution rapidly. Similarly, for the algorithms that are sublinear in space, different randomizations of the algorithm may be used for repeated runs over the same data.

Statement

Given a set of independent random variables, and an unknown deterministic number.
Suppose that each random variable falls within with probability where is a constant, then the median trick states that with probability.
In other words, in order to ensure that with probability, it suffices to use samples.