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, Problem 2P
(a)
Program Plan Intro
To determine the probability Qk of exactly k keys hash present in to a particular slot of the hash table having n number of slots and n keys.
(b)
Program Plan Intro
To show that the probability of slot contacting maximum keys is less then or equals to n times of probability of exactly k keys present in the particular slot.
(c)
Program Plan Intro
Show that the probability of a slot having maximum k keys Qk is less than
(d)
Program Plan Intro
Show that the probability Pkof a slot having maximum number of k keys is less than 1/n2, where is equals to total no. of slots.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Let r[i][j]r[i][j] be the maximum value we can
carry using only items 1 to i given a knapsack of
сарacity ij.
Suppose there are 4 items in the shop. The
values of the items are [5, 7, 10, 6] and the
weights of the items are [3, 2, 4, 1].
1. If our knapsack has capacity 1, compute r[i][1]
for each 1<=i<=4. Which items should we take?
Problem 2: In this problem we assume that h: U → {0, 1,..., m - 1} is a good hash
function, that is, every key k has the same probability to map to any place in the table
T of length m.
1
m
(i) What is the probability that three pairwise distinct elements u₁, U2, U3 EU are
mapped by the function h to the same place in the table (that is, h(u₁) = h(u₂) =
h(uz))?
Hey, Given is a hash table with an initial size of 1000 and a hash function that ensures ahashing, where the keys are chosen randomly under the uniformity assumption.me are chosen. After how many insertions do you have to expect a collision probability of more than 80%?of more than 80%?To keep the number of collisions low during hashing, one can reduce the size of the has-hash table after a certain number of insertions. After which number n of inserted elements must the table be increased for the first time, if no collision occurred in the previous n - 1 elements and the probability of a collision in the n-th insertion should be less than 20%?
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
- Let A = {m ∈ Z | m ≡ 9 (mod 12)}. Let B = {n ∈ Z | n ≡ 1 (mod 4)}.arrow_forwardGiven a matrix of dimension m*n where each cell in the matrix can have values 0, 1 or 2 which has the following meaning: 0: Empty cell 1: Cells have fresh oranges 2: Cells have rotten oranges So we have to determine what is the minimum time required so that all the oranges become rotten. A rotten orange at index [i,j] can rot other fresh orange at indexes [i-1,j], [i+1,j], [i,j-1], [i,j+1] (up, down, left and right). If it is impossible to rot every orange then simply return -1. Examples: Input: arr[][C] = { {2, 1, 0, 2, 1}, {1, 0, 1, 2, 1}, {1, 0, 0, 2, 1}}; Output: All oranges cannot be rotten. Below is algorithm. 1) Create an empty Q. 2) Find all rotten oranges and enqueue them to Q. Also enqueue a delimiter to indicate beginning of next time frame. 3) While Q is not empty do following 3.a) While delimiter in Q is not reached (i) Dequeue an orange from queue, rot all adjacent oranges. While rotting the adjacents, make sure that time frame is incremented only once. And time frame is…arrow_forwardextermal (overilow) chaining is used to resolve collisions. The hash function is suh DL. Consider a hash table with n buckets, where extermal (overilow) chaining is used t resolve collisions. The hash tunction is that the probability that a key value is hashed The hash table is to a particular bucket is initially empty and K distinct values a inserted in the table.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_forwardRegarding the Hash algorithm, which one(s) of the following is/are correct, check all that apply. Given a hash of a piece of information, it is hard to recover the original information itself. Given a piece of information, it is hard to find another piece of information that can generate the same hash. O It is theoretically possible, but practically infeasible, to find two pieces of information that generates the same hash. O Hash is unique to a piece of information, there are no any two piece of information that can generate the same hash unless these two pieces of information are identical.arrow_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_forward
- Problem 2: In this problem we assume that h: U → {0, 1, . . . , m − 1} is a good hashfunction, that is, every key k has the same probability 1/m to map to any place in the tableT of length m.(i) What is the probability that three pairwise distinct elements u1, u2, u3 ∈ U aremapped by the function h to the same place in the table (that is, h(u1) = h(u2) =h(u3))?(ii) We insert three elements into an empty hash table T using the hash function h. Ifcollision is solved by chaining, what is the probability that T[0] and T[1] are empty?arrow_forwardGiven a sequence of 5 element keys < 23, 26, 16, 38, 27 > for searching task:a) Given the hash function H(k) = (3.k) mod 11, insert the keys above according to its original sequence (from left to right) into a hash table of 11 slots. Indicate the cases of collision if any. b) In case of any collisions found above in a) part, determine the new slot for each collided case using Linear Probing to solve the collision problem. Clearly show your answer for each identified case. No step of calculation required. (Answer with “NO collision found”, in case there is no collisions found above) c) In case of any collisions found above in a) part, determine the new slot for each collided case using Double-Hashing (with functions below) to solve the collision problem. Show your steps and calculations with a table as in our course material. d1 = H(k) = (3.k) mod 11 di = (di−1 + ((5·k) mod 10) + 1) mod 11 , i ≥ 2 (Answer with “NO collision found”, in case there is no collisions found above)…arrow_forwardGiven an n×n matrix M in which every entry is either a 0 or 1. Present an algorithm that determines if ∃i, 1 ≤ i ≤ n, such that M[i, j] = 0 and M[j, i] = 1, ∀j, 1 ≤ j ≤ n ∧ j 6= i, using examining an entry of M as the key operation. Your algorithm must examine at most 3n − ⌊lg n⌋ − 3 entries of M.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_forward7. For a Proof of Termination of your own implementation of the BST delete() algorithm, you would need to: (select all that apply) Group of answer choices: A. Show the algorithm terminates. B. Show the algorithm touches each node at most once. C. Show if a key/value pair exists, the algorithm will find it. D. Show the algorithm is faster or as fast as another delete algorithm.arrow_forwardA hash table with ordered linear probing maintains an order among keys considered during the rehashing process. When the keys are encountered, say, in increasing order, the performance of a failed lookup approaches that of a successful search. Describe how a key might be inserted into the ordered sequence of values that compete for the same initial table entryarrow_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