\documentclass[30pt,landscape]{foils}

\usepackage{amsmath}

\usepackage{pause}               \usepackage{background}
\usepackage{graphicx}           \usepackage{geometry}
\usepackage{hyperref}

\usepackage{pp4slide}
\geometry{headsep=3ex,hscale=0.9}

\newtheorem{example}{Example} 
\newtheorem{question}[example]{Question}
\newtheorem{definition}[example]{Definition}
\newtheorem{fact}[example]{FACT}
\newtheorem{theorem}[example]{Theorem}
\newtheorem{notation}[example]{Notation}

\newcommand{\pz}{\pause}
\newcommand{\pb}{\pagebreak}

\definecolor{bgblue}{rgb}{0.03,0.39,0.23}
\vpagecolor{bgblue}

\hypersetup{pdftitle={lecture},
  pdfsubject={A mathematics lecture},
  pdfauthor={Dev Sinha, University of Oregon},
  pdfkeywords={pdftex, acrobat},
  pdfpagemode={FullScreen},
  linkcolor={red}
}

\begin{document}


{\Large Some ideas from the first lecture}\pz

\begin{quote}
You know how dumb the average guy is? Well, by definition, half of
them are even dumber than that.  \pz

J.R. "Bob" Dobbs \pz
\end{quote}

Does average mean ``mean'' or ``median'' here?  
 \pz

If it means ``mean'' need this quote be true?
\pb 
\begin{example}
Find the medians and means of the following, and say whether they are
skewed left or right (or not at all).\pz
$$70, 80, 90, 100, 120, 140, 160$$\pz
%$M = 100$ but $\overline{x} = 108.57$.  Skewed right.  
$$80, 80, 80, 110, 115, 115, 120$$\pz
%$M=110$ but $\overline{x}=100$.  Skewed left.\pause 
\end{example}

Conceptually, last time we started to associate some basic numbers to sets of data\pz,
namely the median, \pz mean, \pz and quartile numbers. \pz
We then used these numbers to define terms describing the data, \pz
in that we say that data is skewed right or left depending on whether
the mean is greater than or less than the median. \pz  Note that ``skewed''
is a word that had (informal) meaning before we came to class, but now has a
different (technical) meaning through this comparison of median and mean. \pz
It is of course intentional that the technical meaning of ``skewed''
often fits well with the original informal meaning.\pb

{\Large Finding outliers using quartiles}\pz

We  may also endow the term ``outlier'' with technical meaning. \pz
First, let's say an outlying data point should be informally. \pz
Now, let's give one possible technical meaning, the first
we will give, to the term ``outlier''. \pz  We need to define some relevant numbers first.

\begin{definition}
The interquartile range, denoted $IQR$ of a set of data is given by
$IQR = Q_3 - Q_1$. \pz

 A value is an outlier if it is \emph{below} $Q_{1} - 1.5 IQR$,
or \emph{above} $Q_{3} + 1.5 IQR$. \pz
\end{definition}

\begin{example}
We illustrate this with the data on quarts of milk for which we calculated the
quartiles last time. \pz The data was:

1.20, 1.24, 1.32, 1.33, 1.35, 1.38, 1.43, 1.47, 1.48, 1.62, 1.84,
1.84, 1.86, 1.86, 1.95, 1.96, 2.01, 2.18, 2.18, 2.19, 2.21, 2.21,
2.29, 2.32, 2.34, 2.71, 2.71, 2,97, 3.14, 3.60, 4.10, 4.59 \pz

And the  five number summary was
1.20, 1.475, 1.955, 2.33, 4.59 \pz

So which data points are outliers?\pz
%IQR This is 87 cents.\pause 
%1.5IQR = 1.5 \times (Q_{3}-Q_{1}) = 1.305
%In our example then, an outlier is something below 
%\[ 1.47 - 1.305 = .165 \mbox{ or above } 2.34 + 1.305 = 3.645. \]
%By this rule we have two high outliers no low outliers.
\end{example}
\pb

{\Large Density Curves} \pz

We dive into a slippery topic, but one which is basic to all that
we do in this class.
Given a collection of data, a \emph{density curve} for that data is 
(informally) a
curve that approximates the shape of a histogram for that data.  We
can use the density curve, like a histogram, to get a visual
impression of the distribution of the data.  \pz

At a practical level, given a density curve for a variable, we can
determine how many observations are in a certain range by looking at
the area under the curve in that range.  \pz
Consider the following for example. \pz

\includegraphics[height=13cm]{Figures/fam-inc.jpg}

From this density curve we can see that about 1/2 of families have
annual income below about \$40,000, which will be approximately the
median.  \pz We can also see that the data is skewed to the right, so the
mean will be somewhat larger than the median.  
\pause

\begin{example}
To guess at $Q_{1}$, we examine the curve and try to guess where the
first 1/4 of the area under the curve is.  
%$Q_{1}$ will be somewhere in the low 20s.  
\pause

We may similarly guess at $Q_3$.
\end{example} \pb
%Similarly, $Q_{3}$ will be in the 70s somewhere.


{\Large Gaussian or normal distributions  \pz a.k.a. the bell curve} \pz

