11. A number is chosen at random from the integers 1, 2, 3, …, n. Let X be the number chosen. Show that E(X) = (n + 1)/2 and V (X) = (n − 1)(n + 1)/12. Hint: The following identity may be useful:

\[ 1^2 + 2^2 + \ldots + n^2 = \frac{n(n+1)(2n+1)}{6} \]

Show that \(E(X) = \frac{n+1}{2}\) and \(V(X) = \frac{(n-1)(n+1)}{12}\)

\(E(X)\) is the expected value the random variable \(X\)

\[ E(X) = \frac{1}{n} \sum_{i=1}^{n} i \]

using the arithmetic series formula,

\[1 + 2 + 3 + \ldots + n = \frac{n(n+1)}{2}\]

\(E(X) = \frac{1}{n} \cdot \frac{n(n+1)}{2} = \frac{n+1}{2}\)

\(V(X)\) is the variance of the random variable \(X\)

\[ V(X) = E(X^2) - (E(X))^2 \]

\(E(X)\) using the hint.

\[ 1^2 + 2^2 + \ldots + n^2 = \frac{n(n+1)(2n+1)}{6} \]

\[ E(X^2) = \frac{1}{n} \sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6n} = \frac{(n+1)(2n+1)}{6} \]

substitute this into the formula for variance: \[ V(X) = \frac{(n+1)(2n+1)}{6} - \left(\frac{n+1}{2}\right)^2 \]

\[ V(X) = \frac{(n+1)(2n+1)}{6} - \frac{(n+1)^2}{4} \] \[ V(X) = \frac{(2n^2 + 3n + n + 1)}{6} - \frac{(2n^2 + 2n + 1)}{4} \] \[ V(X) = \frac{8n^2 + 12n + 3 - 6n^2 - 6n - 6}{24} \] \[ V(X) = \frac{2n^2 + 6n - 3}{24} \] \[ V(X) = \frac{n^2 + 3n - 3}{12} \]

Check the given variance formula \(\frac{(n-1)(n+1)}{12}\), by simplifing: \[ V(X) = \frac{n^2 + 3n - 3}{12} = \frac{n^2 - 1 + 3n + 2}{12} = \frac{(n-1)(n+1)}{12} \]