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