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

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.

• You need the joint of $(X_{(n)}, X_{(n+1)})$ first. It is well known, or you can derive it similarly by using the multinomial idea. Note that they are dependent, and you can still apply the convolution on the joint, and finally transform by the scale $1/2$.
– BGM
Jun 2 '20 at 14:44

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

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

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

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

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

• I saw on en.wikipedia.org/wiki/Order_statistic a formula for the joint distribution of 2 arbitrary order statistics $X_{(j)},X_{(k)}$, so I got the first part. But the second one not so much. Would you please elaborate on what you did with U and V? Is there a way without changing the variables and stay with $X_{(n)} and X_{(n+1)}$ ? Jun 2 '20 at 18:28
• Nothing much to elaborate on the change of variables. If you are not familiar with this, you can first find the density of $2M=X_{(m)}+X_{(m+1)}$ by convolution as mentioned in a comment under your post: $$f_{2M}(u)=\int f(x,u-x)\,dx$$ Jun 2 '20 at 18:35
• ok, thank you very much! Jun 2 '20 at 18:39