# Given a distribution to generate a set of numbers, what is probability of generating two consecutive numbers whose difference is greater than k?

Suppose I am generating a set of numbers {$x_1$, $x_2$, $x_3$ ... $x_n$} from a given probability distribution $f(x)$. Is it possible to calculate the probability of finding $x_{i+1}-x_i \geq k$, where $k$ is a given constant? If so, how to approach?

What would be the joint probability of finding $x_{i+1}-x_i \geq k$ and $x_{i-1}-x_i \geq k$?

Suppose $X$ and $Y$ are two independent random variables which follow a distribution with density $f(x)$. Then you can find the density of the random variable $X-Y$. Then you only need to find $P(X-Y\geq k)$ by integrating this density from $k$ to $\infty$.

Similarly when you have three independent identically distributed random variables $X,Y,Z$, you can find the joint density of $(X-Y,Y-Z)$.