1,088 views
0 votes
0 votes
Suppose that we have a hash table with n slots with collisions resolved by chaining. Suppose that n keys are inserted into the table What is the probability of k keys being mapped to a single slot. Each key is equally likely to be hashed to each slot. Find the probability P(k) that exactly k keys hash into a particular slot is given by-

(A) (1/n)^k * (1- 1/n)^(n-k)

(B) (1/n)^k * (1- 1/n)^(n-k) * nCk

(C) (1/k)^k * (1-1/k)^(n-k) * nCk

(D) None of the above

1 Answer

1 votes
1 votes
Probability that keys being mapped to single slot  = (1/n).

Probability that keys being mapped to remaining (n-1) slots = (n-1) / n .

Therefore ,

given 'k' keys to be mapped to single slot. So we have nCk such combinations, and in these combinations

'k' keys to be mapped to single slot = (1/n)^k and

remaining (n-k) keys to be mapped to remaining (n-1) slots = ((n-1)/n)^(n-k) = (1-1/n)^(n-k) .

So answer is (1/n)^k * (1- 1/n)^(n-k) * nCk. option B.
edited by

Related questions

1 votes
1 votes
0 answers
1
Souvik33 asked Oct 30, 2022
405 views
A hash function h maps 16-bit inputs to 8 bit hash values. What is the largest k such that in any set of 1000 inputs, there are atleast k inputs that h maps to the same h...
0 votes
0 votes
0 answers
2
Souvik33 asked Oct 30, 2022
338 views
A hash function h maps 16-bit inputs to 8 bit hash values. What is the largest k such that in any set of 1000 inputs, there are atleast k inputs that h maps to the same h...
1 votes
1 votes
2 answers
3
dmharoon asked Feb 11, 2015
493 views
1)A2)B3)C4)D
0 votes
0 votes
1 answer
4
tishhaagrawal asked Dec 16, 2023
361 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...