The differences betweenTo understand the two-sided geometric (TSG) distribution, I think it helps to contrast it with the "standard" geometric distribution. For the geometric distribution, I will assume the following convention from Wikipedia:
The probability distribution of the number X of Bernoulli trials
needed to get one success, supported on the set { 1, 2, 3, ... }
e.g. In the case of flipping a fair coin, 50% of the time we would expect success ("heads") after 1 trial (coin flip). For a fair coin, where Pr[heads] = Pr[tails] = 0.5, the expected number of trials to flip heads decreases by a factor of 0.5. This constant factor results in a geometric progression.
Note that - for what I am referring to as a "standard" geometric progression - the probability of success after 1 trial is, by definition, the probability that a single trial yields success (50% in the coin-flipping example). Also, note that there is no notion of "success after 0 trials" in the convention that I am referencing.
Now, let's contrast the "standard" geometric distribution with the TSG, as described in Universally Utility-Maximizing Privacy Mechanisms (UUMPM). In UUMPM, the authors introduce the TSG as a method to introduce "discrete noise" to discrete values, as opposed to introducing "continuous noise" via the Laplace distribution. Thus, the TSG is supported on the set of all integers, as opposed to the "standard" geometric distribution, which is only supported on positive integers. In other words, as a noise-generation mechanism, the TSG can randomly introduce 0 noise, negative discrete noise, or positive discrete noise.
In UUMPM, the authors give the probability mass function (PMF) of the TSG as:
$$Pr[ Z = z] = \frac{1-\alpha}{1+\alpha}\alpha^{\left | z \right |}$$
Semantically, this gives the probability of introducing $|z|$ amount of "discrete noise." Note that the TSG decays in the same way that a "standard" geometric distribution decays: for each increment of $z$, either positive or negative, the probability decreases by a factor of $\alpha$.
This leads us to what I would consider the main difference between a TSG and the "standard" geometric distribution are: the probability that the TSG introduces 0 noise.
- The samples/results can include 0 and negative numbers, and
- the "probability of staying at 0" is calculated differently than the other integers.
Note that, when $z = 0$, the PMF for the TSG becomes:
$$Pr[ Z = z] = \frac{1-\alpha}{1+\alpha}$$
The Python codeAs a concrete example, let's assume we have a TSG that "decays like" the coin-flipping example above (belowi.e $\alpha = 0.5$). This yields:
$$Pr[ Z = 0 | \alpha = 0.5] = \frac{1-0.5}{1+0.5}0.5^{\left | 0 \right |} = \frac{0.5}{1.5} = 33.\overline{3}\%$$
Thus, for a TSG that decays with $\alpha = 0.5$, we have a $33.\overline{3}\%$ chance of introducing 0 noise. From this "starting base" of $33.\overline{3}\%$, the probability of introducing a certain amount of discrete noise decreases by a factor of 0.5, in both the positive and negative directions. e.g. $Pr[Z = -1] = Pr[Z = 1] = 16.\overline{6}\%$, etc.
Again, contrast this result for the TSG with the example of coin-flipping with a "standard" geometric distribution. Although both of the distributions I described decay with a ratio of 0.5, the TSG "started at" 0 with $33.\overline{3}\%$ probability, whereas the "standard" geometric distribution "started at 1" with $50\%$ probability.
For anyone interested in sampling from the two-sided geometric distribution, here is some Python code I wrote that implements Example 2.1 from the OP's linkUUMPM. Specifically, given the probability mass functionPMF for a two-sided geometric distribution: $$Pr[ Z = z] = \frac{1-\alpha}{1+\alpha}\alpha^{\left | z \right |}$$