Kim S.

asked • 02/06/21

Probability of collision in a hash table

Hello, I have these 3 short questions that I am not sure how to approach. These are in my Computer Science class, specifically regarding hash table and probability of collision/ non-collision in a hash table. I would really appreciate your help if you can explain step by step how to compute the probability in each case. Thank you so much in advance!


Question 1: Imagine we have a hash table with 10 slots. However, 4 of them are filled already (without any collision). What is the probability that we will have at least 1 collision in the next 2 insertions?


Question 2: Imagine we have a hash table with 10 slots. However, 4 of them are filled already (without any collision). Assuming we use linear probing to resolve collisions, what is the probability that we will have exactly 1 collision in the next 2 insertions?


Question 3: Imagine we have a hash table with 10 slots. However, 4 of them are filled already (without any collision). Assuming we use separate chaining to resolve collisions, what is the probability that we will have exactly 1 collision in the next 2 insertions?

1 Expert Answer

By:

Patrick B. answered • 02/06/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.