Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
bartleby

Concept explainers

Question
Book Icon
Chapter 11, Problem 1P

(a)

Expert Solution
Check Mark
Program Plan Intro

To determine the longest probe while performing insertion in hash table.

Explanation of Solution

Given Information: The probability of ith insertion in hash table by using uniform hashing is atmost 2-k.

Explanation:

In the uniform hashing, where keys are inserted uniformly in available hashes. Suppose there is an open address hash table and keys are inserted one by one then average probe will be (1/(1-a)), where a is equals to load factor. So, while inserting keys into empty hash table, for the first hash slot, unsuccessful expected number of probe will be

  Pr{Xi}<=αi1 .

Since n<=m/2,α1/2 are given. Putting i=k+1 , in the given equation.

  Pr{Xk+1}(1/2)k+11

So, the at most probability will be Pr{Xk+1}=2k .

(b)

Expert Solution
Check Mark
Program Plan Intro

Show that the ith insertion requires more than 2lg n probe and probability Pr{Xi>2lg n}  in the hash table of size m is = O(1/n2) .

Explanation of Solution

Given Information: An open addressing hash table having size m and contains nm/2 items.

Explanation: From the above section, where the probability of ith insertion of an item in the hash table by using uniform hashing is at most 2-k.

Where k is the no. of probes. Now from the given condition, put the value of probe k is equals to 2 logn.

  =2 k=2 2lg n= ( 2lg n  ) 2=n 2=1/n2 

So, the complexity will be O(1/n2) .

(c)

Expert Solution
Check Mark
Program Plan Intro

To show the asymptotic bounds for the probes required is equals to O(1/n) .

Explanation of Solution

Given Information: For a particular event A, probability of probes required Pr{Ai}1/n2 .

Explanation: For an event A, required probes X>2lg n, and for the ith insertion, required probes for an event Ai, Xi>2log n . From the above explanation, probability of an event Ai for ith insertion is less than or equals to 1/n2.

An event Ai=A1A2A3A4An , where 1in

  Pr(A)Pr(A1)+Pr(A2)+Pr(A3)+Pr(A4)+.+Pr(An) ,

by Boole’s inequality

  n.1/n2=1/n

So, the asymptotic bound for the probe required is equals to O(1/n) .

(d)

Expert Solution
Check Mark
Program Plan Intro

To determine the expected length of the longest probe sequence is O(lg n) .

Explanation of Solution

Given Information: Probability of number of probes required Pr{X=k}, where k is equals to no. of probes.

Explanation:The expected length of the longest probe E[X] can be dependent on the given probability Pr{X=k} . To get the desired outcome, expected length E[X] can be divided in such a way that the total sum would not affected.

  E[X]=k.Pr{X=k}, 1k<n

Here,break the above equation into two parts by using some breaking point, in this case its 2lg n.

  E[X]=k.Pr{X=k} +k.Pr{X=k}, 1k<n

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
You are tasked with developing a portable system that can be worn to collect health and fitness data. The challenge is to integrate all functions into the smaller form of an ear clip. The device should include heart rate, movement and temperature sensor and wireless communication with a mobile app. Draw a diagram- hardware architecture of the system- including the selection of suitable sensors, communication modules, and an energy-efficient microcontroller. (visualize the components and their connections)
Draw out an example of 3 systems using Lamport’s logical clock and explain the steps in words.
"Systems have become very powerful and sophisticated, providing quality information fordecisions that enable the firm to coordinate both internally and externally."With reference to the above statement compare the operations of any three data gatheringsystems today’s organisations use to aid decision making.
Knowledge Booster
Background pattern image
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
    SEE MORE QUESTIONS
    Recommended textbooks for you
    Text book image
    Operations Research : Applications and Algorithms
    Computer Science
    ISBN:9780534380588
    Author:Wayne L. Winston
    Publisher:Brooks Cole
    Text book image
    C++ Programming: From Problem Analysis to Program...
    Computer Science
    ISBN:9781337102087
    Author:D. S. Malik
    Publisher:Cengage Learning
    Text book image
    Fundamentals of Information Systems
    Computer Science
    ISBN:9781305082168
    Author:Ralph Stair, George Reynolds
    Publisher:Cengage Learning
    Text book image
    Programming Logic & Design Comprehensive
    Computer Science
    ISBN:9781337669405
    Author:FARRELL
    Publisher:Cengage