# Homework Help: Discrete uniform distribution prrof

1. Mar 17, 2012

### synkk

Hello, I'm currently in high school and going over discrete uniform distribution, and we've come across this formula. I'm curious if anyone could show me how the formula is true, as when I asked my teacher he just said that it'll confuse the class and we don't need to know why it's true.

If anyone could show me a proof or something i'd be very grateful :)

2. Mar 17, 2012

### Ray Vickson

You can do it directly if you know formulas for $\sum_{k=1}^n k \text{ and } \sum_{k=1}^n k^2,$ and these can be found on-line, for example. Another way is to prove the results by induction (although I don't know if you have studied that, yet).

Let's just do it directly for the E(X). The probability mass function is $p(k) = \Pr \{X=k\} = 1/n,$ for k = 1, 2, ..., n . The expected value is *defined* as $$E(X) = 1\cdot p(1) + 2 \cdot p(2) + 3 \cdot p(3) + \cdots + n \cdot p(n) = \frac{1}{n}[1 + 2 + \cdots + n].$$ This last summation is $$1+2+ \cdots +n = \frac{n(n+1)}{2},$$ so we we get the stated result.

Getting $\text{Var}(X)$ is more complicated, but you can use the easily-proven fact that $\text{Var}(X) = E(X^2) - (EX)^2,$ and so reduce the problem to finding $$E(X^2) = p(1) \cdot 1^1 + p(2) \cdot 2^2 + \cdots + p(n) \cdot n^2 = \frac{1}{n} [ 1^2 + 2^2 + \cdots n^2].$$

RGV