# Calibrating the Attack to Sensitivity in Differentially Private Mechanisms
## 3 Adversarial Classification in Laplace Mechanisms
### One-Sided Test
\begin{cases}\frac{1}{\theta}\exp\left\{\frac{\epsilon}{\theta s} (z(1-\theta)+\theta\mu_{0}-\mu_{1})\right\}&\text{if }z<\mu_{1}\\ \frac{1}{\theta}\exp\left\{-\frac{\epsilon}{\theta s}(z(1+\theta)-\theta\mu_ {0}-\mu_{1})\right\}&\text{if }z\in[\mu_{1},\mu_{0}]\\ \frac{1}{\theta}\exp\left\{-\frac{\epsilon}{\theta s}(z(1-\theta)+\theta\mu_ {0}-\mu_{1})\right\}&\text{if }z\geq\mu_{0}\end{cases}  \tag{15}\]  
Equivalently, \(\Lambda_{I}\) is confined in the interval  
\[\bigg{[}\frac{1}{\theta}\exp\Bigl{\{}-\frac{\epsilon}{\theta s}(z(1-\theta)+ \theta\mu_{0}-\mu_{1})\Bigr{\}},\frac{1}{\theta}\exp\Bigl{\{}\frac{\epsilon} {\theta s}(z(1-\theta)+\theta\mu_{0}-\mu_{1})\Bigr{\}}\bigg{]}.\]  
On the other hand, for \(\mu_{1}>\mu_{0}\), the corresponding likelihood ratio for the hypotheses in (7) yields  
\[\Lambda_{II}= \begin{cases}\frac{1}{\theta}\exp\left\{\frac{\epsilon}{\theta s} (z(1-\theta)+\theta\mu_{0}-\mu_{1})\right\}&\text{if }z<\mu_{0}\\ \frac{1}{\theta}\exp\left\{\frac{\epsilon}{\theta s}(z(1+\theta)-\theta\mu_{0} -\mu_{1})\right\}&\text{if }z\in[\mu_{0},\mu_{1}]\\ \frac{1}{\theta}\exp\left\{-\frac{\epsilon}{\theta s}(z(1-\theta)+\theta\mu_ {0}-\mu_{1})\right\}&\text{if }z\geq\mu_{1}\end{cases}  \tag{16}\]To be able to determine a threshold for deciding between the hypotheses in (7), we compute the false alarm rate \(\alpha\) and the mis-detection error \(\beta\) (and the power of the test, that is \(1-\beta\)) applying the Neyman-Pearson lemma that guarantees maximizing the power of the hypothesis test for a given false alarm rate \(\alpha\). Derivation of \(\alpha\):  
Based on the definition in (9), for \(\Delta\mu>0\) the probability of raising a false-alarm is derived by integrating the following probability distribution over the critical region  
\[\alpha =\Pr[H_{0}\text{ reject}|H_{0}\text{ is true}] \tag{17}\] \[=\int_{k}^{\infty}\frac{\epsilon}{2s}\exp\Bigl{\{}-\frac{ \epsilon|z-\mu_{0}|}{s}\Bigr{\}}dz, \tag{18}\]  
which is further expanded out in two possible ways. First for \(k<\mu_{0}\), we get  
\[\alpha =1-\int_{-\infty}^{k}\frac{\epsilon}{2s}\exp\Bigl{\{}\frac{ \epsilon}{s}(z-\mu_{0})\Bigr{\}}dz \tag{19}\] \[=1-\frac{1}{2}\exp\Bigl{\{}\frac{\epsilon}{s}(k-\mu_{0})\Bigr{\}} \tag{20}\]  
Second, we have for \(k\geq\mu_{0}\)  
\[\alpha =\int_{k}^{\infty}\frac{\epsilon}{2s}\exp\Bigl{\{}-\frac{ \epsilon}{s}(z-\mu_{0})\Bigr{\}}dz \tag{21}\] \[=\frac{1}{2}\exp\Bigl{\{}-\frac{\epsilon}{s}(k-\mu_{0})\Bigr{\}} \tag{22}\]  
Rewriting (20) and (22) as an equality for \(k\), we obtain the piecewise function (12) as the threshold in Theorem 3 as a function of \(\alpha\). If the bias induced by the adversary is negative, i.e., \(\Delta\mu<0\), then the conditions to obtain (20) and (22) are swapped. For \(\Delta\mu<0\) and \(k<\mu_{0}\), we get (22) for the probability of false-alarm. How to determine \(\kappa\)? :  
According to the piecewise expansions of likelihood ratio functions in (16) and (15) respectively for \(\Delta\mu<0\) and \(\Delta\mu>0\), we have the intervals for \(\kappa\) given by (23) and (24) on top of the next page since \(\Lambda\underset{H_{1}}{\overset{H_{0}}{\lessapprox}}\kappa\).