Hash function distribution

  Kiến thức lập trình

Hey considering an Hash function f(x), that distribute evenly, 1/m, for array size m.

Why the probability of two element when x1!=x2, to collide meaning f(x1)=f(x2) is 1/m and not 1/m^2 ?

my calculation was 1/m * 1/m because I thought f(x1) probability to get to cell y is 1/m and also for f(x2)

therefore combining them is by multiplication.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT