• retagged by
3,033 views
1 1 vote
Suppose you have a hash table that can hold $100$ elements. It currently stores $30$ elements (in one of $30$ possible different locations in the hash table).  The probability that your next two inserts will cause at least one collision is  ( by assuming a totally random hash function)   __________

2 Answers

Best answer
8 8 votes

Second Method to solve this problem :-
3 cases are possible when we insert 2 elements in hash table

Case 1- Collision on First insertion and Not Collision on Second Insertion

            P(case-1) = (30/100)* (69/100) = 0.207

Case 2- Not Collision on First insertion and Collision on Second Insertion

            P(case-2) = (70/100)* (31/100) =0.217

Case 3- Collision on both First insertion and Second Insertion

       P(case-3) = (30/100)*(31/100) = 0.093

Finally,

 Required Probability = P(Case-1) or P(Case-2) or P(Case-3)

                              =0.207 + 0.217 + 0.093 = 0.517

Note - This method is only efficient when number of insertion is less.

• selected by
5 5 votes
1-p0 = 1- (70/100 * 69/100 )
Answer:
Position:
Show:

Related questions

61 61 votes
5 answers 5 answers
25.4k
25.4k views
Arjun asked Feb 12, 2020
25,418 views
Consider a double hashing scheme in which the primary hash function is $h_1(k)= k \text{ mod } 23$, and the secondary hash function is $h_2(k)=1+(k \text{ mod } 19)$. Ass...
2 2 votes
1 answers 1 answer
4.9k
4.9k views
Bikram asked Nov 26, 2016
4,905 views
Suppose you have the following set of keys to insert into a hash table that can hold $11$ values. $113, 117, 97, 100, 114, 108, 116, 105, 99$. Which of the following bes...
1 1 vote
1 answers 1 answer
1.4k
1.4k views
Bikram asked Nov 26, 2016
1,387 views
Following keys have to be inserted in exact order into the hash table with $9$ slots.$5, 28, 19, 15, 20, 33, 12, 17, 10$The auxiliary hash functions is $h(k)=K$ mod table...
1 1 vote
1 answers 1 answer
1.2k
1.2k views
Bikram asked Nov 26, 2016
1,170 views
If memory is limited and the entire dictionary cannot be stored in a hash table, we can still get an efficient algorithm that almost always works. We declare an array H_T...