learning-it by example

Back to the video

Differential Privacy Basics: Noisy Counts in Python

A made-up count of 412 told a simulated attacker whether one person was in the data.

Video #101 ยท AI security and governance

Steps in the video

  1. 0:00 A count of 412 told an attacker whether Priya was in the data
  2. 0:30 The idea
  3. 1:04 Setup
  4. 1:28 Noise for a count
  5. 1:52 The attacker
  6. 2:16 Asking again
  7. 3:21 What this does not show
  8. 3:53 Mistakes to avoid
  9. 4:23 My take and next steps
  10. 4:51 Recap

Files

  • compare.py (27 lines)
  • dp.py (12 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

One made-up count and one made-up person; a seeded teaching simulation in plain Python against an attacker who knows both possible counts; not noise you should use in production.

Sources

Learning IT by Example.