# Differential Privacy

Differential privacy is a property of randomized functions that take a database as input, and returns an aggregate output. It is a quantitative notion of privacy that bounds how much a single individual's private data can contribute to the output.&#x20;

Informally, a function is differentially private if changing any single row in the input database results in almost no change in the output.

Formally, for any two databases d1 and d2 that differ only in a single row, we say that f is ϵ-differentially private if, for any set of outputs$$R$$&#x20;

![](/files/-M3-4i_GRYHcZgaFwEuS)

In other words, a change in a single row results in at most a multiplicative change of $$e^{\epsilon}$$ in the probability of any output, or set of outputs.&#x20;

The standard method for achieving differential privacy for numeric queries is the **Laplace mechanism**, which involves two steps:&#x20;

* Calculate the sensitivity,$$s$$, of the query, which is how much the un-noised output can change based on a change to a single row. For example, if you want to release the average rating of a movie and the rating range from -10 to 10. Then, the sensitivity is 20.&#x20;
* Add noise drawn from a Laplace distribution with scale parameter $$s/\epsilon$$&#x20;

This results in ϵ-differential privacy.

![PDF of ](/files/-M3-8pDOU-KJrPbMmbbZ)

The scale $$s/\epsilon$$ of the Laplace distribution controls its spread: the distribution is wider for more sensitive functions (larger$$s$$) or stronger privacy guarantees (smaller$$\epsilon$$), giving a higher probability of adding more noise.&#x20;

Check [this](https://desfontain.es/privacy/differential-privacy-in-practice.html) link for a concrete example.

Reference:  Honeycrisp: Large-Scale Differentially Private Aggregation Without a Trusted Core - Roth et al., SOSP' 19


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xzhu0027.gitbook.io/blog/security-privacy/untitled/differential-privacy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
