Estimating Sum by Weighted Sampling

  • Rajeev Motwani ,
  • Rina Panigrahy ,
  • Ying Xu 0002

International Colloquium on Automata, Languages and Programming, (ICALP) |

We study the classic problem of estimating the sum of n variables. The traditional uniform sampling approach requires a linear number of samples to provide any non-trivial guarantees on the estimated sum. In this paper we consider various sampling methods besides uniform sampling, in particular sampling a variable with probability proportional to its value, referred to as linear weighted sampling. If only linear weighted sampling is allowed, we show an algorithm for estimating sum with O~(n)">O~(n) samples, and it is almost optimal in the sense that Ω(n)">Ω(n) samples are necessary for any reasonable sum estimator. If both uniform sampling and linear weighted sampling are allowed, we show a sum estimator with O~(n3)">O~(n3) samples. More generally, we may allow general weighted sampling where the probability of sampling a variable is proportional to any function of its value. We prove a lower bound of Ω(n3)">Ω(n3) samples for any reasonable sum estimator using general weighted sampling, which implies that our algorithm combining uniform and linear weighted sampling is an almost optimal sum estimator.