Skip to content

Two-way rounding

Donald E. Knuth

math.OCarXiv:math/9504228

Abstract

Given n real numbers 0≤ x1,...,xn<1 and a permutation~σ of \1,...,n\, we can always find 1,...,n∈\0,1\ so that the partial sums 1+... +k and σ1+... +σk differ from the unrounded values x1+... + xk and xσ1+... +xσk by at most n/(n+1), for 1≤ k≤ n. The latter bound is best possible. The proof uses an elementary argument about flows in a certain network, and leads to a simple algorithm that finds an optimum way to round.

Create a lesson