# differentially private release of histograms (non-negative valued queries)

Two practical questions arise when releasing differentially private histograms/counts via addition of Laplace/Gaussian noise:

1) Is the result of noise addition truncated/rounded (since we know that the counts should correspond to natural numbers)?

2) What happens to bins with zero counts? Addition of noise to those (which should take place as per my understanding) might result to a negative result: should this be eventually truncated to zero?

2. There are three possible options. The easiest conceptually is to add noise to each bin, even if it has a zero count (then, you can do whatever post-processing you want). However, that's often not possible, especially if the dataset is sparse: there might be too many bins. In that case, you can either use the method mentioned in maurice's answer, which gives you pure $$\varepsilon$$-differential privacy, but it requires to have a bounded number of bins. Otherwise, you can simply add noise only to non-zero counts and threshold low counts, like what is explained in this blog post — this will give you $$(\varepsilon,\delta)$$-differential privacy, which is a bit worse, but typically acceptable in practice if $$\delta$$ is small enough.