結論
確率関数
f(x) = \frac{1}{K}\ \ (x = 1,2,\cdots,K)
期待値,分散
E[X] = \frac{K+1}{2}, \ \ V[X] = \frac{K^2-1}{12}
母関数
G(s) = \frac{s+s^2+\cdots+s^K}{K} = \frac{s(1-s^K)}{K(1-s)}
期待値の導出
期待値の定義:$\displaystyle E[X]=\sum_{x}xf(x)$を思い出して,
\begin{align*}
E[X] &= 1\cdot\frac{1}{K} +2\cdot\frac{1}{K} +\cdots + K\cdot\frac{1}{K}\\
&= \frac{1}{K}\cdot(1+2+\cdots+K)\\
&= \frac{1}{K}\cdot\frac{1}{2}K(K+1)\\
&= \frac{K+1}{2}
\end{align*}
分散の導出
分散は偏差の2乗の期待値 $\left(\displaystyle V[X]=E[(X-\mu)^2]\right)$ だから,
\begin{align*}
V[X] &= E[(X-\mu)^2]\\
&= \sum_{x}(x-\mu)^2f(x)\\
&= \sum_{x=1}^{K}\left(x-\frac{K+1}{2}\right)^2\frac{1}{K}\\
&= \left(\sum_{x=1}^{K}x^2 - (K+1)\sum_{x=1}^{K}x + \frac{K(K+1)^2}{4} \right)\frac{1}{K}\\
&= \left(\frac{1}{6}K(K+1)(2K+1) - \frac{1}{2}K(K+1)^2 + \frac{1}{4}K(K+1)^2 \right)\frac{1}{K}\\
&= \frac{1}{6}(K+1)(2K+1) - \frac{1}{2}(K+1)^2 + \frac{1}{4}(K+1)^2\\
&= \frac{1}{12}(K+1)(K-1) = \frac{K^2-1}{12}\\
\end{align*}
【別解】
関係式:$V[X]=E[X^2]-(E[X])^2$ から,
\begin{align*}
V[X] &= E[X^2]-(E[X])^2\\
&= \sum_{x=1}^{K}x^2f(x) - \left(\frac{K+1}{2}\right)^2\\
&= \frac{1}{6}(K+1)(2K+1) - \frac{1}{4}(K+1)^2\\
&= \frac{1}{12}(K+1)(K-1) = \frac{K^2-1}{12}
\end{align*}
母関数の導出
確率母関数の定義:$G(s)=E[s^X]$ から,
\begin{align*}
G(s) &= E[s^X]\\
&= \sum_{x=1}^{K}s^x\frac{1}{K}\\
&= s\frac{1-s^K}{1-s}\frac{1}{K} = \frac{s(1-s^K)}{K(1-s)}
\end{align*}