This project demonstrates the Laplace and Exponential Mechanisms for differential privacy using an adult dataset.
- Global Sensitivity: Calculated as
(max age - min age) / record countfor ages above 25. - Steps:
- Compute average age for ages > 25.
- Determine global sensitivity.
- Calculate variance using sensitivity and epsilon.
- Add Laplace noise to the average age.
- Output the noise-added result.
Higher epsilon values yield more accurate results; lower values increase privacy.
- Global Sensitivity: 1, as adding/removing a record changes one education level.
- Steps:
- Calculate utility scores for education levels.
- Use a scaling factor for large counts.
- Compute probabilities with epsilon and sensitivity.
- Output based on probabilities.
Lower epsilon values increase privacy, altering the most frequent education output.
This project illustrates the balance between privacy and accuracy in differential privacy.