An observable $x$ follows a uniform distribution U([0,m]), where $m$ is a known parameter. Given $N$ independent observation, we retain only the two highest values among the N observations (let's call them $x_1$ and $x_2$). My goal is to determine the joint probability distribution $P(x_1,x_2)$ of $x_1$ and $x_2$. I am aware that according to the definition, I can express this joint probability as \begin{equation} P(x_1,x_2)=P(x_1)P(x_2|x_1)=P(x_2)P(x_1|x_2), \end{equation} where
- $P(x_1)=\frac{N}{m^N}x_1^{N-1}$ is the probability of extracting the highest value,
- $P(x_2)=\frac{N(N-1)}{m^N}x_2^{N-2}(m-x_2)$ is the probability of extracting the second highest value,
- $P(x_1|x_2)$ or $P(x_2|x_1)$ are the conditional probabilities.
How can I determine these two conditional probabilities? Alternatively, is there a more effective method to calculate this joint probability?
Firstly, one should properly formulate the problem. Let $Y_{1},...,Y_{N}$ be iid uniform$[0,m]$ random variables.
Let $X_{1},...,X_{N}$ be the $Y_{i}$'s arranged in ascending order. (These are called the ordered statistics btw).
Firstly notice that the joint pdf of $Y1,...,Y_{N}$ is given by $f(y_{1},...,y_{N})=\displaystyle\frac{1}{m^{N}}\,,y_{i}\in[0,m]$
But see that for each permutation of $y_{1},...,y_{N}$ say $(y_{\sigma(1)},...,y_{\sigma_{N}})$ if $Y_{1}=y_{\sigma(1)},...Y_{N}=y_{\sigma(N)}$, then too you have that $X_{1}=y_{\sigma_{0}(1)},...,X_{N}=y_{\sigma_{0}(N)}$ where $\sigma_{0}$ is the unique permutation which arranges $y_{1},...y_{N}$ in ascending order.
Hence, you get that the joint pdf of $X_{1},...,X_{N}$ is given by
$f_{(X_{1},...,X_{N})}(y_{1},...,y_{N})=\dfrac{N!}{m^{N}}\,,y_{1}<y_{2}<...<y_{N}$
Another way to see this is to see that $f_{X_{1},...,X_{N}}(x_{1},...,x_{N})$ will be non zero only when $x_{1}<...<x_{n}$. But notice that the volume of this region is just $\frac{m^{N}}{N!}$. So you should scale the pdf by $\frac{N!}{m^{N}}$ to obtain the pdf in this region.
Anyways, to return to the problem,to find $f_{X_{N-1},X_{N}}(y_{N-1},y_{N})$, you need to integrate over the region $y_{1}<...<y_{N-2}<y_{N-1}$
i.e.
\begin{align}f_{X_{N-1},X_{N}}(y_{N-1},y_{N})&=\int_{0}^{y_{N-1}}\int_{y_{1}}^{y_{N-1}}\int_{y_{2}}^{y_{N-1}}\cdots\int_{y_{N-3}}^{y_{N-1}}\frac{N!}{m^{N}}\,dy_{N-2}dy_{N-3}...dy_{1}\\ &=\frac{N!}{m^{N}}\cdot \frac{y_{N-1}^{N-2}}{(N-2)!}\end{align}
which is just $f_{X_{N-1},X_{N}}(y_{N-1},y_{N})=\frac{N(N-1)y_{N-1}^{N-2}}{m^{N}}\,,y_{N-1}<y_{N}$
To put it in a more readable notation,
$$f_{X_{N-1},X_{N}}(x,y)=\frac{N(N-1)x^{N-2}}{m^{N}}\,,0<x<y<m$$