Empty bucket Hash landed here Collision!
Empirical histogram (this N) Exact theoretical PMF

Birthday Attack: Hash Collision Distribution (2D)

This 2D companion to the 3D birthday-attack simulator drives the same underlying process — dropping random "hash" draws into N uniformly-random buckets until two land in the same one — but computes and displays a genuinely different piece of math. Instead of a rotating 3D cube and a continuous approximation formula, it lays the hash space out as a flat grid and, every time a run finds its collision, records the exact sample count k into a running histogram. That histogram is plotted live against the exact discrete birthday-paradox probability mass function, computed by direct recurrence rather than the usual exponential approximation, so you can watch empirical frequency across dozens of completed attack runs converge onto the closed-form curve in real time. Adjust the bit-width to grow or shrink the hash space and compare how quickly the empirical distribution locks onto the theoretical one at each size.