We come to one of the most famous objects in statistics, \pz the bell curve. \pz
The bell curve is the density curve for a special kind of data.
Mathematicians generally like to associate the name of the 
first person who investigated this curve,
C.F. Gauss, who is often considered the greatest mathematician of all time. \pz

\includegraphics{Figures/Gauss1803.jpg}
\includegraphics[height=8cm]{Figures/1993-DM-10.jpg}

Johann Carl Friederich Gauss (1777-1855), first in portrait  at age 26, then
later reincarnated on the 10 Mark note (before the advent of the Euro).\pz

We proceed more slowly and thoroughly to understand
how the bell curve arises in one example.  \pz  Our (lofty) goal is to see how one
can start from data and ``make'' a bell curve, so that when we turn the process around
it will be natural to start with a bell curve in order to understand the data which
``made'' it. \pz

Suppose that we have
daily receipts for a grocery store over 10 years, totaling
$3650$ entries in data set.    \pz The grocery store's average take is around \$10K,
and is always between 0 and 20K. \pz


\newpage

At first we will be lazy, and only care about increments of 2K. \pz
 That means for example
we count the number of days which had between 10 and 12K in receipts  and plot that in a bar between 10 \& 12.  \pz
Similarly, we count
the number of days that there were between 4 and 6K in receipts and plot a bar
there. \pz  We do this for each increment of
2K, for ten increments in total.  We would see something like this
(with numbers on the x-axis and y-axis corrected on the overhead in class): \pz

\vfill

\includegraphics[height = 10cm]{Figures/10-div.jpg}

\newpage

If we were a little more fastidious, we would care about measuring the number
of days we made money within windows of \$1K instead of \$2K.  \pz This means
there are twenty classes into which we divide and make our histogram.
Again being careful of the units on our axes, we would see the following.
\vfill

\includegraphics[height = 9cm]{Figures/20-div.jpg} \pz

It is useful to think of what relationships must hold between this picture and the
previous one, and making these relationships as direct as possible means
changing the labels on the y-axis. (why?)\pz (It is because of this change
of labels on the y-axis that makes it hard to precisely define what we are doing). \pb

Finally, suppose that your type-A colleague wanted to track receipts to
within \$400, meaning that there are fifty bars in the histogram, which would 
look something like this.

\includegraphics[height = 9cm]{Figures/50-div.jpg}


Notice that histogram is closer and closer to the blue curve, which
is called the {\em bell curve}.  \pz
For those of you who know exponentials,  the general formula for the bell curve
is 
\[
y = A \frac{1}{\sqrt{2\pi \sigma ^{2}}}e^{-\frac{(x-\mu )^{2}}{2\sigma ^{2}}}.
\]
\pause


Data distributed in this shape is called {\em normally distributed}
or {\em Gaussian} (which is why a bell curve is pictured on the Deutsch Mark with Gauss).  \pz
Lots of variables are normally distributed.  That is, histograms of their values
will have this shape.
Examples of such variables are things like height, weight, IQ test
scores, daily receipts, daily production, etc. \pz

But one of the most common, and most damaging, assumptions
made in statistics is that data is normally distributed. \pz
NOT ALL DATA IS NORMALLY DISTRIBUTED!  \pz !!  \pz
For example, the income data we used to illustrate density curves is
not normally distributed. \pz 
Still, it is helpful to think of Gaussian data first and foremost while
learning statistics because they are easy to describe.  \pb

{\Large First manipulations with normal distributions} \pz

We will learn to work with Gaussian distributions before learning 
how they are constructed and what all our terms mean. \pz
(Sort of like learning to drive before learning how to do basic
auto repair or even knowing what an engine does). \pz

(Minor point): first, it is customary to ``only be counting a total of one.''  \pz
In our receipt example, instead of having a total of 3650 receipts,
you pretend that each receipt only counts for $\frac{1}{3650}$th of the total 1.
With this in mind, there are only two numbers needed to describe a normal
distribution: \pz

$\mu$, its mean, which is the center of the distribution, around which it
is symmetric \pz

and $\sigma$, its standard deviation 
(hinted at towards the end of the first lecture). \pz

We will learn better what $\sigma$ is, but now let's see how it can be used. \pb

\begin{fact}
In a normal distribution, with mean $\mu$ and standard deviation $\sigma$,
\begin{enumerate}
\item 68\% of the observations fall within $\sigma$ of $\mu$  (within
one standard deviation of the mean).
\item 95\% of the observations fall within $2\sigma$ of $\mu$ (within
two standard deviations of the mean).
\item 99.7\% of the observations fall within $3\sigma$ of $\mu$
(within 3 standard deviations of the mean).
\end{enumerate}
\end{fact}
\includegraphics{Figures/gauds.jpg}


\begin{example}
The height of adult males in the U.S. is normally
distributed with (measured in inches) $\mu = 69.3$ and 
$\sigma = 2.8$.  Based on this, \pz
\begin{enumerate}
\item In our class, how many men should be between 5'6'' and 6'?   (And how 
many men are between those heights?) \pz
\item What percentage of men are over six feet tall?\pz
\item If you were designing a piece of sports equipment with a minimum height needed
(golf clubs, hockey sticks), where should you set that height so that over 95\%
of men could use your equipment? \pz
\end{enumerate}
\end{example}

We will be doing many more calculations with normal distributions in our next
classes.



\end{document}
 