Computing Values of a Hash Function Instead of 10,000 students, suppose there are only 6. Define a function H, from the set of student ID numbers to the set {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} as follows: H(n) = n mod 11 for each ID number n. To compute values of H either use a calculator or a computer with a built-in mod function or use the formula n mod 11 = n - (n div 11). In other words, divide n by 11, multiply the integer part of the result by 11, and subtract that number from n. As an example, since 328343419/11 = 29849401.73. H(328343419) = 328343419 - (11 * 29849401) = 8. To store the link to the record for the student with ID number n, start by computing H(n). For instance, if the ID numbers are 328343419, 356633102, 223799061, 607275830 and 513408716, calculate the hash values and comment in detail with mathematical justification on the hash function.
Computing Values of a Hash Function
Instead of 10,000 students, suppose there are only 6. Define a function
H, from the set of student ID numbers to the set {0, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10} as follows:
H(n) = n mod 11 for each ID number n.
To compute values of H either use a calculator or a computer with a
built-in mod function or use the formula n mod 11 = n - (n div 11). In
other words, divide n by 11, multiply the integer part of the result
by 11, and subtract that number from n.
As an example, since 328343419/11 = 29849401.73.
H(328343419) = 328343419 - (11 * 29849401) = 8. To store the link to
the record for the student with ID number n, start by computing H(n).
For instance, if the ID numbers are 328343419, 356633102, 223799061,
607275830 and 513408716, calculate the hash values and comment in detail
with mathematical justification on the hash function.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps