The probability of placing them at different place so than collision does not occur at all is P :
P = (m/m )* (m-1 / m) * ((m-2)/m) * ((m-3)/m)
The probability of getting collision and hence a chain of 2 , 3 , 4 is = 1 -P
From 1-P we have to eliminate the chain of length 2 :
Case 1 : Three elements are placed in different place and one collides with any three of them (Q)
Q = (m/m) * ((m-1)/m) * ((m-2)/m) * (1/m) * 3
Case 2 : out of 4 elements there is chain of length 2 ,2 (R)
R = (m/m) * 1/m * (m-1)/m * 1/m + m/m * (m-1) / m * 1/m * 1/m ( It collides with first key and then with second key) + m/m * (m-1)/m * 1/m * 1/m ( it collides with second key first than with first key )
Therefore i think the ans will be 1-(P+Q+R) .