Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

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

  1. Jan 31, 2012 #1
    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) = [itex]\frac{(2m+1)!}{m!m!}[/itex]*ƒ(x)*[F(x)]m*[1-F(x)]m

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

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


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

    = [itex]\frac{(2m+1)!}{m!m!}[/itex]*(1)*xm*(1-x)m

    = [itex]\frac{(2m+1)!}{m!m!}[/itex]*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

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

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

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

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

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

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

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

    = [itex]\frac{(2m+1)!}{m!m!}[/itex]*[itex]\int[/itex][itex]^{1}_{0}[/itex] 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.

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

    Last edited: Jan 31, 2012
  2. jcsd
  3. Jan 31, 2012 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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
  4. Jan 31, 2012 #3
    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.
  5. Jan 31, 2012 #4


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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.
  6. Jan 31, 2012 #5

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    Your formula for [itex]f_{\mbox{median}}(x)[/itex] is just that of a standard Beta distribution, so you can apply known formulas for the mean and variance. Actually, the mean is easy: [itex] x f_{\mbox{median}}(x)[/itex] 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 [itex] \mbox{Var}(X) = E(X^2) - (EX)^2. [/itex]

  7. Feb 1, 2012 #6
    Yes that's right, this is a βeta distribution with a mean and variance that can be looked up.

    β([itex]\alpha[/itex], [itex]\beta[/itex])

    β(m+1, m+1)

    Mean = [itex]\frac{\alpha}{\alpha + \beta}[/itex]

    Variance = ([itex]\alpha\beta[/itex])/[([itex]\alpha+\beta[/itex])2*([itex]\alpha+\beta+1[/itex])]
  8. Feb 18, 2012 #7
    Were the correct answers:

    Mean of the sample median: 1/2

    Variance of the sample median: 1/(12 + 8m)


    Last edited: Feb 18, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook