Universal hashing and k-wise independent random variables via integer arithmetic without primes

  • Martin Dietzfelbinger
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1046)


Let u, m≥1 be arbitrary integers and let ku. The central result of this paper is that the multiset H={itha,b¦0≤a, b<km} of functions from U=0,..., u }-1 to M={0,..., m −1, where h a,b (x)=((ax+b) mod km) div k, for xU, is a (c, 2)-universal class of hash functions from U to M in the sense of Carter and Wegman [7, 25], with c=5/4. More precisely, we show that if x1, x2 are distinct elements of U and i1,i2M are arbitrary, and if h is chosen at random from H, then ¦Prob (h(x1)=i1h(x2)=i2-1/m2¦≤(1/2km)2≤1/4m2. Among the many known constructions of (c, 2)-universal classes there was none that would get by with such a small number of pure integer arithmetic operations without the assumption that a prime number of size the order of¦U¦ or at least ¦M¦ was available. — Varying this result, we obtain: (a) two-independent sequences of random variables; (b) universal hash classes of higher degree (“(c, l)-universal” classes) and l-wise independent random variables, for l ≥ 2; (c) algorithms for static and dynamic perfect hashing with an optimal number of random bits; all using pure integer arithmetic without the need for providing prime numbers (arbitrary or random) of a certain size. It should be noted that the focus here is not on minimizing the size of the probability space used, as in much of the recent work on “almost k-independent random variables”, but on the realization of such variables or hash classes using the most natural and most widely available operations, viz., integer arithmetic.


Hash Function Prime Number Finite Field Universal Class Integer Arithmetic 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    K. Abrahamson. Time-space tradeoffs for branching programs contrasted with those for straight-line programs. In Proc. of the 27th IEEE FOCS, pp. 402–409, 1986.Google Scholar
  2. 2.
    N. Alon, O. Goldreich, J.Håstad, and R. Peralta. Simple constructions of almost k-wise independent random variables. Random Structures and Algorithms, 3:289–304, 1992.Google Scholar
  3. 3.
    N. Alon, O. Goldreich, J. Håstad, and R. Peralta. Addendum to “simple constructions of almost k-wise independent random variables”. Random Structures and Algorithms, 4(1):119–120, 1993.Google Scholar
  4. 4.
    P. Beame, S.A.Cook, and H.J.Hoover. Log depth circuits for division and related problems. SIAM J. Comput., 15(4):994–1003, 1986.CrossRefGoogle Scholar
  5. 5.
    B. Chor and O. Goldreich. On the power of two-point based sampling. J. of Complexity, 5:96–106, 1989.CrossRefGoogle Scholar
  6. 6.
    T. H. Cormen, C. E. Leiserson, and R. L. Rivest. Introduction to Algorithms. MIT Press, Cambridge, Mass., 1990.Google Scholar
  7. 7.
    J. L. Carter and M. N. Wegman. Universal classes of hash functions. J. Comp. Syst. Sci., 18:143–154, 1979.CrossRefGoogle Scholar
  8. 8.
    M. Dietzfelbinger, J. Gil, Y. Matias, and N. Pippenger. Polynomial hash functions are reliable. In W. Kuich, editor, Proceedings of 19th ICALP, pp. 235–246. Springer-Verlag, LNCS 623, 1992.Google Scholar
  9. 9.
    M. Dietzfelbinger, T. Hagerup, J. Katajainen, and M. Penttonen. A reliable randomized algorithm for the closest-pair problem. Research Report 513, Universität Dortmund, December 1993.Google Scholar
  10. 10.
    M. Dietzfelbinger, A. Karlin, K. Mehlhorn, F. Meyer auf der Heide, H. Rohnert, and R. E. Tarjan. Dynamic perfect hashing: Upper and lower bounds. SIAM J. Comput., 23(4):738–761, 1994.CrossRefGoogle Scholar
  11. 11.
    M. Dietzfelbinger and F. Meyer auf der Heide. Dynamic hashing in real time. In J. Buchmann, H. Ganzinger, and W. J. Paul, editors, Informatik. Festschrift zum 60. Geburtstag von Günter Hotz, volume 1 of Teubner-Texte zur Informatik. B. G. Teubner, Stuttgart-Leipzig, 1992.Google Scholar
  12. 12.
    M. L. Fredman, J. Komlós, and E. Szemerédi. Storing a sparse table with O(1) worst case access time. J. Assoc. Comput. Mach., 31(3):538–544, July 1984.MathSciNetGoogle Scholar
  13. 13.
    G. H. Hardy, and E. M. Wright. An Introduction to the Theory of Numbers. Oxford Science Publications, Clarendon Press, Oxford, 1994.Google Scholar
  14. 14.
    R. M. Karp and A. Wigderson. A fast parallel algorithm for the maximal independent set problem. J. Assoc. Comput. Mach., 32(4):762–773, 1985.Google Scholar
  15. 15.
    N. Linial, M. Luby, M. Saks, and D. Zuckerman. Efficient construction of a small hitting set for combinatorial rectangles in high dimension. In Proc. of the 24th ACM STOC, pp. 258–267 1993.Google Scholar
  16. 16.
    M. Luby. A simple parallel algorithm for the maximal independent set problem. SIAM J. Comput., 15:1036–1053, 1986.CrossRefGoogle Scholar
  17. 17.
    K. Mehlhorn. Data Structures and Algorithms 1: Sorting and Searching. Springer-Verlag, Berlin, 1984.Google Scholar
  18. 18.
    Y. Mansour, N. Nisan, and P. Tiwari. The computational complexity of universal hashing. Theoretical Computer Science, 107:121–133, 1993.CrossRefGoogle Scholar
  19. 19.
    K. Mehlhorn and U.Vishkin. Randomized and deterministic simulations of PRAMs by parallel machines with restricted granularity of parallel memories. Acta Informatica, 21:339–374, 1984.CrossRefGoogle Scholar
  20. 20.
    Y. Matias and U. Vishkin. On parallel hashing and integer sorting. J. Algorithms, 12:573–606, 1991.MathSciNetGoogle Scholar
  21. 21.
    N. Nisan. Pseudorandom generators for space-bounded computations. In Proc. of the 22nd ACM STOC, pp. 204–212, 1990.Google Scholar
  22. 22.
    J. Naor and M. Naor. Small-bias probabilitiy spaces: Efficient constructions and applications. In Proc. of the 22nd ACM STOC, pp. 213–223, 1990.Google Scholar
  23. 23.
    A. Siegel. On universal classes of fast high performance hash functions, their time-space tradeoff, and their applications. In Proc. of the 30th IEEE FOCS, pp. 20–25, 1989. Revised Version.Google Scholar
  24. 24.
    A. Schönhage and V. Strassen. Schnelle Multiplikation grosser Zahlen. Computing, 7:281–292, 1971.Google Scholar
  25. 25.
    M. N. Wegman and J. L. Carter. New classes and applications of hash functions. In Proc. of 20th IEEE FOCS, pp. 175–182, 1979.Google Scholar
  26. 26.
    A. Wigderson and O. Goldreich. Tiny families of functions with random properties: A quality-size trade-off for hashing. In Proc. of 26th ACM STOC, pp. 574–583, 1994.Google Scholar
  27. 27.
    A. Wigderson. The amazing power of pairwise independence. In Proc. 26th ACM STOC, pp. 645–647, 1994. (Invited lecture).Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Martin Dietzfelbinger
    • 1
  1. 1.Fachbereich InformatikUniversität DortmundDortmundGermany

Personalised recommendations