3. Suppose that we hash 5 items into a table with 5 slots using a random hash fu
ID: 3890563 • Letter: 3
Question
3. Suppose that we hash 5 items into a table with 5 slots using a random hash function that maps every item to each slot with the same probability, independent of the other items. Consider the probability that all the five items are mapped to distinct slots; is this probability close to:
A; 40%
B: 10%
C: 4%
D: 1%
point possible (graded) Suppose we want to hash the telephone numbers of the employees of a company using only some of the digits in the number. The phone numbers have the format (xxx)xxxxxxx; the first three digits are the area code and the next three digits indicate the local telephone exchange. Is it better to use a hash function based on: the first three digits? the next three digits? the last three digits? You have used 0 of 1 attempt Multiple Choice 1 point possible (graded) Suppose we use the hash function h(x) x mod 7 (i.e. h(x) is the remainder of the division of x by 7) to hash into a table with 7 slots (the slots are numbered 0,1.., 6) the following numbers: 32, 57, 43, 20, 28, 67, 41, 62, 91, 54. We use chaining to handle collisions. Which slot contains the longest chain? Slot 0 Slot 1 Slot 4 Slot 6Explanation / Answer
1)suppose we want to hash the telephone numbers of the employees
solutiion is last three digits
2)suppose we use the hash function h(x)=x mod 7 hash to a table with 7 slots.which slot contains longest chain
solution is slot 1
3)Suppose that we hash 5 items into a table with 5 slots using a random hash function that maps every item to each slot with the same probability, independent of the other items. Consider the probability that all the five items are mapped to distinct slots; is this probability close to:
solution is 4%
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.