# Random sample of size n (n odd) from Uni(0,1)

1. Jan 31, 2012

### thesandbox

1. The problem statement, all variables and given/known data
If you were taking a random sample of size n (n=2m+1 odd) from Uni(0,1)
How do you find the mean and variance of the sample median?

2. Relevant equations

In order to find the mean and variance of the sample median you need to start with the sample median itself. Using this equation:

ƒxmedian(x) = ƒx(2m+1)(x) = $\frac{(2m+1)!}{m!m!}$*ƒ(x)*[F(x)]m*[1-F(x)]m

Where ƒ(x) is the pdf of the Uni(0,1) ~ Uni(a,b)
ƒ(x) = $\frac{1}{b-a}$ This becomes = 1

Where F(x) is the cdf of the Uni(0,1)
F(x) = $\frac{x-a}{b-a}$ This becomes x

So,
ƒxmedian(x)

= ƒx(2m+1)(x)

= $\frac{(2m+1)!}{m!m!}$*(1)*xm*(1-x)m

= $\frac{(2m+1)!}{m!m!}$*xm*(1-x)m

3. The attempt at a solution
Above is part of the attempt.

Now as for the mean and variance of the sample median

Mean
E(x) = x*ƒxmedian(x)*dx

= $\int$$^{1}_{0}$ x*$\frac{(2m+1)!}{m!m!}$*xm*(1-x)m

= $\frac{(2m+1)!}{m!m!}$*$\int$$^{1}_{0}$ x*xm*(1-x)m

= $\frac{(2m+1)!}{m!m!}$*$\int$$^{1}_{0}$ xm+1*(1-x)m

= $\frac{(2m+1)!}{m!m!}$*$\int$$^{1}_{0}$ x*xm*(1-x)m

= $\frac{(2m+1)!}{m!m!}$*$\int$$^{1}_{0}$ x*(xm*(1-x)m)

= $\frac{(2m+1)!}{m!m!}$*$\int$$^{1}_{0}$ x*[x*(1-x)]m

= $\frac{(2m+1)!}{m!m!}$*$\int$$^{1}_{0}$ x*[(x-x2)]m

-> Continue with integration by parts.

Edit: Above has been corrected

So my question is: Have I done everything above correctly and how would I continue? Is there something I'm missing with this Uniform distribution because that integral doesn't seem to want to simplify.

Variance
Var(x) = E(x2) - [E(x)]2
And similarly for variance will follow.

Thanks!

Last edited: Jan 31, 2012
2. Jan 31, 2012

### jbunniii

The general method looks correct. I agree with the formula for the PDF of the sample median, except I didn't verify that your coefficient (2m+1)!/[(m!)(m!)] is correct.

Your integral bounds should be from 0 to 1, not 0 to infinity. You can combine the x^m with the (1-x)^m to get (x - x^2)^m. The integral seems straightforward - did you try a substitution, or integration by parts?

Last edited: Jan 31, 2012
3. Jan 31, 2012

### thesandbox

I believe you just answered it. I'm fairly confident the pdf for the sample median is correct, however with the new limits and simplification of (x - x^2)^m should make it a little more straight forward. I'll see what happens.

4. Jan 31, 2012

### jbunniii

If substitution or integration by parts doesn't work out, you could always expand (x - x^2)^m using the binomial theorem and integrate term by term.

5. Jan 31, 2012

### Ray Vickson

Your formula for $f_{\mbox{median}}(x)$ is just that of a standard Beta distribution, so you can apply known formulas for the mean and variance. Actually, the mean is easy: $x f_{\mbox{median}}(x)$ is just a simple scale factor (depending on m) times another Beta density, and the latter integrates to 1. Getting variance is most easily done using the standard result $\mbox{Var}(X) = E(X^2) - (EX)^2.$

RGV

6. Feb 1, 2012

### thesandbox

Yes that's right, this is a βeta distribution with a mean and variance that can be looked up.

β($\alpha$, $\beta$)

β(m+1, m+1)

Mean = $\frac{\alpha}{\alpha + \beta}$

Variance = ($\alpha\beta$)/[($\alpha+\beta$)2*($\alpha+\beta+1$)]

7. Feb 18, 2012