The multiplication method - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

The multiplication method

Description:

In the division method, m takes the responsibility of making good hash function. ... as the fraction A/w if we imagine the radix point to be at the left of the word) ... – PowerPoint PPT presentation

Number of Views:92
Avg rating:3.0/5.0
Slides: 7
Provided by: tclabK
Category:

less

Transcript and Presenter's Notes

Title: The multiplication method


1
The multiplication method
  • 11.3 Hash functions

2
m wants to shirk
  • In the division method, m takes the
    responsibility of making good hash function.
  • There are some restrictions in choosing m.
  • So, A is invited to participate.

3
The golden ratio divides it well
  • Mark off the points F-1, 2F-1, 3F-1, ?? on
    line segment 0..1
  • x denotes the fractional part of x (namely x
    mod 1).
  • F-1 is the golden ratio.
  • These points stay very well separated from each
    other.
  • Each newly added point falls into one of the
    largest remaining intervals, and divides it in
    the golden ratio.
  • This phenomenon was observed by Louis and Auguste
    Bravais, Annales des Sciences Naturelles (1837)

4
An Irrational number divides it well
  • The remarkable scattering property of the golden
    ratio is actually just a special case of a very
    general result.
  • Conjectured by Hugo Steinhaus and first proved by
    Vera Turan Sos.

Theorem. Let ? be any irrational number. When the
points ?, 2 ?, , n ? are placed in the
line segment 0..1, the n1 line segments formed
have at most three different lengths. Moreover,
the next point (n1) ? will fall in one of
the largest existing segments.
5
Practical Issues
  • Easy to implement
  • On most machines multiplication is faster than
    division.
  • We can substitute one multiplication by shift
    operation. (choose m to be a power of 2)
  • We dont need to do floating-point operation. (we
    can regard an integer A as the fraction A/w if we
    imagine the radix point to be at the left of the
    word)
  • If successive keys have a large interval, A
    0.6125423371 can be recommended. (for example)

6
Reference
  • This presentation is just a brief summery of The
    art of computer programming, Donald E. Knuth.
Write a Comment
User Comments (0)
About PowerShow.com