\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\begin{document}
\parindent=0pt

{\bf Question}

Establish the following recursion relations for means and
variances.  Let $\bar X_n$ and $S_n^2$ be the mean and variance,
respectively, of $X_1,\ldots,X_n$. Then suppose another
observation $X_{n+1}$ becomes available.  Prove the following:

\begin{description}
\item[(a)]
$\ds \bar X_{n+1}=\frac{X_{n+1}+n \bar X_n}{n+1}$

\item[(b)]
$\ds nS_{n+1}^2=(n-1)S_n^2+\left(\frac{n}{n+1}\right)(X_{n+1}-
\bar X_n)^2$
\end{description}


\vspace{.25in}

{\bf Answer}

\begin{description}
\item[(a)]
\begin{eqnarray*} \bar X_{n+1} & = &
\frac{1}{n+1}\left\{\ds\sum_{i=1}^{n+1} X_i \right\}\\ & = &
\frac{1}{n+1}\left\{\ds\sum_{i=1}^{n} X_i + X_{n+1} \right\}\\ & =
& \frac{1}{n+1}\{n\bar X_n + X_{n+1}\} \end{eqnarray*}

\item[(b)]
Note: $S_{n+1}^2 = \frac{1}{n}\ds\sum_{i=1}^{n+1}(X_i-\bar
X_{n+1})^2$ and $S_{n}^2 = \frac{1}{n-1}\ds\sum_{i=1}^{n}(X_i-\bar
X_{n})^2$

Therefore

$nS_{n+1}^2  =  \ds\sum_{i=1}^{n+1}(X_i-\bar X_{n+1})^2$

$= \ds\sum_{i=1}^{n+1} \{X_i-\bar X_n+\bar X_n-\bar X_{n+1}\}^2$

$= \ds\sum_{i=1}^{n+1} \{(X_i-\bar X_n)^2+2(X_i-\bar X_n)(\bar
X_n-\bar X_{n+1})+(\bar X_n-\bar X_{n+1})^2\}$

$= \ds\sum_{i=1}^{n+1} (X_i-\bar X_n)^2+2(\bar X_n-\bar X_{n+1})
\ds\sum_{i=1}^{n+1} (X_i-\bar X_n)+(n+1)(\bar X_n-\bar X_{n+1})^2$

$= \ds\sum_{i=1}^{n+1} (X_i-\bar X_n)^2+(X_{n+1}-\bar X_n)^2$

\hspace{.5in}$+2(\bar X_n-\bar X_{n+1})\{(n+1)\bar
X_{n+1}-(n+1)\bar X_n\}$

\hspace{.5in}$+(n+1)(\bar X_n-\bar X_{n+1})^2$

$= (n-1)S_n^2 + (X_{n+1}-\bar X_n)^2 -2(n+1)(\bar X_n-\bar
X_{n+1})^2$

\hspace{.5in}$+(n+1)(\bar X_n-\bar X_{n+1})^2$

$= (n-1)S_n^2 + (X_{n+1}-\bar X_n)^2 - (n+1)(\bar X_n-\bar
X_{n+1})^2$

$= (n-1)S_n^2 + (X_{n+1}-\bar X_n)^2- (n+1)\left\{\bar
X_n-\frac{n\bar X_n+X_{n+1}}{n+1}\right\}^2$

$= (n-1)S_n^2 + (X_{n+1}-\bar X_n)^2- (n+1)\left\{\frac{\bar
X_n+X_{n+1}}{n+1}\right\}^2$

$= (n-1)S_n^2 + (X_{n+1}-\bar X_n)^2- \frac{1}{n+1}(\bar
X_n-X_{n+1})^2$

$= (n-1)S_n^2 +\left(1-\frac{1}{n+1}\right)(X_{n+1}-\bar X_n)^2$

$= (n-1)S_n^2+\frac{n}{n+1}(X_{n+1}-\bar X_n)^2.$

\end{description}



\end{document}
