11.2k views
3 votes
Consider a hash table with 100 slots. collisions are resolved using chaining. assuming simple uniform hashing, what is the probability that the first 3 slots are unfilled after the first 3 insertions?

A. (97 x 97 x 97)/1000000
B.(99 x 98 x 97)/1000000
C.(97 x 96 x 95)/1000000
D.(97 x 96 x 95)/(3! x 1000000)

1 Answer

3 votes

Final answer:

To calculate the probability that the first 3 slots are unfilled after the first 3 insertions in a hash table with 100 slots using chaining and assuming simple uniform hashing, we need to determine the probability that each of the first 3 insertions goes into one of the remaining unfilled slots. The probability is approximately 0.0941094. The correct answer is option A. (97 x 97 x 97)/1000000

Step-by-step explanation:

To calculate the probability that the first 3 slots are unfilled after the first 3 insertions in a hash table with 100 slots using chaining and assuming simple uniform hashing, we need to determine the probability that each of the first 3 insertions goes into one of the remaining unfilled slots. Since collisions are resolved using chaining, we can assume that each insertion will go into a different slot as long as the previous slots are already filled.

After the first insertion, there are 100 slots available and 1 filled slot. So, the probability that the second insertion goes into an unfilled slot is 99/100. After the second insertion, there are 2 filled slots and 98 unfilled slots available, so the probability that the third insertion goes into an unfilled slot is 98/100.

Therefore, the probability that the first 3 slots are unfilled after the first 3 insertions is (99/100) x (98/100) x (97/100) = 0.941094 or approximately 0.0941094.

User Moshi
by
8.1k points