Suppose that we have i.i.d. random variables $X_1,...,X_n$ with the CDF $F$ such that $\forall a \in \mathbb{R}~ \mathbb{P}(X_i=a) = 0$.
I wanted to find the joint CDF of the $X_{(1)}, X_{(2)}, X_{(n)}$ which are the order statistics :
$X_{(1)} = \min(\{X_1,...,X_n\}),$ $X_{(2)} = \min(\{X_1,...,X_n\}\setminus\{X_{(1)}\}),$ $X_{(n)} = \max(\{X_1,...,X_n\}).$
I did it as follows :
$$F_{(X_{(1)}, X_{(2)}, X_{(n)})}(x_1,x_2,x_n) = F_{(X_{(1)},X_{(n)})}(x_1,x_n) - \mathbb{P}(X_{(1)} \leq x_1, X_{(2)} > x_2, X_{(n)} \leq x_n)$$
I've already found the $F_{(X_{(1)},X_{(n)})}(x_1,x_n)$ so I only need to find $\mathbb{P}(X_{(1)} \leq x_1, X_{(2)} > x_2, X_{(n)} \leq x_n)$.
For $x_2 < x_n$, we have :
$$\mathbb{P}(X_{(1)} \leq x_1, X_{(2)} > x_2, X_{(n)} \leq x_n) = \\\\ = \mathbb{P}(x_1 \leq X_1 \leq x_n,..., x_1 \leq X_n \leq x_n, X_{(2)} > x_2) = \sum\limits_{i=2}^{n}\mathbb{P}(x_1 \leq X_1 \leq x_n,..., x_1 \leq X_n \leq x_n, X_{j_1} > x_2,...,X_{j_i} > x_2, X_{j_{i+1}} \leq x_2,...,X_{j_{n}} \leq x_2) = \sum\limits_{i=2}^{n}{n \choose i}\left[\mathbb{P}(x_1 \leq X_1 \leq x_n)\right]^n\cdot\left[\mathbb{P}(X_1 > x_2)\right]^i\cdot\mathbb{P}(X_1 \leq x_2)^{n-i} = \\\\ = \sum\limits_{i=2}^{n}{n \choose i}\left(F(x_n)-F(x_1)\right)^n\left(1-F(x_2)\right)^i\left(F(x_2)\right)^{n-i}$$
Is my derivation of the $\mathbb{P}(X_{(1)} \leq x_1, X_{(2)} > x_2, X_{(n)} \leq x_n)$ right and is the answer correct?
I used the same method as I used to find $F_{(X_{(1)},X_{(n)})}(x_1,x_n)$ and wanted to generalize it to find $F_{(X_{(1)}, X_{(2)},..., X_{(n)})}(x_1,x_2,...,x_n)$. I understand that it's not the most elegant way to do it but I need to know if my intuition about it's right. I've already understood what to use this method even to find $F_{(X_{(1)}, X_{(2)}, X_{(3)}, X_{(n)})}(x_1,x_2,x_3, x_n)$ will be so painful but I want to know does it work at least in the case of the three order statistics.