Answer

问题及解答

[Exer4-4] Exercise 36 of Book {Devore2017B} P.118

Posted by haifeng on 2020-03-19 10:19:56 last update 2020-03-19 10:53:23 | Edit | Answers (1)

The $n$ candidates for a job have been ranked $1,2,3,\ldots,n$. Let $X=$ the rank of a randomly selected candidate, so that $X$ has pmf
\[
p(x)=\begin{cases}
1/n, & x=1,2,3,\ldots,n\\
0, & \text{otherwise}
\end{cases}
\]
(This is called the discrete uniform distribution(离散均匀分布)).

Compute $E(X)$ and $V(X)$ using the shortcut formula. [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$.]
 

1

Posted by haifeng on 2020-03-19 12:28:33

\[
E(X)=\sum_{x=1}^{n}x\cdot p(x)=\sum_{x=1}^{n}x\cdot\frac{1}{n}=\frac{1}{n}\cdot\sum_{x=1}^{n}x=\frac{1}{n}\cdot\frac{n(n+1)}{2}=\frac{n+1}{2}
\]

That is, the expected value $\mu=E(X)=\frac{n+1}{2}$.

\[
\begin{split}
V(X)&=E[(X-\mu)^2]=\sum_{x=1}^{n}(x-\frac{n+1}{2})^2\cdot p(x)\\
&=\sum_{x=1}^{n}(x-\frac{n+1}{2})^2\cdot\frac{1}{n}\\
&=\frac{1}{n}\cdot\sum_{x=1}^{n}\biggl[x^2-(n+1)x+\frac{(n+1)^2}{4}\biggr]\\
&=\frac{1}{n}\cdot\biggl[\sum_{x=1}^{n}x^2-(n+1)\sum_{x=1}^{n}x+\frac{n(n+1)^2}{4}\biggr]\\
&=\frac{1}{n}\cdot\biggl[\frac{n(n+1)(2n+1)}{6}-(n+1)\cdot\frac{n(n+1)}{2}+\frac{n(n+1)^2}{4}\biggr]\\
&=\frac{(n+1)(2n+1)}{6}-\frac{(n+1)^2}{2}+\frac{(n+1)^2}{4}\\
&=\frac{n+1}{2}\cdot\biggl[\frac{2n+1}{3}-\frac{n+1}{2}\biggr]\\
&=\frac{n^2-1}{12}
\end{split}
\]


 

Or we can use the formula $V(X)=E(X^2)-(E(X))^2$ to calculator the variance $V(X)$.

\[
\begin{split}
V(X)&=E(X^2)-(E(X))^2\\
&=\sum_{x=1}^{n}x^2\cdot p(x)-\bigl(\frac{n+1}{2}\bigr)^2\\
&=\frac{1}{n}\cdot\sum_{x=1}^{n}x^2-\frac{(n+1)^2}{4}\\
&=\frac{1}{n}\cdot\frac{n(n+1)(2n+1)}{6}-\frac{(n+1)^2}{4}\\
&=\frac{(n+1)(2n+1)}{6}-\frac{(n+1)^2}{4}\\
&=\frac{n+1}{2}\cdot\biggl[\frac{2n+1}{3}-\frac{n+1}{2}\biggr]\\
&=\frac{n+1}{2}\cdot\frac{n-1}{6}\\
&=\frac{n^2-1}{12}
\end{split}
\]