Probability that two consecutively generated integers with normal distribution are the same

303 Views Asked by At

Given a random number generator that generates numbers $x\in\mathbb{R}$ with a normal probability distribution, with mean $\mu$ and standard deviation $\sigma$, and then rounds these numbers to the closest integer $y=\lfloor x+\frac{1}{2}\rfloor$.

I'd like to know if there's a way (other than simulation) to calculate the probability that two consecutive values generated by the generator are the same?

For example, if $\mu = 100.0$, $\sigma = 50.0$ and $y = 123$, what's the probability of this occurrence?

That is to say, what's the combined probability of two two consecutively generated raw numbers of the generator to be in the range $[y-\frac{1}{2},y+\frac{1}{2})$?

I'm guessing something like $(\Phi(y-\frac{1}{2})-\Phi(y+\frac{1}{2}))^2$ or a scaled version thereof?

1

There are 1 best solutions below

2
On BEST ANSWER

As others have stated in the comments, since the Normal distribution is continuous it will almost surely not return an integer value.

I will answer your question in the context of a general discrete random variable $X$ taking values in $\mathbb Z$ with

$$\mathbf P[X = x] = p_x.$$

We can use the law of total probability to find the probability of two consecutive independent samples $X_1,\,X_2$ taking the same value:

\begin{align*} \mathbf P[X_1 = X_2] & = \sum_{x} \mathbf P[X_1 = X_2 \, | \, X_1 = x] \mathbf P[X_1 = x] \\ & = \sum_{x} \mathbf P[X_2 = x \, | \, X_1 = x] \mathbf P[X_1 = x] \\ & = \sum_x \mathbf P[X_2 = x] \mathbf P[X_1 = x] \\ & = \sum_x p_x^2. \end{align*}

In general one would not expect this to series to admit a particularly pleasant closed formula.


Example

For instance if we consider the case that $X$ is Poisson distributed

$$\mathbf P[X = x] = e^{-\lambda} \frac{\lambda^x}{x!},$$

then we have

$$\mathbf P[X_1 = X_2] = e^{-2\lambda} \sum_{x} \frac{\lambda^{2x}}{(\lambda!)^2} = e^{-2\lambda} I_0(2\lambda),$$ where $I_0$ is a modified Bessel function of the first kind.


Update

Since my original answer the question has been updated to clarify that the distribution of interest is

$$ Y = \textstyle{\lfloor X + \frac12 \rfloor},$$

where $X \sim N(\mu,\sigma^2)$. We have for $y \in \mathbb Z$

\begin{align*} p_y &= \mathbf P[Y = y] \\ & = \int_{y}^{y+1} \frac{1}{\sqrt{2 \pi \sigma^2} } \exp \left( - \frac{(x - \mu)^2}{2 \sigma^2} \right) dx \\ & = \Phi \left( \frac{y+1 - \mu}{\sigma} \right) - \Phi \left( \frac{y - \mu}{\sigma} \right). \end{align*}

Hence we have an expression for the probability that two independent samples are equal

$$ \mathbf P[Y_1 = Y_2] = \sum_{y} \bigg( \Phi \left( \frac{y+1 - \mu}{\sigma} \right) - \Phi \left( \frac{y - \mu}{\sigma} \right) \bigg)^2. $$

As remarked above, I would not expect this to admit a simple closed form.