Suppose I have N i.i.d geometric random variables with parameter $p$: $X_1, X_2, \dots, X_N$. I want to know how large the range can often be. I.e. For a fixed significance level $\alpha$, find $\tilde{k} = \operatorname{argmin}_k P(X_{(N)} - X_{(1)} \leq k) \geq 1 - \alpha$, where $X_{(1)} = \min\{X_1, \dots, X_N\}$ and $X_{(N)} = \max\{X_1, \dots, X_N\}$.
What I have so far is that for an arbitrary non-negative integer $k$, $P(X_{(N)} - X_{(1)} = k) = \frac{(1 - (1 - p)^{k + 1})^N}{1 - (1 - p)^N}$. Proof is as follows:
\begin{align*} P(X_{(N)} - X_{(1)} = k) =& \sum_{k_1 = 1}^{\infty} P(k_1 \leq X_{(1)} \leq X_{(N)} \leq k_1 + k)\\ =& \sum_{k_1 = 1}^{\infty} P(k_1 \leq X \leq k_1 + k)^N\\ =& \sum_{k_1 = 0}^{\infty} ((1 - p)^{k_1} - (1 - p)^{k_1 + k + 1})^N\\ =& \sum_{k_1 = 0}^{\infty} (1 - p)^{Nk_1}(1 - (1 - p)^{k + 1})^N\\ =& (1 - (1 - p)^{k + 1})^N \sum_{k_1 = 0}^{\infty} (1 - p)^{Nk_1}\\ =& \frac{(1 - (1 - p)^{k + 1})^N}{1 - (1 - p)^N} \end{align*}
Now that I have already obtained the p.m.f of the range, I also want to find the c.d.f of the range, but I cannot get a compact formula for the c.d.f. Can someone help me solve $\tilde{k}$? If that's not do-able, I would also appreciate it if someone can help me find the expected value of the range. I.e. $E[X_{(N)} - X_{(1)}]$.
Thank you so much!
There are several issues with the solution above. First of all, $P(X_{(N)} - X_{(1)} = k) = \sum_{k_1 = 1}^{\infty} P(k_1 = X_{(1)} \leq X_{(N)} = k_1 + k)$. In fact, we can directly find the c.d.f building on the attempts above: \begin{align*} P(X_{(N)} - X_{(1)} \leq k) =& \sum_{k_1 = 1}^{\infty} P(k_1 = X_{(1)} \leq X_{(N)} \leq k_1 + k)\\ =& \sum_{k_1 = 1}^{\infty} [P(k_1 \leq X_{(1)} \leq X_{(N)} = k_1 + k) - P(k_1 + 1 \leq X_{(1)} \leq X_{(N)} \leq k_1 + k)]\\ =& (1 - (1 - p)^{k + 1})^N \sum_{k_1 = 1}^{\infty} [(1 - p)^{Nk_1} - (1 - p)^{N(k_1 + 1)}]\\ =& (1 - (1 - p)^{k + 1})^N (1 - (1 - p)^N) \sum_{k_1 = 1}^{\infty} (1 - p)^{Nk_1}\\ =& (1 - (1 - p)^{k + 1})^N \end{align*} Hence, we get $\tilde{k} = \left \lceil {\frac{\log[1 - (1 - \alpha)^{\frac{1}{N}}]}{\log[1 - p]} - 1} \right \rceil$