Q:

The n candidates for a job have been ranked 1, 2, 3, . . . , n. Let X be the rank of a randomly selected candidate, so the X has the pmf p(x) =    1/n, if x = 1, 2, 3 . . . n, 0, otherwise. This is called the discrete uniform distribution. Compute E(X) and Var(X). (Hint: the sum of the first n positive integers is n(n + 1)/2, whereas the sum of their squares is n(n + 1)(2n + 1)/6.)

Accepted Solution

A:
By definition of expectation,[tex]\displaystyle E[X]=\sum_xx\,P(X=x)=\sum_{x=1}^n\frac xn=\frac{n(n+1)}{2n}=\boxed{\frac{n+1}2}[/tex]and variance,[tex]V[X]=E[(X-E[X])^2]=E[X^2-2X\,E[X]+E[X]^2]=E[X^2]-E[X]^2[/tex]Also by definition, we have[tex]E[f(X)]=\displaystyle\sum_xf(x)\,P(X=x)[/tex]so that[tex]E[X^2]=\displaystyle\sum_{x=1}^n\frac{x^2}n=\frac{n(n+1)(2n+1)}{6n}=\frac{(n+1)(2n+1)}6[/tex]and finally,[tex]V[X]=\dfrac{(n+1)(2n+1)}6-\dfrac{(n+1)^2}4=\boxed{\dfrac{n^2-1}{12}}[/tex]