5,775 views
3 votes
3 votes

Given a hash table with n keys and m slots, with the simple uniform hashing assumption (each key is equally likely to be hashed into each slot). Collisions are resolved by chaining.

(a) What is the probability that the first slot ends up empty?

(b) What is the expected number of slots that end up not being empty?

2 Answers

1 votes
1 votes

A) What is the probability that the first slot ends up empty?

ans:-       => 1 -(probability of filled up first slot)

              $  => 1 - (1/m)$

for n element  :-      $[1-(1/m)] ^ n$

B) What is the expected number of slots that end up not being empty?

ans:- suppose expected number of slots are L

then, 

Probability to fill 1 slots = $[ 1- (1/m) ] ^ n$ 

               for L slot    =>   $L* [  { 1-(1/m) }^n ]$

 

edited by
0 votes
0 votes
how u calculated expected number

Related questions

0 votes
0 votes
1 answer
1
tishhaagrawal asked Dec 16, 2023
354 views
Below is my approach to solving this question, can anyone please explain if I am doing it the right way?Let X = #free slotssince, m =7 and n = 3So, $4 \leqslant x\leqsla...
0 votes
0 votes
1 answer
3
anurag_am asked May 27, 2015
1,337 views
why in a hash table in which collisions are resolved by a chaining , a successful search takes average- case time ⊖(1+load factor) ,under the assumption of simple unifo...