%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\problem {\bf (15 points)} Let $R$ be a random variable taking on
non-negative integer values.  Let $r$ be the probability generating
function for $R$; that is, define

\begin{eqnarray*}
r(x)	& = &	\Pr(R = 0) + \Pr(R = 1) \cdot x + \Pr(R = 2) \cdot x^2 +
		\Pr(R = 3) \cdot x^3 + \ldots.
\end{eqnarray*}

\begin{problemparts}

\problempart Write an expression involving $r$ that is equal to the expected value of $R$.

\solution{
\begin{eqnarray*}
r'(x)	& = &	1 \cdot \Pr(R = 1) + 2 \cdot \Pr(R = 2) \cdot x +
		3 \cdot \Pr(R = 3) \cdot x^2 + \ldots \\
r'(1)	& = &	1 \cdot \Pr(R = 1) + 2 \cdot \Pr(R = 2) +
		3 \cdot \Pr(R = 3) + \ldots \\
	& = &	\Ex(R)
\end{eqnarray*}
}

\problempart Suppose that $\Pr(R = k) = \frac{2}{3^{k+1}}$ for
all $k \geq 0$.  Find a closed-form expression for $r$, the
probability generating function for $R$.

\solution{
\begin{eqnarray*}
r(x)	& = &	\frac{2}{3^1} +
		\frac{2}{3^2} \cdot x +
		\frac{2}{3^3} \cdot x^2 +
		\frac{2}{3^3} \cdot x^3 +
		\ldots \\
	& = &	\frac{\frac{2}{3}}{1 - \frac{x}{3}} \\
	& = &	\frac{2}{3 - x}
\end{eqnarray*}

The first equation follows from the definition of the probability
generating function $r$.  The second equation uses the formula for the
sum of an infinite geometric series, and the third equation is
obtained by simplification.
}

\problempart Using your solution to part (a), determine the expected value
of the random variable $R$ as defined in part (b).

\solution{
\begin{eqnarray*}
r'(x)	& = &	\frac{2}{(3 - x)^2} \\
r'(1)	& = &	\frac{2}{(3 - 1)^2} \\
	& = &	\frac{1}{2}
\end{eqnarray*}
} 
\end{problemparts}

