Premium problem85. Hash Collision

Medium Locked

Hash n distinct objects independently and uniformly into m buckets. Return the probability that at least two land in the same bucket.

Exactly the birthday problem wearing different clothes, which is why hash tables start colliding much sooner than the bucket count suggests.

Input

n = 100
m = 10000

Output

0.3914340350427218

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)