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
Question
Chapter 11.3, Problem 5E
Program Plan Intro
To show that
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Problem 3: In this problem we assume that elements are drawn from a universal set U.(i) We insert n (different) elements into an empty hash table T of length m. If m = O(n),what is the time complexity of finding the minimal element in a T?(ii) Let |U| = m2 and suppose that collision is solved by chaining. Show that for everyhash function h: U → {0, 1, . . . , m − 1} there exists a sequence of m insertions intoan empty hash table T of length m giving rise a linked list of length m.
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))?
Let 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..
Knowledge Booster
Similar questions
- Let A = {x ∈ Z : x ≤ 3} and let B = {x ∈ Q : x2 = 9}. Is B ⊆ A? Give a brief reason for your answer.arrow_forwardsecurity 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_forwardAlgorithm for Testing MembershipInput : a group G acting on f~ = { 1,2 ..... n };a permutation g of f~ = { 1,2 ..... n };a base and strong ~enerating set for G;Schreier vectors v (i) , 1 < i < k, for the stabiliser chain;Output: a boolean value answer, indicating whether g ~ G;function is_in_group(p : permutation; i : 1..k+l ) : boolean;(* return true if the permutation p is in the group G (i) *)arrow_forward
- code 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_forwardgive set of R(x): x < x^2 where the domain is Zarrow_forwardIt was claimed that:(a, b) ≤ (c, d) ⇔ (a < c) ∨ (a = c ∧ b ≤ d) defines a well-ordering on N x N. Show that this is actually the case.arrow_forward
- Let G = (V,E) be a bipartite graph, but this time it is a weighted graph. The weight of acomplete matching is the sum of the weights of its edges. We are interested in finding aminimum-weight complete matching in G.a) Give a legitimate C for a branch-and-bound (B&B) algorithm that finds a minimum-weightcomplete matching in G, and prove that your C is valid. Your C cannot be just the cost sofar.b) Using your C, apply B&B to find a minimum-weight complete matching in the followingweighted bipartite graph G: A = (1,2,3), B = (4,5,6,7)E = (((1,4), 3]. [(1,5), 4]. [(1,7). 15]. ((2,4), 1]. |(2,5), 8]. [(2,6), 3]. |(3,4), 3]. [(3,5), 9]. [ (3,6). 51).Show the solution tree. the C of every tree node generated, and the optimal solution. Also,mark the order in which each node in the solution tree is visited.arrow_forwardProve that In a hash table in which collisions are resolved by chaining, a successful searchtakes average-case time ‚.1C˛/, under the assumption of simple uniform hashing.arrow_forwardLet X = {l ∈ Z | l = 5a + 2 for some integer a}, Y = {m ∈ Z | m = 4b + 3 for some integer b}, and Z = {n ∈ Z | n = 4c − 1 for some integer c}. Is X ⊆ Y ? Is Y ⊆ Z?arrow_forward
- Prove that, under the assumption of simple uniform hashing, a successful search in a hash table with collisions handled by chaining takes average-case time.1C/.arrow_forwardSuppose we have the following sets: P, Q, and R. Prove or disprove that if for all x, (x ∈ P) → ((x ∈ Q) → (x ∈ R)), then P ⋂ Q ⊆ Rarrow_forwardWrite Algorithm for Testing MembershipInput : a group G acting on f~ = { 1,2 ..... n };a permutation g on ~ = { 1,2 ..... n };a base and strong generating set for G;Schreier vectors v (i) ,1 < i < k, for the stabiliser chain;Similarly a non-re, cursiveOutput : a boolean value answer, indicating whether g ~ G;function is_in_group(p : permutation; i : 1..k+l ) : boolean;(* return true if the permutation p is in the group G (i) *)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