We study the problem of designing a data structure that reports the positions of the distinct @math -majorities within any range of an array @math , without storing @math . A @math -majority in a range @math , for @math , is an element that occurs more than @math times in @math . We show that @math bits are necessary for any data structure able just to count the number of distinct @math -majorities in any range. Then, we design a structure using @math bits that returns one position of each @math -majority of @math in @math time, on a RAM machine with word size @math (it can output any further position where each @math -majority occurs in @math additional time). Finally, we show how to remove a @math factor from the time by adding @math bits of space to the structure.
The time can be improved to @math on a RAM machine of @math bits by sampling, for each increasing interval of @math of length more than @math , one value out of @math . Predecessor data structures are built on the samples of each interval, taking at most @math bits. Then we first run a predecessor query on @math , which takes time @math @cite_21 , and finish with an @math -time binary search between the resulting samples.
@cite_21
2089135543 2951082421 2949155877 2508919161
We give efficient algorithms for volume sampling, i.e., for picking @math -subsets of the rows of any given matrix with probabilities proportional to the squared volumes of the simplices defined by them and the origin (or the squared volumes of the parallelepipeds defined by these subsets of rows). In other words, we can efficiently sample @math -subsets of @math with probabilities proportional to the corresponding @math by @math principal minors of any given @math by @math positive semi definite matrix. This solves an open problem from the monograph on spectral algorithms by Kannan and Vempala (see Section @math of KV , also implicit in BDM, DRVW ). Our first algorithm for volume sampling @math -subsets of rows from an @math -by- @math matrix runs in @math arithmetic operations (where @math is the exponent of matrix multiplication) and a second variant of it for @math -approximate volume sampling runs in @math arithmetic operations, which is almost linear in the size of the input (i.e., the number of entries) for small @math . Our efficient volume sampling algorithms imply the following results for low-rank matrix approximation: (1) Given @math , in @math arithmetic operations we can find @math of its rows such that projecting onto their span gives a @math -approximation to the matrix of rank @math closest to @math under the Frobenius norm. This improves the @math -approximation of Boutsidis, Drineas and Mahoney BDM and matches the lower bound shown in DRVW . The method of conditional expectations gives a algorithm with the same complexity. The running time can be improved to @math at the cost of losing an extra @math in the approximation factor. (2) The same rows and projection as in the previous point give a @math -approximation to the matrix of rank @math closest to @math under the spectral norm. In this paper, we show an almost matching lower bound of @math , even for @math . Due to its optimality on a single machine for the problem of minimizing average flow time, Shortest-Remaining-Processing-Time ( ) appears to be the most natural algorithm to consider for the problem of minimizing average flow time on multiple identical machines. It is known that @math achieves the best possible competitive ratio on multiple machines up to a constant factor. Using resource augmentation, @math is known to achieve total flow time at most that of the optimal solution when given machines of speed @math . Further, it is known that @math 's competitive ratio improves as the speed increases; @math is @math -speed @math -competitive when @math . However, a gap has persisted in our understanding of @math . Before this work, the performance of @math was not known when @math is given @math -speed when @math . We complement this by showing that @math is @math -speed @math -competitive for the objective of minimizing the @math -norms of flow time on @math identical machines. Both of our results rely on new potential functions that capture the structure of . Our results, combined with previous work, show that @math is the best possible online algorithm in essentially every aspect when migration is permissible. Karpinski and Nekrich (2008) introduced the problem of parameterized range majority, which asks to preprocess a string of length @math such that, given the endpoints of a range, one can quickly find all the distinct elements whose relative frequencies in that range are more than a threshold @math . Subsequent authors have reduced their time and space bounds such that, when @math is given at preprocessing time, we need either @math space and optimal @math query time or linear space and @math query time, where @math is the alphabet size. In this paper we give the first linear-space solution with optimal @math query time. For the case when @math is given at query time, we significantly improve previous bounds, achieving either @math space and optimal @math query time or compressed space and @math query time. Along the way, we consider the complementary problem of parameterized range minority that was recently introduced by (2012), who achieved linear space and @math query time even for variable @math . We improve their solution to use either nearly optimally compressed space with no slowdown, or optimally compressed space with nearly no slowdown. Some of our intermediate results, such as density-sensitive query time for one-dimensional range counting, may be of independent interest. [See the paper for the full abstract.] We show tight upper and lower bounds for time-space trade-offs for the @math -Approximate Near Neighbor Search problem. For the @math -dimensional Euclidean space and @math -point datasets, we develop a data structure with space @math and query time @math for every @math such that: This is the first data structure that achieves sublinear query time and near-linear space for every approximation factor @math , improving upon [Kapralov, PODS 2015]. The data structure is a culmination of a long line of work on the problem for all space regimes; it builds on Spherical Locality-Sensitive Filtering [Becker, Ducas, Gama, Laarhoven, SODA 2016] and data-dependent hashing [Andoni, Indyk, Nguyen, Razenshteyn, SODA 2014] [Andoni, Razenshteyn, STOC 2015]. Our matching lower bounds are of two types: conditional and unconditional. First, we prove tightness of the whole above trade-off in a restricted model of computation, which captures all known hashing-based approaches. We then show unconditional cell-probe lower bounds for one and two probes that match the above trade-off for @math , improving upon the best known lower bounds from [Panigrahy, Talwar, Wieder, FOCS 2010]. In particular, this is the first space lower bound (for any static data structure) for two probes which is not polynomially smaller than the one-probe bound. To show the result for two probes, we establish and exploit a connection to locally-decodable codes.