Order statistics: probability that one statistic is larger than the other; two sets of data drawn from a uniform distribution I'll preface the question quickly by saying that I think I already have an answer, however, I'm looking to solve the question in a specific way, and I'm not sure how to. (Unfortunately, I'm finding my memory of probability and statistics lacking at the moment, and using Google/Wikipedia has been a bit overwhelming so far.)
The problem I am working with is this: I have a uniform distribution from 0 to 1, and I draw from the distribution 7 times, to get $X_1, X_2, ..., X_7$ iid. I then draw from that same distribution again, to get $Y_1, Y_2$ iid.
What I'm interested in is: how often is it that, of the $X$'s that I drew, the third smallest $X$ is larger then the largest $Y$? Essentially, I'm trying to solve for P($X_{(3)}>Y_{(2)}$).
I'm pretty sure that this probability is equal to $\frac{1}{6}$, because I thought about it as a list of x,x,x,x,x,x,x and y,y, and I believe the probability should be equal to fitting the two y's into the last four slots of the list. There are 4 choose 2 ways to do that, out of 9 choose 2 total list combinations, which leads to the $\frac{1}{6}$ value.
However, I'm interested in solving for P($X_{(3)}>Y_{(2)}$) specifically using a method where I find the probability density functions of the order statistics. The reason I want to do it this way is because I'm further interested in cases where X and Y are drawn from distributions other than the uniform one, or cases where X and Y are drawn from different distributions. I figure applying the straightforward "n choose k" formulas will only help solve the cases where each list combination is equally likely (but please correct me if I'm thinking about this wrong.)
Going back to P($X_{(3)}>Y_{(2)}$), I believe as a start I would want to modify the expression to be P($X_{(3)} - Y_{(2)} > 0$), but after that I start struggling a bit. Figured I would float it to StackExchange while I try to reason it out on my side.
Thanks everyone for the help. Please correct me if I'm committed any math sins anywhere!
 A: We first observe that $X_{(3)}$ and $Y_{(2)}$ are independent.  The distribution of $Y_{(2)}$ is easy to find:  $$\Pr[Y_{(2)} \le y] = \Pr[(Y_1 \le y) \cap (Y_2 \le y)] = \Pr[Y \le y]^2 = y^2,$$ for $0 \le y \le 1$.  This is because the maximum of $Y_1, Y_2$ is at most $y$ if and only if $Y_1$ and $Y_2$ are both at most $y$.  Then because $Y_1, Y_2$ are iid, it follows that this probability is just the square of the CDF of a uniform random variable on $(0,1)$.  Hence the density of $Y_{(2)}$ is $$f_{Y_{(2)}}(y) = 2y \, \mathbb 1(0 \le y \le 1).$$
To get the density of $X_{(3)}$, we have to be a bit more clever, since $\Pr[X_{(3)} \le x]$ is the probability that at least three of the $X_i$ are at most $x$, and by extension, no more than four of the $X_i$ are greater than $x$.  If this is a bit difficult to conceptualize, here is an example.  Suppose $x = 0.4$.  Our sample could be $$(0.1, 0.7, 0.5, 0.2, 0.2, 0.3, 0.6).$$  In this case, there are $4$ observations that do not exceed $0.4$, meaning that the third smallest observation, $X_{(3)} = 0.2$, does not exceed $0.4$.  In fact, the fourth smallest is also less than $0.4$, but this is allowed, because the case where the third smallest observation is at most $0.4$ includes all other cases where larger observations can also be at most $0.4$.  What is not allowed is if the third smallest observation exceeds $0.4$, e.g., $$(0.2, 0.4, 0.7, 0.8, 0.6, 0.5, 0.6),$$ hence $X_{(3)} = 0.5 > 0.4$.
Clearly then, we must split the desired probability into cases where there are $j$ observations not exceeding $x$, for each $j \in \{3, 4, 5, 6, 7\}$.  Since $X_i$ are iid, there are $\binom{7}{j}$ ways to choose the $j$ indices that correspond to the $X_i$s that are at most $x$; i.e., it is a bit like a binomial probability:
$$\Pr[X_{(3)} \le x] = \sum_{j=3}^7 \binom{7}{j} (F_X(x))^j (1 - F_X(x))^{7-j},$$ where $F_X = x$ is again the uniform distribution on $(0,1)$.  This gives us $$\Pr[X_{(3)} \le x] = \sum_{j=3}^7 \binom{7}{j} x^j (1-x)^{7-j} = x^3 \left(15 x^4-70 x^3+126 x^2-105 x+35\right),$$ and differentiating to get the density, $$f_{X_{(3)}}(x) = 105x^2 (1-x)^4 \, \mathbb 1(0 \le x \le 1).$$
Now we are finally prepared to compute the desired probability:  $$\Pr[X_{(3)} > Y_{(2)}] = \int_{x=0}^1 \Pr[x > Y_{(2)}]f_X(x) \, dx = \int_{x=0}^1 x^2 \cdot 105x^2 (1-x)^4 \, dx = \frac{1}{6},$$ as claimed.
