I'm aware that the title might be a bit off, I am unsure on how to describe this.
For $n\in \mathbb{N}$, define $n+1$ independent random variables $X_0, \ldots , X_n$ which are uniformly distributed over the interval $[0,1]$, We focus on this group:$$S=\{X_i|i\geq 1 , X_i<X_0\}$$ For all $0\leq k\leq n$, show that: $$P(|S|=k)=\int_0^1 {n\choose k}\cdot x^k\cdot (1-x)^{n-k}$$
I've reduced this to the following: $$P(|S|=k)=P(exactly \ k \ elements\ are\ bigger\ than\ X_0)$$ Due to independence, we can write: $$=P(X_0 <X_i)\cdot \ \ldots \ \cdot P(X_0<X_{i+k}) , i\in\{1, \ldots ,n-k\}$$
I'm stuck here, cant find how to calculate $P(X_0<X_i)$, which prevents me from proving the statement.
I'm aware that $n\choose k$ is because we're 'checking' every k-sized group out of the n available R.Vs,
$x^k%$ which translates to $P(X_0<X_{i\rightarrow (i+k)})$ and $(1-x)^{n-k}$ to 'disable' the other R.Vs from being bigger than $X_0$
The random variables $Y_\ell=\mathbf{1}_{[0,X_0)}(X_\ell),\,1\leq \ell \leq n$ indicate if $X_\ell<X_0$. Then by total expectation: $$P(|S|=k)=E\bigg[P\bigg(\sum_{1\leq \ell \leq n}Y_\ell=k\bigg|X_0\bigg)\bigg]=\int_{[0,1]}\underbrace{\binom{n}{k}x^{k}(1-x)^{n-k}}_{P(\sum_{1\leq \ell \leq n}Y_\ell=k|X_0=x)}dx$$
To see that $P(\sum_{1\leq \ell \leq n}Y_\ell=k|X_0=x)=\binom{n}{k}x^{k}(1-x)^{n-k}$, recall that if $W,Z$ are independent, then $E[f(W,Z)|W]=E[f(w,Z)]|_{w=W}$ for admissible $f$ by this result. In our case, $Z=(X_1,...,X_n)$, $W=X_0$ and $f(w,z)=\mathbf{1}_{\{k\}}(\sum_{1\leq \ell \leq n}\mathbf{1}_{[0,w]}(z_\ell))$. So $$E\bigg[\mathbf{1}_{\{k\}}\bigg(\sum_{1\leq \ell \leq n}\mathbf{1}_{[0,x]}(X_\ell)\bigg)\bigg]=P\bigg(\sum_{1\leq \ell \leq n}\mathbf{1}_{[0,x]}(X_\ell)=k\bigg)=\binom{n}{k}x^k(1-x)^{n-k}$$ Because $\mathbf{1}_{[0,x]}(X_\ell)$ are independent Bernoulli rvs with probability of success $x$.