If $S$ is a set consisting of $n$ IID random variables, what is the probability there are $k$ elements smaller than a random element of $S$?

38 Views Asked by At

I think my answer to the following question is nonsense, and I would like to know what I did wrong/a hint in the correct direction. Suppose that $X_1,\dots, X_n$ are sampled IID at random from a distribution with CDF $\Phi$. Let $S = \{ X_1,\dots, X_n\}$. Pick $X\in S$ uniformly at random, and let $K$ be the number of elements smaller than $X$. What is $P(K=k)$?

Here is my attempt. Given $X$, we have $$P(K=k| X) = \binom{n-1}{k}\Phi(X)^k(1-\Phi(X))^{n-1-k}.$$ In particular, assuming $\Phi$ is absolutely continuous, the law of the unconscious statistician yields $$P(K=k) = \binom{n-1}{k}\int_{-\infty}^{\infty} \Phi(x)^k(1-\Phi(x))^{n-1-k}\Phi'(x)\,dx = \binom{n-1}{k}\int_0^1 x^k(1-x)^{n-1-k}\,dx = 1,$$ since the last integral is $B(k+1,n-k)$, where $B$ is the Beta function.

Of course, this calculation is nonsense. So my question is, where did I go wrong, and what is a hint in the correct direction?

1

There are 1 best solutions below

3
On BEST ANSWER

I don't know how you found 1 in your last equality. With $$B(a,b)=\frac{a+b}{ab}\frac{1}{\binom{a+b}{a}}$$ you find $\mathbb P(K=k)=\frac{1}{n}$, which is very logical given the symmetry of the problem.