Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 11.5, Problem 1E
Program Plan Intro
To show that the probability of no collision is
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
The hash function
h(k)= k mod m
and linear probing are used to insert the keys
37, 38, 72, 48, 98, 11, 56
into a hash table of size = 7 having indices 0...6. The order of the hash codes in the
array are given by
a. 72, 11, 37, 38, 56, 98, 47
b. 98, 56, 37, 38, 72, 11, 48
c. 98, 11, 37, 38, 72, 56, 48
d. 11, 37, 48, 38, 72, 98, 56
e. 11, 38, 98, 37, 72, 48, 56
Given:• a hash function: h(x) = | 3x + 1 | mod M• bucket array of capacity 'N'• set of objects with the folloeing keys: 12, 44, 13, 88, 23, 94, 11, 39, 20, 16, 5 (to input from left to right)
1. What would be the hash table where M=N=11 and collisions are taken care of using linear probing?
2. What would be the hash table where M=N=11 and collisions are taken care of using separate chaining?
3. Would a size N for the bucket array be able to exist, so that no collisions happen with thehash function h(x) = | 2x + 5 | mod 11 and the keys above?
Computer Science
(a) Let h be a collision resistant hash function. Now consider the following function H that is defined for binary strings of even length. Let x = x1||x2 with x1 ∈ F2n and x2 ∈ Fn2 . Then
H(x) = h(x1 ⊕ x2).
Prove that this function is not collision resistant.
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 1 2 3 4 6 7 8 A E F 10 11 12 13 14 15arrow_forwardLet S be the set consisting of all 10 digits and all upper- and lowercase letters. Let U be the set of all (ordered) strings consisting of exactly four elements from S. Construct an injective hash function h: U -> N with the smallest possible value of maxUh(u). Modify your hash function to give a simply uniform map h' to the set {0, ..., 30}. In other words, if U is a probability space with P(u) = P(u') for all u, u' in U, then the random variable h': U -> {0, ..., 30} should have a uniform distribution..arrow_forwardcode in python attached please Define a hash table with an associated hash function ℎ(?)h(k) mapping keys ?k to their associated hash value. b) In simple uniform hashing, each key is assumed to have equal probability to map to any of the hashes in a given table of size m. Given an open-address table of size 500500 and 22 random keys, what is the probability that they hash to the same value? What is the probability that they hash to different values?arrow_forward
- security pr As we mentioned in class, a universal hash function is a function UH(K, M) that takes a key K, a message M and produces a fixed length digest. The universal hash is defined to be "secure" if for any two messages M₁ and M2, if K is selected uniformly at random, then the probability that UH(K, M₁) UH(K, M₂) is approximately zero. == Suppose that H is a secure hash function. Is UH(K, M) = H(K||M) a secure universal hash function? Either prove the answer is "yes" using the security properties of H (which can be assumed), or show how the security of UH could be violated. VOarrow_forwardConsider the following sequence of keys to be inserted in turn in a hash table of size 7 that uses quadratic probing to resolve collisions (only use +i2 in probing, and do not use -i2 in probing) : 19, 26, 3, 20, 2, 10 Select the choice that shows what the hash table looks like after all keys are inserted (X indicates an empty slot). Question 29 options: [20, 3, X, 26, x, 19, 2] [x, 2, 3, 20, X, 19, 26] [20, X, 2, 3, x, 19, 26] [x, 3, 2, 26, X, 19, 20] [20, X, 2, 3, 19, x, 26]arrow_forwardGiven input {71, 22, 21, 99, 53, 69, 39} and a hash function h(x) = x mod 10, show the resulting: Hash table with double hash function (Use: h(x)=5-(x mod 5) ) and give the time complexity of search and insert operation with big-oh notation.arrow_forward
- This is question which I want you to solve but solve with this step and draw Q/Given input (4371, 1323, 6173, 4199, 4344, 9679, 1989) and hash function h(x):=xmod 10 show the resulting a. Separate chaining hash table.. B.Hash table using linear probing. C. Hash table using quadratic probing This is examples pls follow step same step when you solve questions up EX: given input (89, 18, 49, 58, 69) and a hash function h(x) = x mod 10, show the resulting: 1. Hash table using linear probing. 2. Hash table using quadratic probing. Sol: 1- Linear probing 9 89 0 49 في حالة وجود تصادم نتحرك بمقدار واحد لتفادي التصادم H(x)=x mod 10 1 2 3 4 58 89 2- quadratic probing. H(x)=x mod 10 0 1 2 49 58 3 69 5 6 H(x)=x + imod 10 4 5 7 6 نبدي من 1 وفي حاله حصل تصادم نزيد واحد 8 7 18 8 18 9 89arrow_forwardConsider an extensible hash table that uses 4-bit hash keys and stores two records per bucket. Simulate the insertion, into an initially empty hash table, of records with (hash values of) keys 1111, 1110, 1101,..., 0001, 0000, in that order. Which combination of i (the number of bits used to index the bucket array) and a set of of keys belong to one bucket at some time during the sequence of insertions? Group of answer choices i = 1; 1110 only. i = 3; 0101 only. i = 2; 1111 only. i = 3; 1000 only.arrow_forwardConsider a hash table with `n` slots and a hash function that distributes keys uniformly across the slots. Suppose `m` keys are inserted into the hash table, where `m` is much larger than `n`. What is the expected number of collisions? Assume that each key is equally likely to be hashed to any of the `n` slots, and that each key is independent of all other keys. Express your answer in terms of `n` and `m`.arrow_forward
- For the operation below, provide the worst case running time in terms of n (Big O notation). Briefly justify your answer. >>> Find the maximum value in hash table where linear probing (+1 probe) is used to resolve collisions. Assume: table size = n2 and there are currently n items in the hash tablearrow_forwardConsider a hash table of size M using separate chaining with ordered lists and the hash function hash(k) = k mod M. a) Assume N items have already been inserted in the table. What is, in average, the cost (number of operations) needed for searching an item in the table? Justify your answer. b) Assume N items have already been inserted in the table. What is, in average, the cost (number of operations) needed for inserting the next (N+1)th item? Justify your answer.arrow_forwardSuppose that the size of the hash table is 101. Further suppose that certain keys with theindices 15, 101, 116, 0 and 217 are to be inserted in this order into an initially empty hash table.Using modular arithmetic, find the indices in the hash table if :a. Linear probing is used.b. Quadratic probing is used.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education