Let's suppose that $X, X\_1, X\_2, \ldots, X\_n$ are i.i.d. continuous random variables.

Let's define $D\_i$ as the difference between $X\_i$ and $X$:
$$
D\_i = X\_i - X
$$

My end goal is to derive the distribution of:
$$
\sum\_{i=1}^{n} I\_{D\_i < 0}
$$

Since the $X\_i$ and $X$ follow the same distribution, the $D\_i$ should be identically distributed. It should also hold that the $D\_i$ are symmetric about zero. From there, the indicators follow the Bernoulli distribution with the success probability equal to $\frac{1}{2}$.

If the indicators were independent, the sum would follow the binomial distribution with parameters $n$ and $\frac{1}{2}$.

However, I'm not sure about independence.

On one hand, since the $X\_i$ are independent, knowing that $D\_i < 0$ shouldn't change the probability that other differences are lower than zero.

On the other, I subtract the same $X$ from all the $X\_i$. So, there is some sort of dependence there. I'm not sure if it implies the indicators aren't statistically independent.