%tzLS.tex: 
%%a Plain TeX file 

%begin macros
\def\L{{\cal L}}
\baselineskip=14pt
\parskip=10pt
\def\halmos{\hbox{\vrule height0.15cm width0.01cm\vbox{\hrule height
  0.01cm width0.2cm \vskip0.15cm \hrule height 0.01cm width0.2cm}\vrule
  height0.15cm width 0.01cm}}
\font\eightrm=cmr8 \font\sixrm=cmr6
\font\eighttt=cmtt8
\magnification=\magstephalf
\def\P{{\cal P}}
\def\Q{{\cal Q}}
\def\1{{\overline{1}}}
\def\2{{\overline{2}}}
\parindent=0pt
\overfullrule=0in
\def\Tilde{\char126\relax}
\def\frac#1#2{{#1 \over #2}}
%\headline={\rm  \ifodd\pageno  \RightHead  \else  \LeftHead  \fi}
%\def\RightHead{\centerline{
%Title
%}}
%\def\LeftHead{ \centerline{Doron Zeilberger}}
%end macros
\centerline
{\bf Tutorial on Summation and \#1 of DeNardo's assignment on Least Squares}
\bigskip
\centerline
{\it Doron ZEILBERGER}

\bigskip


{\bf Reminder about simple average} 

If $X_1, \dots , X_n$ are $n$ numbers their {\bf average} denoted by $\bar{X}$ is defined by
$$
\bar{X}= \frac{X_1 + \dots + X_n}{n} \quad ,
$$
and in fancy {\bf sigma notation}
$$
\bar{X}= \frac{\sum_{i=1}^{n} X_i}{n} \quad .
$$
An important consequence is that
$$
\sum_{i=1}^{n} X_i = n \bar{X} \quad .
$$

For the special case $n=2$, we have
$$
X_1 +X_2 =2 \bar{X} \quad ,
$$
and for the special case $n=3$, we have
$$
X_1 +X_2+X_3 =3 \bar{X} \quad .
$$

{\bf Reminder on Summation}

Given $n$ numbers, $a_1,a_2, \dots a_n$, their sum, $a_1+a_2+...+a_n$ is abbreviated as
$$
\sum_{i=1}^{n} a_i \quad .
$$

There are simple rules on handling $\sum$ expressions. If $c$ is any number, then
$$
\sum_{i=1}^{n} c a_i=
c \left ( \sum_{i=1}^{n}  a_i \right )
\eqno(Rule1)
$$
Indeed, when $n=2$, for example, the left side is
$$
ca_1 + ca_2
$$
simplifying, we get that this is
$$
c(a_1+a_2)
$$
which is the same as the right side for $n=2$.

Again, for $n=3$. The right side is
$$
ca_1 + ca_2 + ca_3
$$
simplifying, we get that this is
$$
c(a_1+a_2+a_3)
$$
which is the same as the right side for $n=3$.

Another obvious rule (in fact a special case) is
$$
\sum_{i=1}^{n} c = cn
\eqno(Rule)
$$
Since
$$
\sum_{i=1}^{n} c = \sum_{i=1}^{n} c \cdot 1 = c \left ( \sum_{i=1}^{n}  1 \right ) = cn \quad,
$$
since $\sum_{i=1}^{n} 1=1+1+ \dots +1 $ ($n$ times) and this equals $n$.

Now I will spell-out Problem 1 for $n=2$ and $n=3$, but you would have to do it for general $n$ using 
$\sum$ notation.

When {\bf n=2} we have
$$
w_1= \frac{X_1 -\bar{X}}{(X_1 -\bar{X})^2+(X_2 -\bar{X})^2} \quad , \quad 
w_2= \frac{X_2 -\bar{X}}{(X_1 -\bar{X})^2+(X_2 -\bar{X})^2}  \quad .
$$
For the sake of simplicity let's call the denominator (that is some number, and it is the same for $w_1$ and $w_2$), $D$.
In other words
$$
D=(X_1 -\bar{X})^2+(X_2 -\bar{X})^2 \quad .
$$
So abbreviating
$$
w_1= \frac{X_1 -\bar{X}}{D} \quad , \quad 
w_2= \frac{X_2 -\bar{X}}{D}  \quad .
$$
When $n=2$ the three assertions spell-out to be
$$
w_1+w_2=0
\eqno(Assertion1)
$$
$$
w_1 x_1 + w_2 x_2=1
\eqno(Assertion2)
$$
$$
w_1^2 + w_2^2 =\frac{1}{D} \quad
\eqno(Assertion3)
$$

As for $(Assertion1)$
$$
w_1 +w_2= \frac{X_1 -\bar{X}}{D} + \frac{X_2 -\bar{X}}{D} = \frac{X_1 -\bar{X}  + X_2- \bar{X} }{D} =
\frac{X_1 + X_2 - 2 \bar{X}}{D} = \frac{0}{D}=0 \quad ,
$$
since, as we said above (for $n=2$) $X_1+X_2=2\bar{X}$, so $X_1+X_2 - 2\bar{X}=0$.

For $(Assertion2)$, it is better to use $x_i$, (rather than $X_i$), so we have, from the definition
$$
w_1=\frac{x_1}{D} \quad , \quad w_2=\frac{x_2}{D} \quad .
$$
So
$$
\sum_{i=1}^{2} x_i w_i = x_1 w_1 + x_2 w_2 =  x_1 \frac{x_1}{D} + x_2 \frac{x_2}{D} =
 \frac{x_1^2}{D} + \frac{x_2^2}{D} = \frac{x_1^2 + x_2^2}{D} =1 \quad,
$$
since {\bf by definition}, $D=x_1^2+x_2^2$.

For $(Assertion3)$, it is also better to use $x_i$
$$
\sum_{i=1}^{2} w_i^2 = w_1^2+w_2^2 = \left ( \frac{x_1}{D} \right )^2 + \left ( \frac{x_2}{D} \right )^2=
\frac{x_1^2}{D^2} + \frac{x_2^2}{D^2} = \frac{x_1^2 +x_2^2}{D^2} \quad .
$$
But, {\bf by definition} (when $n=2$), $D=x_1^2+x_2^2$, so this is
$$
\frac{D}{D^2} =\frac{1}{D} = \frac{1}{(X_1-\bar{X})^2 + (X_2-\bar{X})^2} \quad .
$$

This concludes the case $n=2$.

Now let's do the same for $n=3$.
$$
w_1= \frac{X_1 -\bar{X}}{(X_1 -\bar{X})^2+(X_2 -\bar{X})^2 + +(X_3 -\bar{X})^2} \quad , \quad 
$$
$$
w_2= \frac{X_2 -\bar{X}}{(X_1 -\bar{X})^2+(X_2 -\bar{X})^2 + +(X_3 -\bar{X})^2}  \quad , \quad
$$
$$
w_3= \frac{X_2 -\bar{X}}{(X_1 -\bar{X})^2+(X_2 -\bar{X})^2 + +(X_3 -\bar{X})^2}  \quad , \quad
$$
For the sake of simplicity let's call the denominator (that is some number, and it is the same for $w_1$, $w_2$ and $w_3$), $D$.
In other words
$$
D=(X_1 -\bar{X})^2+(X_2 -\bar{X})^2 + +(X_3 -\bar{X})^2 \quad .
$$
So abbreviating
$$
w_1= \frac{X_1 -\bar{X}}{D} \quad , \quad 
w_2= \frac{X_2 -\bar{X}}{D}  \quad ,\quad 
w_3= \frac{X_3 -\bar{X}}{D}  \quad .
$$

In terms of $x_i$ rather than $X_i$, we have

$$
w_1= \frac{x_1}{D} \quad , \quad 
w_2= \frac{x_2}{D}  \quad ,\quad 
w_3= \frac{x_3}{D}  \quad .
$$


When $n=3$ the three assertions spell-out to be
$$
w_1+w_2 + x_3 =0
\eqno(Assertion1)
$$
$$
w_1 x_1 + w_2 x_2 + w_3 x_3 =1
\eqno(Assertion2)
$$
$$
w_1^2 + w_2^2 + w_3^2 =\frac{1}{D} \quad
\eqno(Assertion3)
$$

As for $(Assertion1)$
$$
w_1 +w_2 + w_3= \frac{X_1 -\bar{X}}{D} + \frac{X_2 -\bar{X}}{D}  + \frac{X_3 -\bar{X}}{D} 
=
\frac{X_1 + X_2 +X_3 - 3 \bar{X}}{D} = \frac{0}{D}=0 \quad ,
$$
since, as we said above (for $n=3$) $X_1+X_2+X_3=3\bar{X}$, so $X_1+X_2 +X_3 - 3\bar{X}=0$.

For $(Assertion2)$, it is better to use $x_i$, (rather than $X_i$), so we have, from the definition
$$
w_1=\frac{x_1}{D} \quad , \quad w_2=\frac{x_2}{D} \quad , \quad
w_3=\frac{x_3}{D} \quad .
$$
So
$$
\sum_{i=1}^{3} x_i w_i = x_1 w_1 + x_2 w_2 + x_3 w_3  =  x_1 \frac{x_1}{D} + x_2 \frac{x_2}{D}  + x_3 \frac{x_3}{D} 
=
 \frac{x_1^2}{D} + \frac{x_2^2}{D} + \frac{x_3^2}{D} 
= \frac{x_1^2 + x_2^2 +x_3^2}{D} =1 \quad,
$$
since {\bf by definition} $D=x_1^2+x_2^2+x_3^2$.

For $(Assertion3)$, it is also better to use $x_i$
$$
\sum_{i=1}^{3} w_i^2 = w_1^2+w_2^2 + w_3^2 = \left ( \frac{x_1}{D} \right )^2 + \left ( \frac{x_2}{D} \right )^2
+ \left ( \frac{x_3}{D} \right )^2
$$
$$
=\frac{x_1^2}{D^2} + \frac{x_2^2}{D^2}  + \frac{x_3^2}{D^2} 
= \frac{x_1^2 +x_2^2 + x_3^2}{D^2} \quad .
$$
But, {\bf by definition} (when $n=3$), $D=x_1^2+x_2^2 + x_3^2$, so this is
$$
\frac{D}{D^2} =\frac{1}{D} = \frac{1}{(X_1-\bar{X})^2 + (X_2-\bar{X})^2+  (X_3-\bar{X})^2 } \quad .
$$

Now it is {\bf your job} to do it for general $n$ using $\sum$ notation!


\bigskip
\hrule
\bigskip
\bigskip
Doron Zeilberger, Department of Mathematics, Rutgers University (New Brunswick), Hill Center-Busch Campus, 110 Frelinghuysen
Rd., Piscataway, NJ 08854-8019, USA. \hfill\break
Email: {\tt zeilberg at math dot rutgers dot edu}   \quad .


\end







