Better Sum Estimation via Weighted Sampling

Given a large set where each item has weight , we want to estimate the total weight to within factor of with some constant probability . Since is large, we want to do this without looking at the entire set . In the traditional setting in which we are allowed to sample elements from uniformly, sampling items is necessary to provide any non-trivial guarantee on the estimate. Therefore, we investigate this problem in different settings: in the \emph{proportional} setting we can sample items with probabilities proportional to their weights, and in the \emph{hybrid} setting we can sample both proportionally and uniformly. These settings have applications, for example, in sublinear-time algorithms and distribution testing. Sum estimation in the proportional and hybrid setting has been considered before by Motwani, Panigrahy, and Xu [ICALP, 2007]. In their paper, they give both upper and lower bounds in terms of . Their bounds are near-matching in terms of , but not in terms of . In this paper, we improve both their upper and lower bounds. Our bounds are matching up to constant factors in both settings, in terms of both and . No lower bounds with dependency on were known previously. In the proportional setting, we improve their algorithm to . In the hybrid setting, we improve to . Our algorithms are also significantly simpler and do not have large constant factors. We also investigate the previously unexplored setting where is unknown to the algorithm. Finally, we show how our techniques apply to the problem of edge counting in graphs.
View on arXiv