Prove that $\mathbb E [T_n(x) ~ T_n(y)] = nF_X(x) + n(n - 1)F_X(x)F_X(y)$, for $xLet $X_1, \cdots,X_n $ be iid random variables with distribution $F. T_n(x)$ denotes the number of elements $\le x; x \in \mathbb R$. Prove that $\mathbb E [T_n(x) ~ T_n(y)] = nF_X(x) + n(n - 1)F_X(x)F_X(y)$, for $x<y$.
Attempt
Let $j = T_n(y) ,i = T_n(x)$. Then
$\mathbb E [T_n(x) ~ T_n(y)] = \sum_{j = 0}^n ~\sum_{i = 0} ^j ~ ^jC_i~ [F_X(x)]^i [F_X(y) - F_X(x)]^{j-i} \cdot j \cdot i$
$= \sum_{j = 0}^n j \cdot [F_X(y) - F_X(x)]^{j}~~\sum_{i = 0} ^j ~ ^jC_i~ \dfrac {[F_X(x)]^i} {[F_X(y) - F_X(x)]^{i}} \cdot i$
$= \sum_{j = 0}^n j^2 \cdot [F_X(y) - F_X(x)]^{j}~ \dfrac {[F_X(x)]} {[F_X(y) - F_X(x)]} ~~\sum_{i = 0} ^j ~ ^{j-1}C_{i-1}~ \dfrac {[F_X(x)]^{i-1}} {[F_X(y) - F_X(x)]^{i-1}}$
$= \sum_{j = 0}^n j^2 \cdot [F_X(y) - F_X(x)]^{j-1}~ {[F_X(x)]}~\sum_{i = 1} ^j ~ ^{j-1}C_{i-1}~ \dfrac {[F_X(x)]^{i-1}} {[F_X(y) - F_X(x)]^{i-1}}$
$= \sum_{j = 0}^n j^2 \cdot [F_X(y) - F_X(x)]^{j-1}~ {[F_X(x)]}~~\sum_{m = 0} ^{j-1} ~ ^{j-1}C_m~ \dfrac {[F_X(x)]^m} {[F_X(y) - F_X(x)]^m}$
$= \sum_{j = 0}^n j^2 \cdot [F_X(y) - F_X(x)]^{j-1}~ {[F_X(x)]}~\big( \dfrac {[F_X(x)]} {[F_X(y) - F_X(x)]} +1 \big)^{j-1}$
$= \sum_{j = 0}^n j^2 \cdot [F_X(y) - F_X(x)]^{j-1}~ {[F_X(x)]}~\big( \dfrac {[F_X(y)]} {[F_X(y) - F_X(x)]} \big)^{j-1}$
$= \sum_{j = 0}^n j^2 \cdot {[F_X(x)]}~{[F_X(y)]}^{j-1} $
$= \dfrac{F_X(x)}{F_X(y)}\sum_{j = 0}^n j^2 \cdot ~{[F_X(y)]}^{j} $
This doesn't lead to the result being proved. Could someone advise?
 A: I did not understand how you get you first equality. What I see is $$\begin{align*}
E\left[T_n(x)T_n(y)\right] &= \sum_{i,j=1}^ni\,j\,P[T_n(x)=i,\,T_n(y)=j]\\
&= \sum_{i,j=1}^ni\,j\,P[X_{(i)}\leq x,\,X_{(j)}\leq y]
\end{align*}$$ and I don't get the remaining. Maybe there is a problem there.
Answer I propose:
First, you should remark that $T_n(x) = \sum_{i=1}^n \mathbf{1}_{\{X_i\leq x\}}$ and $T_n(y) = \sum_{j=1}^n \mathbf{1}_{\{X_j\leq x\}}$ and $$\begin{align*}
T_n(x)T_n(y) &= \left(\sum_{i=1}^n \mathbf{1}_{\{X_i\leq x\}}\right)\left(\sum_{j=1}^n \mathbf{1}_{\{X_j\leq y\}}\right)\\
&=\sum_{i=1}^n\mathbf{1}_{\{X_i\leq x\}}\sum_{j=1}^n \mathbf{1}_{\{X_j\leq y\}}\\
&=\sum_{i=1}^n\sum_{j=1}^n\mathbf{1}_{\{X_i\leq x\}}\mathbf{1}_{\{X_j\leq y\}}\\
&=\sum_{i=1}^n\mathbf{1}_{\{X_i\leq \min(x,\,y)\}} + \sum_{i,j=1\\j\neq i}^n\mathbf{1}_{\{X_i\leq x\}}\mathbf{1}_{\{X_j\leq y\}}\\
T_n(x)T_n(y)&=\sum_{i=1}^n\mathbf{1}_{\{X_i\leq x\}} + \sum_{i,j=1\\j\neq i}^n\mathbf{1}_{\{X_i\leq x\}}\mathbf{1}_{\{X_j\leq y\}}\\
\end{align*}$$
Then, $$\begin{align*}
E\left[T_n(x)T_n(y)\right] &= E\left[\sum_{i=1}^n\mathbf{1}_{\{X_i\leq x\}}\right] + E\left[\sum_{i,j=1\\j\neq i}^n\mathbf{1}_{\{X_i\leq x\}}\mathbf{1}_{\{X_j\leq y\}}\right]\\
&= \sum_{i=1}^nE\left[\mathbf{1}_{\{X_i\leq x\}}\right] + \sum_{i,j=1\\j\neq i}^nE\left[\mathbf{1}_{\{X_i\leq x\}}\mathbf{1}_{\{X_j\leq y\}}\right]\\
&= \sum_{i=1}^nE\left[\mathbf{1}_{\{X_i\leq x\}}\right] + \sum_{i,j=1\\j\neq i}^nE\left[\mathbf{1}_{\{X_i\leq x\}}\right]E\left[\mathbf{1}_{\{X_j\leq y\}}\right]\\
&= \sum_{i=1}^nP\left[X_i\leq x\right] + \sum_{i,j=1\\j\neq i}^nP\left[X_i\leq x\right]P\left[X_j\leq y\right]\\
&= \sum_{i=1}^nF(x) + \sum_{i,j=1\\j\neq i}^nF(x)F(y)\\
&= nF(x) + n(n-1)F(x)F(y)\\
\end{align*}$$
