\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{theorem}[example]{Theorem}
\newtheorem{fact}[example]{Fact}
\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 Using probability rules}\pz

Let's recall the basic rules for {\em discrete} probability problems.

\begin{itemize}

\item If there are $D$ outcomes in the sample space which are a priori
equally likely, then the chance of achieving one of $N$ of these
outcomes is $\frac{N}{D}$. \pz
\item $P (A \; \mbox{doesn't happen}) = 1 - P (A)$. \pz
\item If event $A$ and event $B$ have no outcomes in common, 
\[
P (A \mbox{ or } B) = P (A)+P (B). \pz
\]
\item If the outcome of event $X$ is unrelated to the outcome of event
$Y$  (they are {\emph{independent}}) then 
\[
P (X=A \mbox{ and } Y=B) = P (X=A)\times  P (Y=B)
\] \pz
\end{itemize}

\begin{example}
Find the probability of getting exactly one four when rolling a die three times. \pz
\end{example}

\begin{example}
Find the probability that you there is a pair dealt in a hand with five cards. \pb
\end{example}


{\Large Continuous (vs. discrete)  random variables}.

Let's remember how to find probabilities of flipping some number of heads
in a sequence of coin flips.  \pz As the number of flips gets large, the natural of 
the questions change. \pz

For example, with $80$ flips,
we probably won't get exactly 40 heads.  The probability of that is .089\pause
But $P (35\leq Y\leq 45) = .781$ \pause and
$P (30 \leq Y \leq 50) = .982$, so the probability of getting ``near 30 heads''
is high. \pz


As the number of trials gets very large, the probability of any
one outcome gets very small.  It starts being less relevant to ask
for example what is the probability that you would get exactly 31 heads out of 80. \pz
The answer is just too small to matter.  \pz  What works better is asking the chances
that the number of heads will be in some range. \pz  This change of emphasis
(from ``individual'' measurement to ranges) is important when we look at
continuous variables. \pz

\newpage

\begin{itemize}
\item If a random variable $X$ takes on a finite number of possible
values,  it is called a \emph{ {discete}} random variable. \pz  All
of our examples so far have been discrete. \pz
\item If a random variable $X$ takes on a \emph{range} of possible
values,  it is called a \emph{ {continuous}} random variable. \pz
\item The  {sample space} is still the collection of possible
values for $X$. \pz
\item The  {probability distribution} of a random variable is the
assignment of probabilities to the values in the sample space. \pz
\item It no longer makes sense to ask what $P (X=a)$ is, but rather
what is $P (a \leq X \leq b)$.\pause 
\end{itemize}


\begin{example}
Let $X$ be a number randomly chosen between $0$
and $1$.  (Note that it is hard to randomly choose numbers in this
fashion.)\pause 
 \begin{itemize}
\item What is $P (X=.3)$  %The probability of $X$ being any specific
%number is $0$.
\item If we assume all choices between $0$ and $1$ are equally likely,
 what is $P (X \geq .5)$. \pause 
 %Since that
%is half the interval, the probability is .5.\pause 
\item What is $P (X \leq .3 \mbox{ or } X \geq .6)$?  \pause 
%This is 7
%tenths of the interval, so the probability is .7\pause 
\end{itemize}
\end{example}

\begin{example}
What is the probability that a number chosen between 0 and 3 
lies between 1.5 and 2.4?\pz
\end{example}

The probabilities end up corresponding to (ratios of) lengths within
these state spaces.  Probabilities can also correspond to 
(ratios of) areas. \pz

\begin{example}
If a dartboard is 8 inches in radius and the center circle is $\frac{1}{2}$ inch in radius,
what is the probability that a dart thrown at random will hit the center square? \pz
What is the probability that a dart thrown at random will hit in the 20-point wedge? \pz
\end{example}


To be systematic about probabilities in the continuous setting, we have to 
formalize the notion of distribution. \pz

\begin{definition}
\begin{enumerate}
\item A distribution for a continuous random variable can be
any non-negative function $D$ where the total area under the function is $1$. \pz
\item If $X$ is distributed according to a distribution $D$ then
$P (a \leq X \leq b)$ is the area between the line $x = a$, the line $x = b$,
the graph of $D$, and the $x$-axis. \pz
\item The sample space for such a variable is all $x$ where $D$ is non-zero. \pz
\item If $D$ is equal to either $0$ or one other fixed number, we say $D$
is a uniform distribution. \pz
\end{enumerate}
\end{definition}

%\includegraphics{Figures/uniform0-3.eps} \pz

\begin{example}
Revisit a previous example. 
\begin{itemize}
\item Our sample space \pz  is the closed interval $[0,3]$. \pz
\item Our probability distribution \pz  is the function 
\[
p (t) = \left\{ \begin{array}{ll}
1/3 & 0 \leq t \leq 3\\
0  & \mbox{else}
\end{array} \right. \pz
\]
\end{itemize}
\end{example}

\begin{example}
Suppose that $X$ is distributed according to 
$$D = \begin{cases} \frac{1}{12} \;\; 1 \leq x \leq 3 \\
\frac{1}{2} \;\; 3 \leq x \leq 4 \\  \frac{1}{9} \;\; 4 \leq x \leq 7 \\
0 \;\; {\text{otherwise}}
\end{cases}$$
\begin{itemize}
\item What is the state space? \pz
\item What is $P(2 \leq X \leq 3)$? \pz
\item Which is more likely, that $X$ is between $3$ and $4$ or that $X$
is between $5$ and $7$?  \pz
\end{itemize}
\end{example}

Compare the answer to the last question to the answer you would get if
$X$ were uniformly distributed. \pb


{\Large Normal distributions} \pz

\begin{example}{[Main Example]}
$\mathbf{Z}$ is a number chosen with normal distribution $N (\mu ,\sigma)$. \pz
We'll use $N (0,1)$ as our first example. \pz
%\includegraphics{Figures/normal0-1.eps}
\begin{itemize}
\item Our random event is the choice of a number. \pz
\item Our random variable $\mathbf{Z}$ is the value of the number. \pz
\item Our sample space is all possible real numbers. \pz
\item Our probability distribution is the function 
\[
e^{-t^{2}/2}/\sqrt{2\pi }. \pz
\]
\item What is $P (\mathbf{Z}>3)$? (Hint: use 68-95-99.7 rule.) \pz % = .0015$ by 
\item What is $P (0 \leq Z \leq 2)$?  \pz % can be read off of Table A with a bit of work.
\item $P (\mathbf{Z}>100)$? \pause 
%The probability  $P
%(\mathbf{Z}>22)$ is less that $\frac{1}{10^{99}}$, and will come out
%as $0$ on our calculators.
\end{itemize}
\end{example}

\newpage

Doing calculations with normal distributions works much as before. \pz
Instead of calculating percentiles, we are calculating probabilities. \pz



\end{document}




{\Large Where are we?} \pz

We are in a position to do some ``real statistics.''  Everything we have
done up to the mid-term can be viewed as developing some
basic tools, language and point of view to build on. \pz

If you want, in one sentence, to know where we're going, it is
to understand topics like the ``margin of error'' for opinion polls.  \pb

More explicitly, so far almost all of the computations we have 
done have assumed that we completely understand
the distribution we are working with. \pz  Then we can compute
things like the mean, deviation, regression lines, sampling distributions,
etc.  \pz  But in the real world one hardly ever knows a complete data set
(except for small data sets such as exam scores).  \pz  The ``basic
practice of statistics''  (also known as {\em statistical inference}
is to start with some sample of a data set
and work towards getting a picture of that data set.  \pb

One important feature of this basic practice is that we will have to live
with uncertainty; \pz there is always a chance that even a well-taken
sample is ``unlucky''.  \pz

Within the context of this class, another feature will be that the material
will become more computational and example-driven, rather than
conceptual. \pb  

{\Large Confidence intervals} \pz

Confidence intervals are one of the most basic parts of the analysis
we do for the rest of the term. \pz

\begin{definition}
A confidence interval is a statement of the form ``There is a C\% chance
that the parameter we are trying to measure is between $X - D$ and
$X + D$.''  \pz  The quantity $D$ is called the margin of error. \pz
The value $X$ will most often be a statistical measure of the parameter
through some survey. \pb
\end{definition}

For example, ``There is a 95\% chance that the between
48 and 52\% of registered voters approve of the job President Bush  is
doing.'' \pz  This is pretty close to the standard statement ``50\% of registered
voters surveyed approve of the job President Bush is doing, with a margin
of error of $\pm 2\%$.  \pz  (The standard statement leaves out the ``95\%
chance bit'' - we will see that they are being a bit misleading.) \pb

We would like to construct confidence intervals just from having survey
data.  \pz But what we do as a first step is to construct them  {\em
assuming we already know the standard deviation of the distribution from 
which they are sampled} by using the Central Limit Theorem. \pz 

\begin{example}
Suppose we know that the standard deviation for new car purchases
is \$3000 \pz and we run a survey of 700 purchases which finds a 
mean purchase price of 23,142.  Find a confidence interval for the 
actual mean with a 95\% certainty.   \pz  or with 99.7\% certainty. \pz
\end{example}

Our method is to use the Central Limit Theorem to find the deviation
for the sample distribution; \pz then just note that if the sample
mean is within two deviations of the true mean then the true mean
is within two deviations of the sample mean (duh) and this happens
95\% of the time; \pz so we the confidence interval will 
be within two (adjusted) deviations of the survey mean. \pz

\begin{example}
We know that the standard deviation for heights of women over the
entire U.S.  cannot be more than $5$ inches.  Suppose
that we find a random sample of 400 women which has
an average height of $63.5$ inches.   Establish a confidence
interval for the true average height of women, with a confidence
of 90\%. \pz
\end{example}

It is remarkable how such a small sample can give a pretty small
margin of error with 90\% certainty. \pz

Another way to think about confidence intervals is to think about 
running multiple samples and keep track of the number of times 
that the mean is within our confidence interval.  We look at the
previous example. \pb




\end{document}
 