Find the density of the median of $2n$ i.i.d $U([0,1])$ random variables

density functionmedianorder-statisticsprobability distributionsuniform distribution

As a part of a probability problem I found the PDF and CDF of the $i^{th}$ order statistic in a sample.
When told that $$X_1,…,X_n{\sim}^{i.i.d}F$$ where F is countinuous, so I got to the conclusion that:

$$F_{X_i}(x) = \sum_{k=i}^{n}{ \binom{n}{i}} (F(x))^k(1-F(x))^{n-k}$$
$$f_{X_i}(x) =i{ \binom{n}{i}}(F(x))^{i-1}(1-F(x))^{n-i}$$

Now as a different problem, im looking for the Density function of the median, where $X_i\sim U([0,1])$ and we have an even number $2n$ of observations.

Define the median to be: $$M=\frac{1}{2}(X_{(i)}+X_{(i+1)})$$
Im trying to somehow apply the density of $X_{(i)}$ on this formula, but there's both convolution and the $\frac{1}{2}$ that I dont know how to deal with. Do I use the density of $f_\frac{X_i}{2}(x)$?
I'm really confused and not sure how to approach it.

Best Answer

Suppose $n=2m$, so that your sample median is $$M=\frac12\left(X_{(m)}+X_{(m+1)}\right)$$

Now joint density of $(X_{(m)},X_{(m+1)})$ for a $U(0,1)$ population is

$$f(x,y)\propto x^{m-1}(1-y)^{n-m-1}\mathbf1_{0<x<y<1}=(x(1-y))^{m-1}\mathbf1_{0<x<y<1}$$

For details of the general derivation, you can for example refer to this page from Introduction to the Theory of Statistics by Mood-Graybill-Boes.

Changing variables $(x,y)\mapsto (u,v)$ with $u=\frac12(x+y)$ and $v=y$, we get pdf of $(M,X_{(m+1)})$ as

$$g(u,v)\propto ((2u-v)(1-v))^{m-1}\mathbf1_{0<2u-v<v<1}$$

So density of $M$ is of the form

$$f_M(u)\propto \int_u^{\min(2u,1)} ((2u-v)(1-v))^{m-1}\,dv\,\mathbf1_{0<u<1}$$


Alternatively, you can directly find the density of $2M$ through convolution as

$$f_{2M}(u)=\int f(x,u-x)\,dx \propto \int x^{m-1}(1-u+x)^{m-1}\mathbf1_{0<x<u-x<1}\,dx$$

Then pdf of $M$ would be $$f_M(u)=2f_{2M}(2u)$$

Related Question