5. The random variable \(X\) has the discrete uniform distribution
$$\mathrm { P } ( X = x ) = \frac { 1 } { n } , \quad x = 1,2 , \ldots , n$$
Given that \(\mathrm { E } ( X ) = 5\),
- show that \(n = 9\).
Find
- \(\mathrm { P } ( X < 7 )\),
- \(\operatorname { Var } ( X )\).