Enrolled resident Not enrolled Noisy releases (histogram) True count

Differential Privacy: Releasing a Government Statistic Safely

Government agencies routinely need to publish aggregate statistics — how many residents use a service, how many households qualify for a program — without exposing any single person's record. This simulator implements the real Laplace mechanism from differential privacy: it takes the true count of "enrolled" dots in a synthetic district, adds noise drawn honestly from a Laplace distribution scaled by the privacy budget ε, and releases the noisy result. Run hundreds of releases at once to see the empirical accuracy-vs-privacy tradeoff computed from real repeated random sampling — tighten ε for a more useful number, loosen it for stronger protection, and watch the mean absolute error and the histogram spread respond exactly as the theory predicts.