GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
79 views
How do i prove that : : : In hashing n items into a hash table with k locations, the expected number of collisions is $n - k + k( 1-\frac{1}{k})^n$ ??
asked in Algorithms by Boss (8.3k points)   | 79 views
u can take a manual example of "k " and "n" and perform the algo.. u will get it
I  don't understand.
Please provide a manual example

1 Answer

+3 votes
We have n items to insert and size of hash table of is K .

so the probability A location is empty after first insertion =  (1-probabilty of filling that location)=(1-(1/k))

so probability of A location is empty after n insertion = (1-(1/k))^n

Possible no of empty location  = k*(1-(1/k))^n

Expected No of collision = n - occupied location

                                    = n - (total location - empty location)

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

                                    =n- k + k*(1-1/k)^n
answered by Loyal (3.1k points)  
@correct
Can you tell me when to use this

expected number of collision = n(n-1)/2m
How is it true:

"Expected No of collision = n - occupied location"

Please explain how to understand this.

Should it not be "Expected No of collision = n - insertions into previously empty positions"?
Top Users Jan 2017
  1. Debashish Deka

    8126 Points

  2. sudsho

    5042 Points

  3. Habibkhan

    4706 Points

  4. Vijay Thakur

    4458 Points

  5. Bikram

    4348 Points

  6. saurabh rai

    4212 Points

  7. Arjun

    4010 Points

  8. santhoshdevulapally

    3722 Points

  9. GateSet

    3292 Points

  10. Sushant Gokhale

    3286 Points

Monthly Topper: Rs. 500 gift card

19,122 questions
24,034 answers
52,724 comments
20,276 users