%Include [twoside] option after \documentclass for two-sided printing.
%\documentclass{article}
\documentclass[twoside]{article}
%The following imports commands created for formatting for SIAST lecture notes.
%This is custom-made and not part of a latex install
\usepackage{lectures}
%The following imports a custom set of stat symbol definitions
\usepackage{statssymbols}
%Define a name for your course here.  At the end, set the course counter to
%the one to compile.  Note there is no MAT_201 probability unit but we
%leave the entry here for consistency.
%Note that custom content can be introduced by using this with the \switch
%command. 
% MAT_201 (EDDT statistics unit)
\newcommand{\eddt}{1}
% STAT_201 (Civil, Environmental, Water Statistics}
\newcommand{\cew}{2}
% STAT_220 (Geomatics stats)
\newcommand{\geo}{3}
\newcounter{coursecounter}
% Set the course to compile here:
\setcounter{coursecounter}{\geo}
%Define your course info here
\institution{SIAST Palliser Campus}
\department{Mathematics}
\switch[\value{coursecounter}=]
\case{\cew}\course{STAT 201}\unitnumber{2}
\case{\geo}\course{STAT 220}\unitnumber{2}
\endswitch
\unittitle{Probability Theory and Distributions}
\date{January 2011}
\author{Blake Friesen and Robert G. Petry}
%Note that the publisher is just the distributor of the printed copies and
%has no other claim on the document.  (See the GFDL license.)  It can be
%either a person or entity.
\publisher{the Department of Mathematics, SIAST Palliser Campus}
\begin{document}
%Create title page
\makeunittitle
%Include the copyright, etc. page.  Placed in a separate latex file for
%convenience.
\input{copyright}
%Make a table of contents.
\customtableofcontents
%Reset the pages to start the actual content and change to arabic numbering
%since \makeunittitle set it to roman numerals.
\setcounter{page}{1}
\pagenumbering{arabic}
\section{Basic Probability}
\subsection{Definitions of Probability}
\label{sec:defnprobability}
\subsubsection{Subjective Probability}
The \textbf{subjective} approach to probability is a method to express
the strength of one's belief in the future occurrence of an event.
The beliefs are usually based upon past experience or prior knowledge.
Probability is assigned to an event as a number on a continuum between
0 and 1 in this fashion.
\begin{center}
\includegraphics[width=3.5in]{image3-2.png}
\end{center}
\example{A biologist estimates that there is a 75\% chance that if
  burrowing owls are reintroduced to an area of southern Saskatchewan
  that they will survive.  What does the number mean and how would a
  biologist arrive at this number?}

\subsubsection{Experimental  Probability}
The \textbf{relative frequency} definition of probability relates the
expected future rate of occurrence to what has happened in the
past. The difference between this and subjective probability is that
in the relative frequency definition an experiment is done and we
refer to it therefore as \textbf{experimental probability}.  To find
the experimental probability of an event, repeat an experiment $F$
times.  Observe the number of times the event happened, the frequency
$\f$, out of the total number of times the experiment was repeated,
$F$.  The probability of the event is then
\[P(\mbox{event})=\frac{\mbox{Frequency of occurrence of event}}{\mbox{Number
    of repetitions}}=\frac{\f}{F}\]
Thinking back to our discussion of frequency distributions in Unit~1
we note that $F=\sum\f$ where the sum counts the frequencies of all
the possible outcomes, and hence the number of experiments done.

\example{In a busy shopping mall, the question was put to 10 different
  people: ``Are you in favour of extended store hours?''  7 people
  replied that they were.  Based on these results, what is the
  probability that the next person asked would be in favour?
  \[P(\mbox{in favour}) = \frac{\f}{F}=\frac{7}{10} = 0.7\] } Notice
that we have already done these calculations extensively in Unit~1.
There we would have calculated the relative frequency or proportion
$P$ of an outcome.  The calculation (and symbol) is identical for
experimental probability but the interpretation is different.  Now we
use the proportion to infer the probability that an individual shopper
chosen at random in the mall will be in favour of extended store
hours.  In the following exercise we illustrate the meaning of
probability as a relative frequency of occurrence (experimental probability).

\example{Take 4 coins and shake them fairly by allowing them to drop
  unobstructed on smooth surface. Repeat this experiment 64 times. In
  the 8 x 8 grid below record the number of heads that occur on a
  repetition of the experiment in each cell.  Count the frequency of
  each value and record your results in the table on the right:
  
\begin{tabular}{|m{4ex}|m{4ex}|m{4ex}|m{4ex}|m{4ex}|m{4ex}|m{4ex}|m{4ex}|}\hline
\rule{0ex}{4ex} & & & & & & & \\ \hline
\rule{0ex}{4ex} & & & & & & & \\ \hline
\rule{0ex}{4ex} & & & & & & & \\ \hline
\rule{0ex}{4ex} & & & & & & & \\ \hline
\rule{0ex}{4ex} & & & & & & & \\ \hline
\rule{0ex}{4ex} & & & & & & & \\ \hline
\rule{0ex}{4ex} & & & & & & & \\ \hline
\rule{0ex}{4ex} & & & & & & & \\ \hline
\end{tabular}~{\Large$\Rightarrow$}~
{\large
\begin{tabular}{|c|c|c|}\hline
  \X(heads) & \f & $P(\X)$ \\ \hline
  0 & \rule{8ex}{0ex} & \rule{8ex}{0ex} \\
  1 & & \\
  2 & & \\
  3 & & \\
  4 & & \\ \hline
  & $\sum\f=~~~~$ & $\sum P(\X)=~~~~$\\\hline
\end{tabular}
}

Graph the results below with  7 intervals on the horizontal axis and the
number of heads as the midpoint of each interval. Plot P(X) on the
vertical axis.
\begin{center}
\includegraphics[width=5in]{image3-4.png}
\end{center}

Interpretation:
\begin{enumerate}
\item If $P(\X)$ means the relative frequency of the occurrence of \X\ heads,
what does $P(1)$ mean?
\item What is $P(1)$ specifically in your table?
\item How many times would you expect to get 1 head in the future, based
on what has happened in this experiment, if you flipped 4 coins 200
times?
\item What is the shape of the distribution curve?
\item By examining the distribution curve, what is an estimate of the
mean of the distribution of heads upon flipping 4 coins?
\item Calculate the mean and standard deviation of the distribution of
heads from the data in the table. (Use \smean\ and \sdev\ . Why?)
\item If 4 coins are flipped, what is the probability of getting 2
heads?  Why isn't it 0.5?
\item  What is the area under the P(X) histogram?
\item Would someone else's determination of the experimental probability be identical with yours?
\end{enumerate}
}
\subsubsection{Theoretical Probability}
The \textbf{theoretical} or \textbf{classical} approach to probability
is based upon determining the total number of possibilities in advance
of taking the action.  The set of possibilities is called the
\textbf{sample space} or \textbf{universe}. In this case let $n$ be
the number of possibilities associated with the event while $N$ is the
total number of outcomes associated with the action to be taken
(i.e. the size of the sample space).  If the events in the sample
space are \textbf{equally likely} then the theoretical probability of
an event is:
\[P(\mbox{event})=\frac{\mbox{Possible ways for event to happen}}{\mbox{Total number of possibilities}}=\frac{n}{N}\]

\example{A group of four contains two males and two females.  A
committee of 2 is to be struck by drawing lots.  What is the
probability that the committee consists of two females? Count the
possibilities.
\begin{center}
\includegraphics[width=4in]{image3-1.png}
\end{center}
\[P(\mbox{two female committee})=\frac{n}{N}=\frac{1}{6} = 0.17\] }
\reading{Read the text pages 114 to 119} The theoretical probability
is unique; assuming we do our calculations correctly we will all get
the same answer.  One could have calculated an experimental
probability for this event by writing the six possible pairs on slips
of paper and drawing them out of a hat repeatedly.  In that case
different experimental probabilities for the event would not likely
have been exactly $1/6$ but would have been close to the true
theoretical probability.  The experimental probability will converge
to the theoretical probability as $F$, the number of experiments
performed, increases.  In symbols the actual (theoretical) probability
satisfies
\[P(\mbox{event})=\lim_{F\rightarrow\infty}\frac{\f}{F}\]
where \f\ is the number of occurrences of the event in the $F$
experiments and $\infty$ means positive infinity.\footnote{Such
  statements regarding convergence of empirically measured values to
  the actual (theoretical) values is embodied in statistical theorems
  such as the \textbf{law of large numbers}.}

If the probability is calculable theoretically, then this is preferable to
an experimental probability.  However many systems are too complicated to have
probabilities calculated theoretically.  For instance there is no way
a theoretical calculation of probability may be done to find the
probability a shopper is in favour of extended store hours.

In Case Study 3 of Unit 1 a game designer was interested in
determining the proportion (probability) of the sum on two 3-sided
dice.  The designer effectively calculated an experimental probability
for the possible events (2,3,4,5,6).  The object of the next exercise
is to illustrate the theoretical/classical meaning of probability as a
proportion in the sample space of all possibilities.
\clearpage
\example{Suppose two three-sided dice\footnotemark\ are to be rolled
  so that they land fairly.  We are interested in the probability of
  obtaining a specific sum on the two faces.  The sample space
  consists of the following equally likely outcomes (left).  List all
  of the possible sums on the faces of the dice by filling the
  appropriate sum inside the square on the grid to the right.

\begin{center}
%The spacing below should be set up in a cleaner fashion.
\begin{tabular}{|ccc|}\hline
~\rule[-2ex]{0ex}{6ex}\Cube{1}\,\Large\epsdice{1}~ & ~\rule[-2ex]{0ex}{6ex}\Cube{1}\,\Large\epsdice{2}~ & ~\rule[-2ex]{0ex}{6ex}\Cube{1}\,\Large\epsdice{3}~\\ 
~\rule[-2ex]{0ex}{6ex}\Cube{2}\,\Large\epsdice{1}~ & ~\rule[-2ex]{0ex}{6ex}\Cube{2}\,\Large\epsdice{2}~ & ~\rule[-2ex]{0ex}{6ex}\Cube{2}\,\Large\epsdice{3}~\\ 
~\rule[-2ex]{0ex}{6ex}\Cube{3}\,\Large\epsdice{1}~ & ~\rule[-2ex]{0ex}{6ex}\Cube{3}\,\Large\epsdice{2}~ & ~\rule[-2ex]{0ex}{6ex}\Cube{3}\,\Large\epsdice{3}~\\ \hline
\end{tabular}~~~{\Large$\Rightarrow$}~~~%
\begin{tabular}{|c||m{5ex}|m{5ex}|m{5ex}|}\hline
~~\rule[-2ex]{0ex}{6ex}\Cube{1}~~ & & & \\ \hline
\rule[-2ex]{0ex}{6ex}\Cube{2} & & & \\ \hline
\rule[-2ex]{0ex}{6ex}\Cube{3} & & & \\ \hline\hline
\rule[-2ex]{0ex}{6ex}Sum\raisebox{.5em}{$\nearrow$}& ~~\Large\epsdice{1} & ~~\Large\epsdice{2} & ~~\Large\epsdice{3} \\ \hline
\end{tabular}
\end{center}

Summarize your findings in the table below and draw the graph of the
observations to the right.  You may want to compare your results to
the relative frequencies (\rel) found experimentally in Case Study~3 of
Unit~1.
\begin{center}
\begin{tabular}{|c|c|c|}\hline
  \X(Sum) & $n$ & $P(\X)$ \\ \hline
  2 & \rule{8ex}{0ex} & \rule{8ex}{0ex} \\
  3 & & \\
  4 & & \\
  5 & & \\
  6 & & \\ \hline
  & $N=~~~~~~~$ & $\sum P(\X)=~~~~~~~$\\\hline
\end{tabular}~{\Large$\Rightarrow$}\raisebox{-4.4em}{\includegraphics[width=3.5in]{image3-4.png}}
\end{center}

Interpretation:
\begin{enumerate}
\item If $P(\X)$ means the probability of rolling a sum of \X, what does
$P(3)$ mean?
\item If two dice were rolled 180 times, how many times would you expect
to see a sum of 3?
\item Describe the shape of this distribution.
\item What is the mean of the distribution of sums?  Use \pmean\ not \smean .  (Here treat the $n$ column as frequency $\f$ and use our formulae from Unit~1.)
\item What is the standard deviation of the distribution of sums? Use \pdev\ not \sdev.
\item How does the area under the curve compare to the sum of the P(X)
column?
\item What is wrong with the argument, ``There are five possible sums (2, 3, 4, 5, 6) so the probability of any one of them is $\frac{1}{5}$''\,? 
\end{enumerate}
}
\footnotetext{Recall our \emph{three-sided} die is created by
  labelling two sides of a six-sided die with a 1, two sides with a 2,
  and two-sides with a 3.  Would the above analysis be appropriate if
  three sides were labelled with a 1, two sides with a 2, and one side
  with a 3?  How would the above analysis have to change?}
\clearpage
\subsection{Counting Outcomes}
\label{sec:countingoutcomes}
We already know from Unit~1 how to determine experimental probability,
it is just the relative frequency, \rel.  To compute the probability
of an event theoretically it is necessary to count the number of
\textbf{outcomes} associated with both the \textbf{event} and the
\textbf{sample space} of equally likely outcomes.  There are various
mathematical methods to assist in counting outcomes.
\subsubsection{Tree Diagrams}
\textbf{Tree Diagrams} list, in a tree structure, each of the steps in
an experiment together with all possible outcomes at that step.  Each
path represents a possible outcome of the total experiment.  \example{
  Two coins are flipped.  Show all possible outcomes.
\begin{center}
\includegraphics[width=3in]{image3-7.png}
\end{center}
}
\subsubsection{The Counting Theorem}
The \textbf{Counting Theorem} gives the total number of possibilities,
without listing each possibility, in a tree structure. This is useful
in cases where it is not practical to draw the tree structure because
it has too many paths. List each step in the experiment and determine
the number of possible ways each step can be done. The number of ways
of doing the whole experiment is found by multiplying the number of
possibilities at each step in the experiment.
\example{For the experiment of flipping two coins:
\[\underbrace{(2)}_{\fbox{Coin 1}}\cdot\underbrace{(2)}_{\fbox{Coin 2}}=4\ \mbox{possibilities in total}\]
}
\subsubsection{Factorial}
A \textbf{factorial} is a mathematical formula encountered in
counting outcomes.  It is denoted as $n!$ and is calculated as follows:
\[\boxed{n! = n\cdot(n - 1)\cdot(n - 2)\cdot(n - 3)\cdot\ldots\cdot 3\cdot 2 \cdot 1}\]
The factorial $n!$ is the number of ways of \textbf{arranging} $n$ items
since, using the counting theorem, after the first slot is filled in
one of $n$ ways, the second slot can be filled in $(n-1)$ ways, etc.
\example{In how many ways can five children be arranged in five
  different seats in a minivan?
\[5! = 5\cdot 4\cdot 3\cdot 2\cdot 1 = 120\ \mbox{ways}\]
}
Find the $\boxed{n!}$ key on your calculator and show that $5! = 120$. 

Notice that factorials increase in value very quickly.
$20!=2.4329020\times 10^{18}$ on your calculator.  ( i.e. move the
decimal 18 places to the right.) $800!$ exists but is too large for
calculation purposes on your calculator. Finally note that by
definition $0!=1$ not $0$ as may be verified on your calculator.

\subsubsection{Permutations}
An \textbf{arrangement} of the letters $a$ to $e$ could be written
$(c,e,b,a,d)$, where parentheses have been used, just as when we plot
points, to remind us that the \textbf{order matters}.  Such an
arrangement is called a \textbf{permutation} and we have seen that
$n!$ gives us the number of ways of arranging $n$ objects, or in other
words, the number of permutations of the $n$ objects. Sometimes we
want to count the number of ways of arranging fewer than all the
objects.  A permutation where we have selected only 3 of the 5 letters
from $a$ to $e$ could be $(c,e,b)$.  The \textbf{permutation formula}
\perm{n}{r} counts the number of different permutations of $r$ objects
taken from $n$ distinct objects.  It equals\footnote{To see why this
  is the formula, note by the counting theorem that there are $n$ ways
  to pick the first item, $(n-1)$ ways to pick the second, $\ldots$,
  and $(n-r+1)$ ways to pick the $r^{\mbox{\tiny th}}$.  The number
  of ways to pick an arrangement is therefore
  $n\cdot(n-1)\cdot\ldots\cdot(n-r+1)$ which equals the permutation
  formula since the denominator cancels the lower terms from $(n-r)$
  to 1 in the $n!$\ .}
\[\boxed{\perm{n}{r}=\frac{n!}{(n-r)!}}\ \leftarrow\ \mbox{no repetitions are allowed}\]
\textbf{No repetitions} of the same element are allowed in a
permutation of distinct objects.

If repetitions of the same element are allowed in an arrangement, then
the number of arrangements of $r$ objects taken from the $n$ objects
is, by the counting theorem,
\[\boxed{\underbrace{(n)\cdot(n)\cdot \ldots \cdot(n)}_{\mbox{\small $r$ times}}=n^r}\ \leftarrow\ \mbox{repetitions are allowed}\]
In such a situation we would be allowed to count the arrangement
$(a,a,d)$ if we were counting arrangements of 3 objects taken from $a$
to $e$ with repetition.
\example{Suppose two objects to be selected from the collection $\{a, b,
c\}$.  How many arrangements are possible?
\[\perm{3}{2}=\frac{3!}{(3-2)!}=\frac{3\cdot2\cdot1}{1}=6\ \ \mbox{with no repetitions}\]
\[3^2=9\ \ \mbox{with repetitions}\]
Find your calculator key
$\boxed{\perm{n}{r}}$ and evaluate the above expression directly.  As
a check here is the list of the possible arrangements:
\begin{center}
\includegraphics[width=5in]{image3-9.png}
\end{center}
}
\subsubsection{Combinations}
Sometimes order is not important in a counting problem.  For instance,
if you wanted to know in how many ways you could select three of your
five friends to go on a trip with you, the order of the three selected
would be meaningless.  A \textbf{combination} is such a selection. A
combination of 3 items selected from the letters $a$ to $e$ would be
$\{b,c,e\}$.  We use braces here to remind us that order is not
meaningful.  (The same combination could be written $\{c,b,e\}$.)  The
\textbf{combination formula} counts the number of different
\textbf{selections} of $r$ objects taken from $n$ objects.  It is
written \com{n}{r} and calculated as\footnote{The extra $r!$ in the
  denominator of \com{n}{r} versus \perm{n}{r} deals with the fact
  that the $r!$ permutations of the selected objects are equivalent as
  a combination where order is irrelevant.}
\[\boxed{\com{n}{r}=\frac{n!}{r!(n-r)!}}\]
\example{Suppose two objects are to be selected from the
collection \{a, b, c\}.  How many selections are possible?
\[\com{3}{2}=\frac{3!}{2!(3-2)!}=\frac{3\cdot2\cdot1}{2\cdot1\cdot1}=3\]
Find your calculator key $\boxed{\com{n}{r}}$ and evaluate the above
expression directly.  As a check here is the list of the possible selections:
\[\boxed{~~\{a, b\},~  \{a, c\},~  \{b, c\}~~}\]
You cannot bypass the combination formula with the counting theorem.
} 
\subsubsection{Contingency Tables}
\textbf{Contingency Tables} cross tabulate a data array where the
outcomes consist of two factors into a summary table.

\example{A die is rolled and a coin is tossed at the same time.   A person interested in determining the probability of the joint result using relative frequency summarizes the results of 100 experiments in the following contingency table:
\begin{center}
\includegraphics[width=4in]{image3-10.png}
\end{center}
Notes:
\begin{enumerate}
\item The totals at the side and bottom of the table are called \textbf{marginal
    frequencies}. The outcomes included in a marginal frequency have
  only one attribute.  For example, of the hundred trials, heads
  occurred 46 times. 46 is a marginal frequency.

\item The numbers inside the table are called \textbf{joint
    frequencies}. The outcomes included in a joint frequency have two
  attributes. For example, of the hundred trials, on 9 occasions the
  coin turned up heads and the face on the die was a 4.

\item Note that we could have placed these results in a single column
  frequency table with 12 entries where the first variable value was
  $\X=(\mbox{heads},1)$ with frequency 9 and the last was
  $\X=(\mbox{tails},6)$ with frequency 10.  Obviously the contingency
  table for displaying the frequencies is preferable.

\item Later we will use contingency tables for theoretical probability
  where the entries correspond to the number of elements of the sample
  space corresponding to the event.  If we had done that here, what
  would the table have looked like?
\end{enumerate}
}
\newcommand{\countinganswer}{
  \begin{enumerate}
  % Note the vspace is critical to get the graphic top aligned, even if 0 space
  \item \parbox[t]{2in}{\vspace{-1em}\includegraphics[width=2in]{image3-50.png}}
  \item 1710
  \item 6
  \item 15
  \item \begin{enumerate}\item 4845 \item 116,280 \item 160,000 \end{enumerate}
  \item \parbox[t]{2in}{\vspace{-1em}\tiny \begin{tabular}{|l|c|c|c|}\hline
      & \parbox{6em}{\centering Gas Station Operators} & \parbox{6em}{\centering Fast Food Outlets} & Totals \\ \hline
      For Bylaw & 10 & 20 & ~30 \\
      Against Bylaw & 50 & 20 & ~70 \\ \hline
      Totals & 60 & 40 & 100 \\ \hline
    \end{tabular}}
  \item The tree has 12 paths
  \item 13,983,816
  \item 404,550
  \end{enumerate}
}
\assignment{\answer{\protect\countinganswer}
\begin{enumerate}
\item A white jar and a blue jar each contain a collection of chips. 
Some of the chips are red and some are green.  A jar is chosen at
random and a chip is randomly chosen from it.  Construct a tree diagram
of the sample space of outcomes for this experiment.
\item A company is selecting a new president and vice president.  There
are 15 females and 100 males on staff.  How many possible ways does the
company have of selecting a president and vice president if the
president must be female but there are no restrictions on the choice of
a vice president?
\item Three newly hired people are to be assigned to 3 different
regions.  How many different arrangements are possible if a person can
be assigned to any of the regions?
\item Six newly hired people are to be paired into teams.  How many
different pairs can be formed?
\item A high school science fair has 20 participants.  In how many ways can
\begin{compactenum}
\item four students be chosen to move on to the regional science fair?
\item the four awards -- $1^{\mbox{\scriptsize st}}$, $2^{\mbox{\scriptsize nd}}$, $3^{\mbox{\scriptsize rd}}$, and $4^{\mbox{\scriptsize th}}$ place -- be awarded? 
\item the four awards -- \emph{best new idea}, \emph{best use of math}, \emph{best presentation}, and \emph{best sweet-talking of judges} -- be awarded?
\end{compactenum}
\item A survey of 100 business people showed that 30 were for and 70
were against a bylaw.  Ten of those for the bylaw were gas station
operators, 20 against the bylaw were fast food outlet managers.  If
only gas station operators and fast food outlet owners were included in
the survey, construct a contingency table of the survey results.
\item A builder builds 3 different models of homes.  Each home has the
option of two different floor plans and comes with or without an
attached garage.  Draw a tree diagram that lists all possible
arrangements of homes built by the builder.
\item The integers from 1 to 49 are written on a sheet of paper. A
person is asked to cross out 6 of the integers. In how many ways can
this task be completed? 
\item  Calculate the value of: \com{900}{898}  
\end{enumerate}
}
\clearpage
\subsection{Set Theory and Counting Outcomes}
\subsubsection{Events are Sets!}
\textbf{Set Theory} is a useful means of identifying events,
combinations of events and numbers of outcomes in the sample space.  A
\textbf{set} is just a collection of objects called \textbf{elements}.
For instance the set of playing cards in a standard deck would be,
graphically,
% A colour deck is also available in the playing_cards directory.
\begin{center}
\fbox{\includegraphics[width=4in]{bw_deck}}\ ,
\end{center}
and an element in the set would be the the king of spades,
$K\spadesuit$.  An \textbf{experiment} involves making a measurement
or observation.  The outcome of a single experiment is called a
\textbf{simple event}.  For example, if we consider the experiment of
drawing a single card from the deck, then a \textbf{simple event}
could be drawing the king of spades.  Hence we can identify a simple
event with a set element.  The \textbf{sample space}, $\bm\samspa$, is
the set of all such simple events, in this case the set containing the
entire deck.

A subset of \samspa\ would also be a set.  For example, the set $\bm
Q$ of queens in a deck of cards is
\[\bm Q=\{Q\spadesuit,Q\clubsuit,Q\heartsuit,Q\diamondsuit\}\ .\]
Since order is irrelevant for a set we use braces \{~\} when writing it down
here as we did for listing combinations.  The connection between sets
and probability is that we can represent the \textbf{event} of drawing
a queen by its \textbf{set} of corresponding simple events in the
sample space. The \textbf{number of elements} in a set we will write
as $\bm{n(~)}$.  Here $n(Q)=4$.

Pictorially it is useful to represent the set $\textbf{\samspa}$ of
all simple events in the sample space with a rectangular box.  For the
experiment of drawing a single card from a deck of cards the sample
space is just the deck shown in the box above.  A particular event $A$
(i.e. its set) will be some subset of these outcomes, which we can
represent with a circle or oval inside the box.  Such a diagram is
called a \textbf{Venn~Diagram}.

In a Venn Diagram one does not usually draw the simple events like the
cards above.  Rather one draws the events as circles and visualizes
their contents and potential overlap with other sets.  The dice in the
following examples will be shown explicitly in this section to aid in
understanding the concepts but a real Venn Diagram would not contain
them.
\clearpage
\example{Suppose a die is rolled. Let $\bm \samspa$ represent the
  sample space. Let \textbf{$\bm A$ be the event the die is even}.
  Draw a Venn Diagram and count the number of simple events in the sample
  space and event $A$.}{%
\begin{center}
\parbox[c]{2in}{\vspace{0em}\resizebox{2in}{!}{\input{set_theory.pdf_t}}}
\begin{minipage}[c]{4in}
\begin{eqnarray*}
\bm \samspa & = & \mbox{all outcomes in the sample space}\ =\ \{1, 2, 3, 4, 5, 6\} \\
\bm A & = & \mbox{all outcomes that are even}\ =\ \{2, 4, 6\} \\
\bm{n(\samspa)} & = & \mbox{number of outcomes in the sample space}\ =\ 6 \\
\bm{n(A)} & = & \mbox{number of outcomes in event $A$}\ =\ 3
\end{eqnarray*}
\end{minipage}

*Visualize or shade in the event $\bm A$ in the Venn Diagram.*
\end{center}
}
\subsubsection{Complement of an Event}
The \textbf{complement of an event}, written $\bm{\NOT A}$, is the
collection of all simple events in the sample space that are
\textbf{not} in $A$.  The number of simple events in the complement of
an event must satisfy
\[\boxed{n(A)+n(\NOT A)=n(\samspa)}\]
since all outcomes in the sample space belong either to $A$ or its
complement, and these do not overlap.
\example{Identify
  the complement $\NOT A$ of $A$ of the previous example and find the
  number of its elements directly and by formula.}{%
\begin{center}
\parbox[c]{2in}{\vspace{0em}\resizebox{2in}{!}{\input{set_complement.pdf_t}}}
\begin{minipage}[c]{4in}
\begin{eqnarray*}
\bm{\NOT A} & = & \mbox{the nonoccurrence of event $A$}\ =\ \{1, 3, 5\} \\
\bm{n(\NOT A)} & = & \mbox{number of outcomes in $\NOT A$}\ =\ 3\ \ (\mbox{counting directly}) \\
\bm{n(\NOT A)} & = & n(\samspa)-n(A)\ =\ 6 - 3\ =\ 3\ \ (\mbox{by formula})
\end{eqnarray*}
\end{minipage}

*Visualize or shade in the event $\bm{\NOT A}$ in the Venn Diagram.*
\end{center}
}
\subsubsection{Intersection of Events}
Just as we were able to create a new event by taking the
complement of an event, we can also combine several events to create a
new event.  The \textbf{intersection of events} is the region of
overlap of events.  For two events it is written $\bm{A\ \AND\ B}$\ .
It is sometimes called the \textbf{joint event} because two things
have to happen at the same time for this event to happen.
\example{Consider the previous problem of rolling the die. Suppose $A$
  is the event previously defined (an even number).  Let \textbf{$\bm
    B$ be the event event of rolling a number greater than 3}.  Let
  \textbf {$\bm C$ be the event of rolling a 5}.  Draw a Venn Diagram
  of the sets, find their mutual intersections, and count the elements
  in each set.}{%
\parbox[c]{2in}{\vspace{0em}{\resizebox{2in}{!}{\input{set_intersection.pdf_t}}}}\begin{minipage}[c]{4in}
\begin{eqnarray*}
\bm B & = & \mbox{all outcomes in event $B$}\ =\ \{4, 5, 6\} \\
\bm C & = & \mbox{all outcomes in event $C$}\ =\ \{5\} \\
\bm{A\ \AND\ B} & = & \mbox{all outcomes in both $A$ and $B$}\ =\ \{4, 6\} \\
\bm{B\ \AND\ C} & = & \mbox{all outcomes in both $B$ and $C$}\ =\ \{5\} \\
\bm{A\ \AND\ C} & = & \mbox{all outcomes in both $A$ and $C$}\ =\ \{\}
\end{eqnarray*}
\centering\parbox{3in}{\raggedright Note that the event $\bm{B\ \AND\ A}$ is the same as $\bm{A\ \AND\ B}$ so there are no more possible intersections between two events.}
\end{minipage}

The counts in each set are:
\begin{eqnarray*}
\bm{n(B)} & = & \mbox{number of outcomes in event $B$}\ =\ 3 \\
\bm{n(C)} & = & \mbox{number of outcomes in event $C$}\ =\ 1 \\
\bm{n(A\ \AND\ B)} & = & \mbox{number of outcomes in event $A\ \AND\ B$}\ =\ 2 \\
\bm{n(B\ \AND\ C)} & = & \mbox{number of outcomes in event $B\ \AND\ C$}\ =\ 1 \\
\bm{n(A\ \AND\ C)} & = & \mbox{number of outcomes in event $A\ \AND\ C$}\ =\ 0
\end{eqnarray*}
*Visualize or shade in the event $\bm{A\ \AND\ B}$ and the event $\bm{B\ \AND\
C}$ in the Venn Diagram.*}

\subsubsection{Mutually Exclusive Events}
In the last example the intersection of events $A$ and $C$ was empty,
$A\ \AND\ C=\{\}$. If an event has no outcome, it is called the
\textbf{empty set} and is denoted by the symbol $\bm\varnothing$.  If
two events have as their intersection $\varnothing$ they are called
\textbf{mutually exclusive}.  The following are all equivalent:
\begin{enumerate}
\item Event $A$ and event $C$ are \textbf{mutually exclusive}.
\item Event $A$ and event $C$ are \textbf{disjoint}.
\item Event $A$ and event $C$ have no overlap.
\item Event $A$ and event $C$ cannot happen at the same time, $P(A\ \AND\ C)=0$\ .
\item $A\ \AND\ C=\{\}=\varnothing$
\item $n(A\ \AND\ C)=0$
\end{enumerate}

\subsubsection{Union of Events}
Another way to create new events from other events is to take their
union.  The \textbf{union of events} is the collection of all the
simple events in the events combined. For two events it is written
$\bm{A\ \OR\ B}$\ .  It contains all the simple events in $A$ together
with all the simple events in $B$ \textbf{including the joint simple
  events in both}.  The number of outcomes in $A\ \OR\ B$ can be
written in terms of the number simple events in the events $A$, $B$,
and $A\ \AND\ B$ as follows:
\[\boxed{n(A\ \OR\ B)=n(A)+n(B)-n(A\ \AND\ B)}\]
Here we have to subtract the number of elements in $A\ \AND\ B$
because otherwise the elements that are in both $A$ and $B$ get
counted twice.  \example{Consider the previous experiment of rolling a
  single die where $A$ is rolling an even number and $B$ is rolling a
  number greater than $3$.  Find the union of the events, the number
  of simple events it contains, and show that the above formula for
  calculating the number of simple events holds.}{%
\vspace{1em}
\parbox[c]{2in}{\vspace{0em}{\resizebox{2in}{!}{\input{set_union.pdf_t}}}}
~\begin{minipage}[c]{3.5in}
\begin{eqnarray*}
\bm{A\ \OR\ B}~ & = & \mbox{all outcomes in either event $A$ or event $B$}\ =\ \{2, 4, 6, 5\} \\
\bm{n(A\ \OR\ B)} & = & \mbox{number of outcomes in $A\ \OR\ B$}\ =\ 4\ \ (\mbox{counting directly}) \\
\bm{n(A\ \OR\ B)} & = & n(A)+n(B)-n(A\ \AND\ B)\ =\ 3+3-2\ =\ 4\ \ (\mbox{by formula})
\end{eqnarray*}
~~~~~~~~Note that the event $\bm{B\ \OR\ A}$ is the same as $\bm{A\ \OR\ B}$.
\end{minipage}

\begin{center}*Visualize or shade in the event $\bm{A\ \OR\ B}$ in the Venn Diagram.*\end{center}
}

In the case of  disjoint or mutually exclusive events we have the following special case formula, since $n(A\ \OR\ C)=0$,
\[\boxed{n(A\ \OR\ C)=n(A)+n(C)\ \ \ (\mbox{$A$, $C$ mutually exclusive})}\]
There is no overlap so we can just add the number of events.
\example{Consider the previous experiment of rolling a single die
  where $A$ is rolling an even number and $C$ is rolling a 5.  Find
  the union of the events, the number of simple events it contains, and show
  that the above formula for calculating the number of outcomes holds.}{%
\vspace{1em}
\parbox[c]{2in}{\vspace{0em}{\resizebox{2in}{!}{\input{set_disjoint.pdf_t}}}}
~\begin{minipage}[c]{3.5in}
\begin{eqnarray*}
\bm{A\ \OR\ C}~ & = & \mbox{all outcomes in either event $A$ or event $C$}\ =\ \{2, 4, 6, 5\} \\
\bm{n(A\ \OR\ C)} & = & \mbox{number of outcomes in $A\ \OR\ C$}\ =\ 4\ \ (\mbox{counting directly}) \\
\bm{n(A\ \OR\ C)} & = & n(A)+n(C) =\ 3+1\ =\ 4\ \ (\mbox{by formula for m.e. events})
\end{eqnarray*}%
\end{minipage}
\begin{center}*Visualize or shade in the event $\bm{A\ \OR\ C}$ in the Venn Diagram.*\end{center}}

Note that the union event $A\ \OR\ B$ includes the outcomes for which both
$A$ and $B$ occur.  If one means to exclude the overlap of events,
then the term \textbf{exclusive or} may be used.  We will never mean
this when we use the word \emph{or} in this course. Thus if you have a
BLT sandwich for lunch and you are asked if you had bacon or lettuce
for lunch the answer is logically yes; you are included in
$\bm{B\ \OR\ L}$.

\subsubsection{Other Notation}
We list here other common notation which occur equivalent to ours above:
\begin{center}
\begin{tabular}{l|c|c}\toprule
complement & $\NOT A$ & $A^c$ \\
intersection & $A\ \AND\ B$ & $A \cap B$ \\
union & $A\ \OR\ B$ & $A \cup B$ \\ \bottomrule
\end{tabular}
\end{center}
The notation on the right for intersection and union comes from set
theory.  Because we wish to emphasize the logic in events we will use
``\AND'' and ``\OR'' directly in our notation.
\newcommand{\setanswer}{
\begin{enumerate}
\item
\begin{enumerate}
\item $n(Sx)= 4$
\item $n(\NOT Sx) = 48$
\item $n(Sp\ \AND\ Sx)= 1$
\item $n(Sp\ \OR\ Sx)= 16$
\end{enumerate}
\item
\begin{enumerate}
\item \parbox[t]{2in}{\vspace{-1em}\includegraphics[width=2in]{image3-51.png}}
\item \{1,5,4,8\}, \{5,3\}, \{2,3,4,5,6,7\}, \{8\}, \{4,5\}, \{3\}
\end{enumerate}
\item
\begin{enumerate}
\item \parbox[t]{2in}{\vspace{-1em}\includegraphics[width=2in]{image3-58.png}}
\item 80
\item 20
\item 50
\item $\frac{1}{3}$
\end{enumerate}
\end{enumerate}
}
\assignment{\answer{\protect\setanswer}%
\centering{*Use proper set notation and Venn Diagrams to do the following
questions.*}
\begin{enumerate}
\item In a standard deck of 52 playing cards:
  \begin{enumerate}
  \item How many cards are sixes?
  \item How many cards are not sixes?
  \item How many cards are spades and sixes?
  \item How many cards are spades or sixes?
  \end{enumerate}
\item A graduate of a course is looking for a job.  H is the event that
  the job has a high salary; $P$ is the event that the job has a good
  pension and $F$ is the event that the job has a good future.  
  \begin{enumerate}
  \item Draw a Venn Diagram of all possible jobs and place an integer in
    each separate region within the Venn Diagram.  (Check the answer
    at the back of the study guide to label your regions the same, and then
    proceed to do the next part of the question.)
  \item List the numbers of the regions that correspond to the following
    combinations of events:
    \[\NOT H,  (F\ \AND\ P),  (H\ \OR\ F),  \NOT(H\ \OR\ F\ \OR\ P),  (F \AND\ \NOT H),  (H\ \AND\ F\ \AND\ P)\]
  \end{enumerate}
\item A survey of 100 tourists entering international customs shows the
  following:  60 visited London, 30 visited Rome and 10 visited London as
  well as Rome.
  \begin{enumerate}
  \item Draw a Venn Diagram of the situation.  When you draw the diagram,
    keep in mind that some of the 60 who visited London could have also visited Rome, etc.
  \item How many tourists visited London or Rome?
  \item How many tourists visited neither place?
  \item How many tourists visited only London?
  \item What proportion of the tourists who visited Rome also visited
    London? 
  \end{enumerate}
\end{enumerate}
}
\subsection{Rules Governing Probability}
\label{sec:addrules}
To calculate probabilities more easily, there are some relationships
that can be used that are based upon the previous methods of counting
outcomes.
\subsubsection{Probability of An Event}
Recall the basic rule for classical probability, written in terms of our new notation is:
\[\boxed{P(A)=\frac{n(A)}{n(\samspa)}}\ ,\]
provided \emph{all simple events in the sample space \samspa\ are equally
  likely}.

Since the number of outcomes corresponding to an event must be at
least zero and at most the entire sample space one has $0\le n(A)\le
n(\samspa)$. Dividing each term by $n(\samspa)$ and using the above formula gives
\[\boxed{0\le P(A)\le 1}\ .\]
Make sure that when probabilities are calculated, the answer is in
this range.  While we have used equally likely simple events in
deriving this result, this result and the others derived below do not
require this to be the case.

\subsubsection{Complement Rule}
Dividing our complement counting rule,
\[n(A)+n(\NOT A)=n(\samspa)\ ,\]
by the number of outcomes in the sample space, $n(\samspa)$, gives the following
rule for the probability of a complement event:
\[\boxed{P(A)+P(\NOT A)=1}\]
Often the probability of the complement of an event is easier to
calculate than the event itself.  Calculate that event first and then
use this rule to find the event of interest.

\example{A biologist samples the fish found in the Frenchman River in south-western Saskatchewan with the following results:
\begin{center}
\begin{minipage}{3in}
\begin{tabular}{|l|c|}\hline
Species & \f \\ \hline
Northern Redbelly Dace ($N$) & 2 \\
Fathead Minnow ($F$) & 6 \\
White Sucker ($W$) & 5 \\
Brook Stickleback ($B$) & 3 \\
Iowa Darter ($I$) & 1 \\ \hline
 & $\sum\f = 17$ \\ \hline
\end{tabular}
\end{minipage}
\begin{minipage}{2.5in}
\raggedright
\begin{enumerate}
\item If a fish is selected at random from the sample, what is the probability it is a Brook Stickelback?
\item What is the probability it is not a Brook Stickelback?
\end{enumerate}
Draw a Venn Diagram to identify and count outcomes.
\end{minipage}
\end{center}\clearpage\vspace{-.5in}}{%
% The previous example was inspired by the 1993 article
% FISH SURVEY OF THE SASKATCHEWAN PORTION OF THE MISSOURI RIVER BASIN
% by Bruce R. McCulloch, Department of Zoology, University of Manitoba,
% James R. Duncan, Manitoba Conservation Data Centre
% R. Jeffrey Keith, Saskatchewan Conservation Data Centre
\begin{center}
\parbox[c]{2in}{\vspace{0em}{\resizebox{2in}{!}{\input{brook.pdf_t}}}}
\begin{minipage}{2in}
\begin{enumerate}
\item $\displaystyle \boxed{P(B)}=\frac{n(B)}{n(\samspa)}=\boxed{\frac{3}{17}}$
\item $\displaystyle \boxed{P(\NOT B)}=1-P(B)=\boxed{\frac{14}{17}}$
\end{enumerate}
\end{minipage}~~\vline~~
\begin{minipage}{1.5in}
\raggedright
Notice that because we were asked the likelihood of drawing the fish \textbf{from the sample} and not \textbf{the river} this is actually a theoretical probability calculation.
\end{minipage}
\end{center}
}
\subsubsection{Addition Rules}
Calculating the probabilities of combinations of events, usually
involves either adding or multiplying probabilities.  Addition is
required when the events are combined by the OR operation as will now
be shown.  Multiplication is required when the events are combined by
the AND operation as will be shown in Section~\ref{sec:multrules}.

Our two addition rules for counting events
\[n(A\ \OR\ B)=n(A)+n(B)-n(A\ \AND\ B)~~~~~~~~~~~~~~~~~~\]
\[n(A\ \OR\ B)=n(A)+n(B)\ \ \ (\mbox{$A$, $B$ mutually exclusive})\]
divided by $n(\samspa)$ give the following two addition probability rules, one general and one special case:
\[\boxed{P(A\ \OR\ B)=P(A)+P(B)-P(A\ \AND\ B)}~~~~~~~~~~~~~~~~~\,\]
\[\boxed{P(A\ \OR\ B)=P(A)+P(B)\ \ \ (\mbox{$A$, $B$ mutually exclusive})}\]

These could be extended to include more than two events.  For example
the second rule for the union of three mutually exclusive events is
$\displaystyle P(A\ \OR\ B\ \OR\ C)=P(A)+P(B)+P(C)\ .$

Venn Diagrams and contingency tables are helpful in applying the above rules.

\example{In the previous example, find the probability that a fish randomly selected from the sample is a Brook Stickleback ($B$) or an Iowa Darter ($I$).  Draw a Venn Diagram for the situation.}{%
\begin{center}
\parbox[c]{2in}{\vspace{0em}{\resizebox{2in}{!}{\input{brook_or_iowa.pdf_t}}}}
~~\begin{minipage}{3.5in}
\raggedright The two events are mutually exclusive as a selected fish cannot belong to both species at once.  Using the special case addition rule gives:
\[\boxed{P(B\ \OR\ I)}=P(B)+P(I)=\frac{n(B)}{n(\samspa)}+\frac{n(I)}{n(\samspa)}=\frac{3}{17}+\frac{1}{17}=\boxed{\frac{4}{17}}\]
\end{minipage}
\end{center}
}
\clearpage
\example{The biologist in the previous example also examines the sex of each fish in the sample and presents the data the following contingency table:
\begin{center}
\begin{minipage}{2.8in}
\begin{tabular}{cc|ccccc|c}\hhline{~~|-----|~}
& & \multicolumn{5}{c|}{\textbf{Species}} & \\ \hhline{~~|-----|-}
                  &      & $N$ & $F$ & $W$ & $B$ & $I$ & \multicolumn{1}{c|}{Total} \\ \hline
\multicolumn{1}{|c|}{\multirow{2}{1.5ex}[-.1em]{\shortstack{\bf S\\\bf e\\\bf x}}} & Male & 1 & 4 & 3 & 1 & 0 & \multicolumn{1}{c|}{~9} \\
\multicolumn{1}{|c|}{} & Female & 1 & 2 & 2 & 2 & 1 & \multicolumn{1}{c|}{~8} \\ \hhline{--------}
\multicolumn{1}{c|}{} & Total  & 2 & 6 & 5 & 3 & 1 & \multicolumn{1}{c|}{17} \\ \hhline{~-------}
\end{tabular}
\end{minipage}
\begin{minipage}{3in}
\raggedright
If a fish is selected at random from the sample:
\begin{enumerate}
\item What is the probability that it is female or a Brook Stickelback ($B$)?
\item What is the probability that it is a Northern Redbelly Dace ($N$) or a White Sucker ($W$)?
\item Draw a Venn Diagram.
\end{enumerate}
\end{minipage}
\end{center}

*Use the symbols $M$ and $\NOT M$ for Male and Female, since $F$ is already being used for a fish species.* (Also it is desirable to use the complement in cases like this where there are only two possibilities.)}{%
\begin{enumerate}
\item One notices that it is possible to draw a fish that is both a Brook Stickelback~($B$) and \mbox{Female~($-M$)} so the events are \textbf{not} mutually exclusive.  Using the general addition rule gives:
\begin{eqnarray*}
\boxed{P(B\ \OR\ \NOT M)} & = & P(B)+P(\NOT M)-P(B\ \AND\ \NOT M) \\
 & = & \frac{3}{17}+\frac{8}{17}-\frac{2}{17} \\
 & = & \boxed{\frac{9}{17} = .529}
\end{eqnarray*}
\item As seen in the earlier example, different species are mutually exclusive events.  (In general two rows or two columns on a contingency table will always describe mutually exclusive events.)  Use the special case addition rule:
\[\boxed{P(N\ \OR\ W)}=P(N)+P(W)=\frac{n(N)}{n(\samspa)}+\frac{n(W)}{n(\samspa)}=\frac{2}{17}+\frac{5}{17}=\boxed{\frac{7}{17}=.412}\]
\item The following is a Venn Diagram for the entire situation:
\begin{center}
\parbox[t]{3in}{\vspace{0em}{\resizebox{3in}{!}{\input{fish_species.pdf_t}}}}
\end{center}
\clearpage
Note:
\begin{itemize}
\item Each event labelled is associated with the interior of a particular circle or rectangle.  Its complement is the exterior region.
\item The species circles have been drawn disjoint because we know all
  the species types are mutually exclusive.  (For a general Venn
  Diagram where nothing is known about mutual exclusivity all the
  regions would be drawn to overlap.)
\item The circles slice up the sample space into disjoint regions in which one should imagine there lie all possible outcomes (here fish).  Label each such region with the number of outcomes it contains (the frequency) from the contingency table.  Use the joint frequencies from inside the table, not the marginal frequencies. (Why?)
\item Similarly label each disjoint region with the probability it contains.
\item Any event of interest corresponds to some union of regions in the Venn Diagram for which you can now add up the probability.  Consider the following event\newline
(not a male Fathead Minnow) and (not a female Brook Stickelback)\newline
Shade the region and find its probability.
\end{itemize}
\end{enumerate}
}
\reading{Read your textbook pages 124 to 144}
\vfill
\newcommand{\additionanswer}{
\begin{enumerate}
\item
\begin{inparaenum}[~\;(a)]
\item 0.075
\item 0.925 
\end{inparaenum}
\item
\begin{enumerate}
\item \parbox[t]{2in}{\vspace{-1em}\includegraphics[width=2in]{image3-15.png}}
\item no since $P(C\ \AND\ B)\neq 0$
\item 1.00
\item 0.00
\item 0.5
\end{enumerate}
\item 0.0769
\end{enumerate}
}
\assignment{\answer{\protect\additionanswer}
\begin{enumerate}
\item A bookkeeper records transactions from 40 invoices to a journal. 
3 of the invoices were completed inaccurately. 
\begin{enumerate}
\item An auditor selects one of these transactions at random.  What
is the probability that the transaction is in error?
\item What is the probability that the transaction is not in error?
\end{enumerate}
\item 60\% of all students at a school take Chemistry and 50\% take
Biology.  10\% of all students take both Chemistry and Biology.
\begin{enumerate}
\item Draw a Venn Diagram of the situation.
\item Are the events mutually exclusive?
\item What is the probability that a student takes either Chemistry or
Biology? (Shade the area)
\item What is the probability that a student takes neither Chemistry
nor Biology? (Shade the area)
\item What is the probability that a student takes Chemistry but not
Biology? (Shade the area)
\end{enumerate}
\item A card is selected at random from a standard deck of 52 playing
cards.  What is the probability that the card is either a red five or a
black six?
\end{enumerate}
}
\reading{Exercises in the textbook pages 137 - 139 and 143 -- 145}
\clearpage
\subsection{Conditional Probability and the Multiplication Rules}
\label{sec:multrules}
\subsubsection{Conditional Probability}
A container contains a group of black and white cubes and spheres:
% The following are from the ifsym package (requires the [geometry] option])
%\BigSquare, \Square, \SmallSquare.
%\FilledBigSquare, \FilledSquare, \FilledSmallSquare.
%\BigCircle, \Circle, \SmallCircle.
%\FilledBigCircle, \FilledCircle, \FilledSmallCircle.
\begin{center}
\fbox{\huge\hspace{.05em}
\begin{tabular}{ccccc}\rule{0em}{1.5em}\BigSquare & \BigSquare & \BigSquare & \FilledBigCircle & \FilledBigCircle\\
\FilledBigSquare & \FilledBigSquare & \FilledBigSquare & \FilledBigSquare & \BigCircle
\end{tabular}\hspace{.25em}}
\end{center}
One object is selected at random.  Label the following events as shown:
\begin{description}
\item[~B] = The object is Black.
\item[\NOT B] = The object is white (not Black).
\item[~C] = The object is a Cube.
\item[\NOT C] = the object is a sphere (not Cube).
\end{description}
Using our basic probability rules we see that the probability an object is black is:
\[P(B)=\frac{n(B)}{n(\samspa)}=\frac{6}{10}=\frac{3}{5}\]
One may similarly verify that $P(-B)=\frac{2}{5}$, $P(C)=\frac{7}{10}$, $P(-C)=\frac{3}{10}$.

What is the probability the object is a black cube?  This means the
\textbf{joint} probability of it being black \textbf{and} a cube:
\[P(B\ \AND\  C)=\frac{n(B\ \AND\  C)}{n(\samspa)}=\frac{4}{10}=\frac{2}{5}\] Note
that since it is logically the same to be black and a cube ($B\ \AND\  C$)
as it is to be a cube and black ($C\ \AND\  B$), we have that it is always
true that
\[P(C\ \AND\  B)=P(B\ \AND\  C)\]
for any two events $B$, $C$.  We will next
develop a rule for evaluating joint probability, but first we must
introduce the concept of conditional probability.

If we \textbf{know} that the object we have drawn is a cube, what is
the probability that it is black?  Such a probability is known as a
\textbf{conditional probability} and we can write it in shorthand as:
\[P(B|C)=\mbox{Probability Black Given Cube}\] Notice the event that
is known, here that the object is a cube (C), is placed second.  The
vertical bar~``$~|~$'' should be read as ``\emph{given}''.  To calculate the
probability, observe that in this case the sample space of events is
no longer all the objects, rather the sample space is restricted to the
cubes (enlarged):
\begin{center}
\huge\BigSquare\ \BigSquare\ \BigSquare\ \FilledSmallCircle\ \FilledSmallCircle

\FilledBigSquare\ \FilledBigSquare\ \FilledBigSquare\ \FilledBigSquare\ \SmallCircle
\end{center}
so that we have:
\[P(B|C)=\frac{n(B\ \AND\  C)}{n(C)}=\frac{4}{7}\]
What is the probability that the object is a cube if we know it is black?  This is the conditional probability of $C$ given $B$, $P(C|B)$.  Now the colour is known so the sample space is restricted to the
black objects:
\begin{center}
\huge\SmallSquare\ \SmallSquare\ \SmallSquare\ \FilledBigCircle\ \FilledBigCircle

\FilledBigSquare\ \FilledBigSquare\ \FilledBigSquare\ \FilledBigSquare\ \SmallCircle
\end{center}
\[P(C|B)=\frac{n(B\ \AND\  C)}{n(B)}=\frac{4}{6}=\frac{2}{3}\] Comparing
$P(C|B)$ to $P(B|C)$ we see that unlike joint probability (and), it is
\textbf{not} true that \mbox{$P(C|B)=P(B|C)$}.  Furthermore note that neither
of these equal $P(B\ \AND\  C)$.
\subsubsection{Multiplication Rule (General)}
In general, for two events $A$ and $B$, we have, as just shown, that
\[P(B|A)=\frac{n(A\ \AND\  B)}{n(A)}\]
By dividing the numerator and denominator on the right hand side each by the total number of events in the sample space, $n(\samspa)$ we have
\[P(B|A)=\frac{\frac{n(A\ \AND\  B)}{n(\samspa)}}{\frac{n(A)}{n(\samspa)}}=\frac{P(A\ \AND\  B)}{P(A)}\]
A useful formula for conditional probability is therefore:
\[\boxed{P(B|A)=\frac{P(A\ \AND\  B)}{P(A)}}\]
Solving for the joint probability (\ \AND\ ) we get the
\textbf{multiplication rule}:
\[\boxed{P(A\ \AND\  B)=P(A)\cdot P(B|A)}\]
For our example above we can verify that our joint probability result $P(C\ \AND\  B)=\frac{2}{5}$ can be obtained using the conditional probability:
\[P(C\ \AND\  B)=P(C)\cdot P(B|C)=\frac{7}{10}\cdot\frac{4}{7}=\frac{4}{10}=\frac{2}{5}\]
Since $P(C\ \AND\  B)=P(B\ \AND\  C)$ we could have also used $P(C|B)$ instead to get the same answer:
\[P(B\ \AND\  C)=P(B)\cdot P(C|B)=\frac{3}{5}\cdot\frac{2}{3}=\frac{2}{5}\]
\subsubsection[Multiplication Rule\\(Independent Events)]{Multiplication Rule (Independent Events)}
Our general multiplication rule has a special case which can be used
if the two events $A$, $B$ are \mbox{\textbf{independent}}.  Two
events are independent if the probability of one happening is not
changed by the occurrence of the other (or vice versa).  This is the
case when two coins are flipped -- the probability of getting heads on
one is not affected by the result (heads or tails) that occurred on
the other. The individual coin flip events are independent.  In
symbols we can define two events $A$, $B$ to be independent if
\mbox{$P(B|A)=P(B)$}.  This makes sense because in words it means that
the probability of $B$ occurring did not change if $A$ had occurred.
In the special case of independent events we see, using this
definition in the general multiplication rule, that:
\[\boxed{P(A\ \AND\  B)=P(A)\cdot P(B)\ \ \ \ (\mbox{$A$, $B$ independent})\ \ .}\]
If two events are not independent we say they are \textbf{dependent}.
For dependent events, or in the case where one does not know whether the
events are independent or not, the general multiplication rule must be
used.

To test whether two events are independent we can test the conditional
probability expression above, $P(B|A)=P(B)$, or equivalently we can check if
$P(A|B)=P(A)$.  Finally if we can show that the multiplication rule
for independent events actually holds this also proves
independence.\footnote{Why?  If $P(A\ \AND\ B)=P(A)\cdot P(B)$, then
  $P(B)=\frac{P(A\ \AND\ B)}{P(A)}=P(B|A)$ where the last equality
  holds as we saw earlier for conditional probability.  Hence
  $P(B|A)=P(B)$ and the events are independent.} In summary
\begin{center}
\fbox{Events $A$, $B$ are \textbf{independent} if and only if $\left\{\begin{array}{l}\rowrulesmall P(B|A)=P(B),\ \mbox{\emph{or}}\\ \rowrulesmall P(A|B)=P(A), \ \mbox{\emph{or}} \\ \rowrulesmall P(A\ \AND\  B)=P(A)\cdot P(B)\end{array}\right.$.}
\end{center}
\example{\vspace{-.5em}\begin{enumerate}\item Are the events of drawing a black object ($B$) and drawing a cube ($C$) from the previous example dependent or independent?
\item Repeat the last question if the original set of objects had been:
\begin{center}
\fbox{\huge\hspace{.05em}
\begin{tabular}{ccccc}\rule{0em}{1.5em}\BigSquare & \BigSquare & \BigSquare & \FilledBigCircle & \FilledBigCircle\\
\FilledBigSquare & \FilledBigSquare & \FilledBigSquare & \BigCircle & \BigCircle
\end{tabular}\hspace{.25em}}
\end{center}
\end{enumerate}}{\vspace{-.5em}%
\begin{enumerate}
\item We saw above for the original box of objects that $P(B)=3/5$
  while $P(B|C)=4/7$.  Thus $P(B)\neq P(B|C)$ so the events $B$, $C$
  by the first definition are not independent, and hence are
  dependent. (Try testing the other two definitions of independence
  and show they also fail.)
\item With the new objects lets check the third definition of independence.  We have
\[P(B\ \AND\ C)=\frac{n(B\ \AND\ C)}{n(\samspa)}=\frac{3}{10}\ ,\]
while
\[P(B)\cdot P(C) =\frac{5}{10}\cdot\frac{6}{10}=\frac{30}{100}=\frac{3}{10}\ .\]
Hence $P(B\ \AND\ C)=P(B)\cdot P(C)$ and the third definition proves
the two events $B$, $C$ are now actually independent. (Try testing the
other two definitions of independence and show they also hold.)
\end{enumerate}}

The last example shows a case where two events are independent by
definition which perhaps was not obvious.  Typically we can recognize
two events as not having an effect on each other's likelihood and
hence being independent so that we can use the simplified
multiplication rule. Unlike mutually exclusivity, independence of
events cannot be illustrated by a Venn Diagram.  Tree diagrams are
helpful for sequencing the events when applying the multiplication
rules as the next example shows.  Finally note that we can generalize
the special case multiplication rule for 3 (or more) events that are
all independent as:
\[P(A\ \AND\ B\ \AND\ C) = P(A)\cdot P(B)\cdot P(C)\ \ \ \ (\mbox{$A$, $B$, $C$ independent}).\]
The general multiplication rule can also be generalized to more than
two events as shown in the examples below.
\example{A box holds 20 items.  5 of the items are defective.
\begin{enumerate}
\item If an item is drawn from the box and \textbf{not replaced}
  before the next is drawn, what is the probability of selecting two
  defective items?

The following tree diagram illustrates the experiment with its
possible outcomes being each of the four paths.
\begin{center}
\includegraphics[width=4in]{image3-20.png}
\end{center}
Selecting two defective items corresponds to Path~1 ($D_1\ \AND\  D_2$).
Since the draws are being done \textbf{without replacement}, each time
a draw is made the proportion of defective items in the box are
dependent upon what was drawn on previous draws.  This is the case of
\textbf{dependent} events. Using the general Multiplication Rule:
\begin{eqnarray*}
\boxed{P(D_1\ \AND\  D_2)} & = & P(D_1)\cdot P(D_2|D_1)\\
               & = & \ \ \; \frac{5}{20}\ \ \cdot\ \ \  \frac{4}{19}\ \ \ \ \ \ \ =\ \frac{20}{380}\ =\ \boxed{\frac{1}{19}}
\end{eqnarray*}

Notice on the tree diagram that we can associate probabilities with
each branch, those of Path~1 having been labelled.  $P(D_2|D_1)$ is
associated with the second branch because at that point we know a
defective item has been drawn on the first draw. ($D_1$ has occurred.)
The entire Path~1 corresponds to the event $(D_1\ \AND\  D_2)$ and its
probability is just the product of the probabilities of the branches
of which it is composed.
\newpage
\item If an item is drawn from the box and then \textbf{replaced}
  before the next item is drawn, what is the probability of selecting
  two defective items?

The branch of interest in the tree remains the same. Since the
items are drawn \textbf{with replacement} each time a draw is made the
proportion of defective items in the box remains the same and
consequently the probability of drawing a defective item on the second
draw is the same as on the first.  This is the case of
\textbf{independent events}. Using the Multiplication Rule for
independent events.
\[\boxed{P(D_1\ \AND\  D_2)}=P(D_1)\cdot P(D_2)=\frac{5}{20}\cdot\frac{5}{20}=\frac{25}{400}=\boxed{\frac{1}{16}}\]

Notice that this joint event is slightly more likely to occur when the
items are drawn with replacement as there are more defective items
available on the second draw in this case.

\item If two items are drawn from the box \textbf{at once}, what is
  the probability that exactly one is defective?

Drawing two at once is equivalent to drawing two items
without replacement because once the first item is chosen it is not
available to be picked as the second item.  The second and third paths
from the top both represent the occurrence of exactly one defective item. 
So the joint event could happen by  path two \textbf{or} path three.  There individual probabilities are:
\[P(\mbox{Path 2})=P(D_1\ \AND\  \NOT D_2)=P(D_1)\cdot P(\NOT D_2|D_1)=\frac{5}{20}\cdot\frac{15}{19}=\frac{15}{76}\]
\[P(\mbox{Path 3})=P(\NOT D_1\ \AND\  D_2)=P(\NOT D_1)\cdot P(D_2|\NOT D_1)=\frac{15}{20}\cdot\frac{5}{19}=\frac{15}{76}\]
Paths on a tree diagram are mutually exclusive outcomes so using the M.E. addition rule: 
\begin{eqnarray*}
\boxed{P(\mbox{exactly one defective})}=P(\mbox{Path 2}\ \OR\  \mbox{Path 3}) & = & P(\mbox{Path 2})+P(\mbox{Path 3}) \\
 & = & \ \ \ \ \ \frac{15}{76}\ \ \ \ \; +\ \ \ \ \; \frac{15}{76}\ \ \ \ \ =\ \frac{30}{76}\ =\ \boxed{\frac{15}{38}}
\end{eqnarray*}
\item If three items are drawn \textbf{without replacement}, what is the
probability that all three are defective?

Imagine a tree diagram with three steps.  This joint event corresponds
to one path in the tree where a defective item is picked at each each
step.  The steps in this case are dependent since we are picking
without replacement.  The general multiplication rule for two events
generalizes to three events as follows:\footnotemark
\[\boxed{P(D_1\ \AND\  D_2\ \AND\  D_3)}=P(D_1)\cdot P(D_2|D_1)\cdot P(D_3|D_1\ \AND\  D_2)=\frac{5}{20}\cdot\frac{4}{19}\cdot\frac{3}{18}=\boxed{\frac{1}{114}}\]
\item If three items are drawn \textbf{with replacement}, what is the
probability that all three items are defective?

This is represented by the same path in the tree as in the last
example.  The steps are independent since we are drawing with
replacement.

The multiplication rule for two independent events
generalizes to three events as follows:\footnotemark
\[\boxed{P(D_1\ \AND\  D_2\ \AND\  D_3)} = P(D_1)\cdot P(D_2)\cdot P(D_3) = \frac{5}{20}\cdot 
\frac{5}{20}\cdot \frac{5}{20}= \boxed{\frac{1}{64}}\]

\item If three items are drawn \textbf{with replacement}, what is the
probability of at least one good item?

In this case we could calculate the probability of all the paths with
at least one not defective~($\NOT D$) item, which is seven paths!  The
quick way is to notice this event is the complement of the event that all are defective (last example) and use the complement rule.
\begin{eqnarray*}\boxed{P(\mbox{at least one not defective})}=P(\;\NOT\underbrace{[D_1\ \AND\  D_2\ \AND\  D_3]}_{A}\;)& = & 1-P(\;\underbrace{D_1\ \AND\  D_2\ \AND\  D_3}_A\;)\\
& = & 1-\frac{1}{64}\ =\ \boxed{\frac{63}{64}}
\end{eqnarray*}
\end{enumerate}
}
\addtocounter{footnote}{-1}
\footnotetext{$\displaystyle
  P(\underbrace{D_1\ \AND\  D_2}_A\ \AND\ 
  \underbrace{D_3}_B)=P(\underbrace{D_1\ \AND\  D_2}_A)\cdot
  P(\underbrace{D_3}_B|\underbrace{D_1\ \AND\  D_2}_A)=P(D_1)\cdot
  P(D_2|D_1)\cdot P(D_3|D_1\ \AND\  D_2)$}
\addtocounter{footnote}{1}
\footnotetext{$\displaystyle
  P(\underbrace{D_1\ \AND\  D_2}_A\ \AND\ 
  \underbrace{D_3}_B)=P(\underbrace{D_1\ \AND\ 
    D_2}_A)\cdot P(\underbrace{D_3}_B)=P(D_1)\cdot P(D_2)\cdot
  P(D_3)\ \ \mbox{(independent events)}$}
\reading{Read your textbook pages 145 to 150} 
\newcommand{\multanswer}{
  \begin{enumerate}
  \item
    \begin{enumerate}
    \item independent
    \item dependent
    \item independent
    \end{enumerate}
  \item
    \begin{inparaenum}[~\;(a)]
    \item $\frac{1}{20}$
    \item $\frac{57}{460}$
    \end{inparaenum}
  \item \begin{inparaenum}[~\;(a)]
  \item$\frac{1}{26}$
  \item yes
  \end{inparaenum}
  \item
    \begin{inparaenum}[~\;(a)]
    \item $\frac{1}{16}$
    \item $\frac{1}{19}$
    \end{inparaenum}
  \item $\frac{113}{114}$
  \end{enumerate}
}
\assignment{\answer{\protect\multanswer}
  \begin{enumerate}
  \item In the following experiments, identify the steps in the
    sequence and determine if the steps are dependent or independent.
    \begin{enumerate}
    \item The outcome is observed on each occasion when a coin is
      flipped 3 times.
    \item A carton of bolts has 4 that are defective.  A handful of
      three bolts are randomly selected and inspected for defects.
    \item An opinion poll is conducted in a large shopping centre.
      People are selected at random and asked their opinion about the
      type of service they prefer in a restaurant.
    \end{enumerate}
  \item A shipment of eggs contains 25 cartons of eggs.  6 of the
    cartons contain cracked eggs.  A customer buys some of the cartons
    without inspecting the contents.  What is the probability that 2
    of the cartons contain cracked eggs if:
    \begin{enumerate}
    \item The customer buys two cartons.
    \item The customer buys three cartons.
    \end{enumerate}
  \item A card is dealt from a standard deck of 52 playing cards.
    \begin{enumerate}
    \item What is the probability that the card is black and a six?
    \item Are the events of drawing a black card and drawing a six independent?
    \end{enumerate}
  \item Of the 20 members who attended an organizational meeting, 5
    are women. A secretary and a treasurer are to be chosen from the
    group by a random draw.
    \begin{enumerate}
    \item If the same person can hold both offices, what is the
      probability that both offices are held by women?
    \item If the same person cannot hold both offices, what is the
      probability that both offices are held by women?
    \end{enumerate}
  \item In the example above, if three items are drawn \textbf{without
    replacement}, what is the probability of at least one good item?
  \end{enumerate}
}
\reading{Exercises in the textbook pages 150 - 152}
\clearpage
\subsection{Probability and Odds}
Probability and odds are related but not the same. Odds are often
quoted in connection with situations that involve \emph{risk}. In
decision theory taking a risk means making a decision where a possible
outcome of that decision is a loss or an injury.  Odds are often
associated with gambling activities because it is evident that the
risk taken is a loss of money.  Many business decisions involve risk.
The loss could represent a real financial loss or a loss of
opportunity because a certain course of action was followed instead of
another more favourable course of action.

Odds are quoted as the following ratio:
\[\boxed{\mbox{Odds in Favour}=\frac{P(\mbox{Favour})}{P(\mbox{Against})}}\hspace{10ex}
\boxed{\mbox{Odds Against}=\frac{P(\mbox{Against})}{P(\mbox{Favour})}}\]
\begin{center}
** The fractions are reduced to lowest terms before expressing the
ratio. **
\end{center}

\example{
\begin{enumerate}
\item A die is rolled.  What are the odds in favour of a six?

Let $S =$ the event of rolling a six and  $\NOT S =$ the event of not
rolling a six.

Then $P(S) = 1/6$ and $P(\NOT S) = 5/6$ so the odds in favour of a six are
quoted as:
\[P(S):P(-S) = 1:5\]

Notice the connection to the concept of gambling.  The integer ratios
are the wagers that would have to be placed by two people who were
betting on the outcome of the roll of the die.  In order that the bet
is \emph{fair} to both parties in the
wager, the person betting for the 6 should put up \$1 for every \$5
put up by the person betting against the six.  This also makes sense
when the spots on the die are examined.  One side corresponds to a six
and five sides do not.

\item A businessperson assigns odds of $5:3$ to the success of a
newly developed product in the marketplace.  What probability does the
person place upon the success of the product?

The total \emph{pot} wagered is 5  +  3  =  8 of which 5 is bet on success.
\[P(\mbox{Success})=\frac{5}{8}=0.625\]
\end{enumerate}
}
\newcommand{\oddsanswer}{
  \begin{enumerate}
  \item $3:10$
  \item $5:1$
  \item $9:1$
  \item 0.6
  \end{enumerate}
}
\assignment{\answer{\protect\oddsanswer}
\begin{enumerate}
\item What are the odds in favour of drawing a face card from a deck
  of 52 standard playing cards on the first draw?
\item What are the odds against rolling a sum of seven on the roll of
  two six sided dice?
\item A weather forecaster gives the probability of precipitation as
  10\%.  What are the odds against precipitation?
\item A stockbroker quotes the odds as $3:2$ in favour of the rise in
  the bond market this week.  What probability is the broker assigning
  to a rise in the bond market?
\end{enumerate}
}
\clearpage
%The following forces a new column in our table of contents of the unit.
\addtocontents{toc}{\protect\columnbreak}
\subsection{Contingency Tables and Bayes' Rule}
\subsubsection[Frequency Contingency\\Tables]{Frequency Contingency Tables}
Contingency tables can be used to represent certain frequency
distributions when outcomes involve multiple events, as shown in
Section~\ref{sec:countingoutcomes}.  Similarly they are useful for the
frequency of occurrence of events in theoretical probability
calculations as shown in Section~\ref{sec:addrules}.  The notion of
conditional probability and the multiplication rules can often be made
clearer by constructing a contingency table of the observable
outcomes. For example, we can represent our probability problem of
Section~\ref{sec:multrules} involving the random selection of a single
item from among black and white cubes and spheres
\begin{center}
\fbox{\Large\hspace{.05em}
\begin{tabular}{ccccc}\rule{0em}{1.5em}\BigSquare & \BigSquare & \BigSquare & \FilledBigCircle & \FilledBigCircle\\
\FilledBigSquare & \FilledBigSquare & \FilledBigSquare & \FilledBigSquare & \BigCircle
\end{tabular}\hspace{.25em}}
\end{center}
with a contingency table:
% Note the row spacing is done in a slightly silly way here which makes
% colour highlighting not work.  I should really use \rule's here.  That
% said, row highlighting messes with the word Colour, so the tables below
% just avoid the titles Colour and Shape.
\begin{center}
\hfil\begin{tabular}{cc|cc|c}
&          & \multicolumn{2}{c|}{Shape} & \\
&          & $~C$ & $\NOT C$            & \\ \hline
\multirow{2}{1.5ex}[.6em]{\shortstack{C\\o\\l\\o\\u\\r}} & \rule{0em}{1.75em}$~B$     &  4   &    2                & ~6 \\[1em]
& $\NOT B$ &  3   &    1                & ~4 \\[.75em] \hline
& \rule{0em}{1em} &  7   &    3                & 10
\end{tabular}\hfil\begin{tabular}{cc|cc|c}
&          & \multicolumn{2}{c|}{Shape} & \\
&          & $~C$ & $\NOT C$            & \\ \hline
\multirow{2}{1.5ex}[.6em]{\shortstack{C\\o\\l\\o\\u\\r}} & \rule{0em}{1.75em}$~B$     &  $n(B\ \AND\ C)$   & $n(B\ \AND\ \NOT C)$ & $n(B)$\\[1em]
& $\NOT B$ & $n(\NOT B\ \AND\ C)$ & $n(\NOT B\ \AND\ \NOT C)$ & $n(\NOT B)$ \\[.75em] \hline
& \rule{0em}{1em} & $n(C)$ & $n(\NOT C)$ & $n(\samspa)$
\end{tabular}\hfil%
\end{center}
On the right are shown the symbols corresponding to the table entries.

Joint probabilities, such as finding the probability of a white cube
($\NOT B\ \AND\ C$), are easily interpreted, since we restrict
ourselves to the row and column of the events in question.  We can
read the answer directly from the table because within the table are
the joint frequencies of all combinations of pairs of outcomes.
\begin{center}
\hfil\begin{tabular}{c|>{\columncolor{lightgray}}cc|c}
          & $~C$ & $\NOT C$            & \\ \hline
 $~B$     &  4   &    2                & ~6 \\
\rowcolor{lightgray}$\NOT B$ & \boxed{3}   &    1                & ~4 \\ \hline
 &  7   &    3                & \boxed{10}
\end{tabular}\hfil%
$\displaystyle P(\mbox{white cube})=P(\NOT B\ \AND\ C)=\frac{n(\NOT B\ \AND\ C)}{n(\samspa)}=\frac{3}{10}$\hfil
\end{center}

Similarly interpreting a conditional probability is straightforward.
The known constraint restricts consideration to its row or column.
For instance, what is the conditional probability of getting a cube if
you know the picked object is black?
\begin{center}
\hfil\begin{tabular}{c|cc|c}
          & $~C$ & $\NOT C$            & \\ \hline
\rowcolor{lightgray} $~B$     &  \boxed{4}   &    2                & ~\boxed{6} \\
$\NOT B$ & 3   &    1                & ~4 \\ \hline
 &  7   &    3                & 10
\end{tabular}\hfil%
$\displaystyle P(\mbox{cube given black})=P(C|B)=\frac{n(B\ \AND\ C)}{n(B)}=\frac{4}{6}=\frac{2}{3}$\hfil
\end{center}
Using the contingency table, it is possible to see exactly what it
means to say that the sample space is limited to the condition under
conditional probability.  Note that the denominator in the proportion
is reduced to 6 and does not contain the entire group of objects
observed since not all 10 objects are black.

\newcommand{\fcontingencyanswer}{
\begin{enumerate}
\item $\frac{18}{55}$
\item $\frac{1}{22}$
\item $\frac{1}{10}$
\item 0.6436
\end{enumerate}}
\assignment{\answer{\protect\fcontingencyanswer}
Parts are allocated to bins in a warehouse by people on two
different shifts.  Shift one allocates 2000 parts while shift two
allocates 3500 parts.  200 of the parts allocated by shift one are
placed in the wrong bins.  250 of the parts allocated by shift two are
placed in the wrong bins.  Suppose a part is randomly selected from
those allocated by both shifts.  What is the probability that it was:
\begin{enumerate}
\item allocated by shift one and is in the correct bin?
\item allocated by shift two and is in the wrong bin?
\item in the wrong bin given that it was allocated by shift one?
\item allocated by shift two given it was in the correct bin?
\end{enumerate}
}
\subsubsection[Probability Contingency\\Tables]{Probability Contingency Tables}
Up to this point we have used frequency contingency tables whose
entries are either experimental frequencies or counts of possible
outcomes.  We can create a \textbf{probability contingency table} by
dividing every entry in an experimental frequency contingency table by
the sum of frequencies or by dividing every entry in a theoretical
probability calculation by the number of elements in the sample space,
$n(\samspa)$.  As an example of the second case, divide every entry in
the contingency table of the last section by $n(\samspa)=10$ and use
$P(A)=n(A)/n(\samspa)$ to get:
\begin{center}
\hfil\begin{tabular}{cc|cc|c}
&          & \multicolumn{2}{c|}{Shape} & \\
&          & $~C$ & $\NOT C$            & \\ \hline
\multirow{2}{1.5ex}[.6em]{\shortstack{C\\o\\l\\o\\u\\r}} & \rule{0em}{1.75em}$~B$     &  $\frac{4}{10}$   &    $\frac{2}{10}$                & $\frac{6}{10}$ \\[1em]
& $\NOT B$ &$\frac{3}{10}$   &    $\frac{1}{10}$                & $\frac{4}{10}$ \\[.75em] \hline
& \rule{0em}{1em} &  $\frac{7}{10}$   &   $\frac{3}{10}$                & $1$
\end{tabular}\hfil\begin{tabular}{cc|cc|c}
&          & \multicolumn{2}{c|}{Shape} & \\
&          & $~C$ & $\NOT C$            & \\ \hline
\multirow{2}{1.5ex}[.6em]{\shortstack{C\\o\\l\\o\\u\\r}} & \rule{0em}{1.75em}$~B$     &  $P(B\ \AND\ C)$   & $P(B\ \AND\ \NOT C)$ & $P(B)$\\[1em]
& $\NOT B$ & $P(\NOT B\ \AND\ C)$ & $P(\NOT B\ \AND\ \NOT C)$ & $P(\NOT B)$ \\[.75em] \hline
& \rule{0em}{1em} & $P(C)$ & $P(\NOT C)$ & $1$
\end{tabular}\hfil%
\end{center}
On the right are shown the symbols corresponding to the table entries.  Note the following:
\begin{enumerate}
\item Joint probabilities lie inside the table.  For example $P(\mbox{black sphere})=P(B\ \AND\ \NOT C)=\frac{2}{10}$\ .  Recall that $P(B\ \AND\ \NOT C)=P(\NOT C\ \AND\ B)$ for a joint probability.
\item Marginal probabilities lie on the sides of the table.  For example $P(\mbox{cube})=P(C)=\frac{7}{10}$\ . 
\item The bottom right entry for a probability contingency table is always 1 since the total probability is 1.
\item All rows and columns add up as usual for a contingency table.
\item Conditional probabilities \textbf{do not appear} within a probability contingency table.  To get a conditional probability one uses the inverted multiplication rule:
\[\boxed{P(B|A)=\frac{P(A\ \AND\ B)}{P(A)}}\]
and reads the probabilities on the right hand side from the contingency table.
For instance, in the above example the conditional probability of getting a cube given the object is black is:
\[P(C|B)=\frac{P(B\ \AND\ C)}{P(B)}=\frac{\frac{4}{10}}{\frac{6}{10}}=\frac{4}{10}\cdot\frac{10}{6}=\frac{4}{6}=\frac{2}{3}\]
\end{enumerate}
We will next turn to problems where the probabilities are what is
given and we can use probability contingency tables to simplify
complicated problems.

\subsubsection{Bayes' Rule for Revising Probabilities}

This rule is used to revise the probability of an event in the light
of additional evidence for the existence or nonexistence of the event.
Bayes' Rule is used to compute a \textbf{conditional probability}
where the condition is additional evidence about the occurrence of the
event.

\label{page:bettingexample}
As a theoretical example, suppose you and a friend set up a game of
chance based on betting whether or not an object from among our black
and white cubes and spheres is black or not.  As we have seen
$P(B)=\frac{6}{10}=.6$ and using the odds one could show that for the
game to be fair the person betting on black should have to put up \$6
for every \$4 put up by the person betting on white.  Next suppose
that after the object is drawn, but before the bets are made and the
object is is revealed, a third person drawing the object is able to
secretly communicate to you the shape of the object.  (Say they have
the opportunity to feel the object as they are drawing it out
blindfolded.)  Based on this shape information you could improve your
betting strategy for if you know the object is a cube then
$P(B|C)=\frac{4}{7}=.57$ which is less than $.6$ so you should bet on
it being white.  On the other hand if you know the object is a sphere
then $P(B|-C)=\frac{2}{3}=.67$ which is greater than .6 and you should
bet on the object being black.  The additional evidence you have
(shape) allows you to revise your probabilities which in turn allows
you to more likely win money than lose it over time.\footnote{This
  example is for illustration only --- neither gambling with friends,
  nor cheating your friends at gambling for that matter, is being
  encouraged!  See problem~\ref{item:riggedgame} in
  Section~\ref{subsec:discretereview} for how much you would win each
  game on average.}

For a second example, if the probability that a transaction is in
error in a journal is 5\% the inference is that 5\% of all
transactions in the journal are incorrect.  We could probably revise
this figure upward if we had additional evidence about the
circumstances of the particular entry.  For example, if we knew that
the transaction was entered by a new employee, we would likely revise
the probability upward from 5\%.

\reading{Text page 156}
Bayes' Rule is for calculating conditional probabilities can be quite
complicated.  Ultimately it grows out of our simpler formula,
\[P(A|B)=\frac{P(A)P(B|A)}{P(B)}\]
as we will see below.
Rather than use the Bayes' Rule formula directly, however, such calculations are
often made easier by using a contingency table or by sequencing events
with a tree diagram.

\example{
  Suppose it is known that a store receives shirts from two different
  suppliers.  Supplier $A$ provides the store with 60\% of its shirts.
  Supplier $B$ provides the rest.  1\% of all the shirts supplied by
  $A$ are missing buttons.  2\% of all the shirts supplied by $B$ are
  missing buttons.  A shirt is examined for flaws.  It is observed to
  be missing a button.  What is the probability that $B$ supplied the
  shirt?}{%
  The first step in solving any of the these problems is to correctly
  identify the information given with symbols.  Here it makes sense to
  let $A$ and $B$ be the events that the shirt is supplied by the
  respective supplier.  Secondly we can let $M$ be the event a button
  is missing, while $I$ is the event the buttons are intact.  (Using $\NOT A$ for $B$ and $\NOT M$ for $I$ would also
  have worked.) In terms of these symbols one identifies the given
  probabilities:
\begin{compactenum}
\item $P(A)=60\%=.60$
\item $P(B)=P(\NOT A)=1-P(A)=.40$, since \emph{the rest} means the complement.
\item $P(M|A)=1\%=.01$, since this is probability of a missing button if the supplier $A$ is \textbf{known}.
\item $P(M|B)=2\%=.02$, since here the supplier $B$ is known.
\end{compactenum}
Finally one needs to identify the probability being asked for in our
symbols.  In this case, if we \textbf{know} that the shirt is missing
a button ($M$), the probability that $B$ supplies it is $P(B|M)$.
We now show two solutions: 
\begin{description}
\item[Contingency Table Solution]~\newline
For a contingency table solution follow these steps:
\begin{enumerate}[Step 1)]
\item Identify all events with symbols (as above).
\item Identify all given probabilities in terms of the symbols (as
  above).  Some complement event probabilities, such as $P(B)$, may be
  implied.
\item Convert all given conditional probabilities to joint
  probabilities using the general multiplication rule.  This is
  required because, as shown earlier, a probability contingency table
  contains only joint (\AND) and marginal probabilities, but
  \textbf{no conditional probabilities}.  For example, since we know
  $P(M|A)$ we can get $P(A\ \AND\ M)$:
\[P(A\ \AND\ M)=P(A)\cdot P(M|A)=(0.60)\cdot(.01)=.006\]
Similarly $P(B\ \AND\ M)=(.02)\cdot(.40)=.008$\ .
\item Create a probability contingency table for the events filling
  out any known marginal and joint probabilities.  Play ``contingency
  table sudoku'' by completing the table using the fact that all rows
  and columns must add up.  Remember to put a 1 in the bottom right
  corner since it is a probability contingency table.  Our completed
  table is as follows:
\begin{center}
\includegraphics[width=5in]{image3-23.png}
\end{center}
\item Identify the probability of interest.  If it is a joint (\AND)
  probability or a marginal probability just read it off the table.
  If, more likely, it is a conditional probability then it does not
  appear in the table.  We calculate it using the inverted
  multiplication rule.  In our case (see the circled row in the
  contingency table):
  \[P(B|M)=\frac{P(M\ \AND\ B)}{P(M)}=\frac{.008}{.014}=\frac{4}{7}\]
  Notice it is the known evidence, here $M$, that appears in the
  denominator of the formula.
\end{enumerate}

With this contingency table most of the problems about joint and
conditional probabilities can be answered.  In this instance the
probability that $B$ supplied the shirt is analyzed in light of the
evidence that it is missing a button.  In words, if we examined only
the shirts that are missing buttons this is the proportion of those
that were supplied by $B$. Notice that B's probability of having
supplied the shirt is no longer 40\%; once it is known that there is a
button missing, it rises to $4/7=57\%$. The proportion of outcomes
with a certain attribute in the population in this context is called
the \textbf{prior} probability. The revised probability based on the
proportion of these same outcomes in a sample space limited to a given
condition is called the \textbf{posterior} probability.

\item[Tree Diagram Solution]~\newline In this method we construct a
  tree diagram.  Follow the following steps:
\begin{enumerate}[Step 1)]
\item Identify all events with symbols (as above).
\item Identify all given probabilities in terms of the symbols (as
  above).
\item Create the tree diagram.  The first step of the diagram should be selected based upon the category for which you have the total probabilities.  In this case we know $P(A)$ and $P(B)$ so the first step is the supplier.
\item Fill in the probabilities.  In this case it is the conditional
  probabilities that appear in the later branches of the tree. (Joint
  probabilities do not appear on the branches, they are the
  probabilities of the total paths.)  Finally we can use the fact that
  all the branches emanating from a given vertex must add to get 1 to
  get remaining branch probabilities.  A tree diagram for the current
  problem is as follows:
\begin{center}
\includegraphics[width=5in]{image3-24.png}
\end{center}
\item Evaluate the desired probability. A joint probability (\AND) can
  be evaluated by identify the path to which it corresponds and
  multiplying the probabilities along it.  For a conditional
  probability such as our case start with the inverted multiplication
  rule:
  \[P(B|M)=\frac{P(M\ \AND\ B)}{P(M)}\] Here the numerator is just the
  probability of Path 3, namely the product of the probabilities along
  the path, or, in symbols using the multiplication rule:
  \[P(M\ \AND\ B)=P(B\ \AND\ M)=P(B)\cdot P(M|B)=(.4)\cdot(.02)=.008\]
  For the denominator, notice both paths 1 and 3 produce missing
  buttons.  The event of a missing button could happen by either path.
  These are mutually exclusive, so
  \begin{eqnarray*}
    P(M) & = & P(\mbox{Path 1})  +  P(\mbox{Path 3}) \\
    & = & P(A\ \AND\ M) +  P(B\ \AND\ M)\\
    & = & P(A)\cdot P(M|A)+P(B)\cdot P(M|B) \\
    & = & (0.6)\cdot(0.01)+(0.4)\cdot(0.02)\\
    & = & 0.014
  \end{eqnarray*}
  Substituting the numerator and denominator in the original expression
  gives our final result:
  \[P(B|M)=\frac{0.008}{0.014}=\frac{4}{7}\]
  Notice that this is exactly the same result as in the first
  solution.
\end{enumerate}
\end{description}
}

Problems for which Bayes' Rule applies can be done either with
contingency tables or tree diagrams.  Some problems may be more easily
illustrated by tree than by table and vice versa.  There is no need to
memorize formulae here if you realize that this is a problem of
limiting a sample space to a required condition when calculating a
probability.  The contingency table method is usually the most
straightforward.

So what is Bayes' rule?  In the tree diagram of the last problem, if
we had just substituted symbols we would get:
\[P(B|M)=\frac{P(B)\cdot P(M|B)}{P(A)\cdot P(M|A)+P(B)\cdot P(M|B)}\]
This is Bayes' rule for our specific problem written in our symbols.
It can be written more generally, for instance, in the case of more
suppliers.  We will not use it directly in this course.  More
complicated conditional probability problems may similarly be solved
as shown next.

\example{
  A large tender for supplying gravel was awarded to three different
  companies.  Firm $X$ supplied 20\% of the tender, firm $Y$ supplied
  30\% of the tender and firm $Z$ supplied the rest.  A technician
  tests the gravel supplied by each firm and determines that a certain
  proportion of gravel supplied by each firm does not meet the
  specifications laid down in the tender agreement.  He observed that
  2\% from $X$, 2\% from $Y$, and 1.2\% from $Z$ are faulty materials.
  A portion of road failed, due to faulty gravel that was built with
  gravel from the stockpile supplied by these three firms.  A judge in
  a lawsuit that arises from the failure wishes to apportion damages
  to the three firms.  What is the probability that each firm supplied
  the failed gravel?}{%
  Let $P$ be the event that the gravel is poor (faulty) and $G$ that
  it is good.  Let $X$, $Y$, and $Z$ be the event that the grave was
  supplied by a particular firm.  Then $P(X)=.2$, $P(Y)=.3$, and
  $P(Z)=1-.2-.3=.5$.  One is also given the conditional probabilities
  $P(P|X)=.02$, $P(P|Y)=.02$, $P(P|Z)=.012$.  Converting the latter to
  their respective joint probabilities and completing the contingency
  table results in 
  \begin{center}
    \includegraphics[width=5in]{image3-25.png}
  \end{center}
  Using the inverted multiplication rule gives:
\[P(X|P)=\frac{P(X\ \AND\ P)}{P(P)}=\frac{0.004}{0.016}=\frac{1}{4}\]
\[P(Y|P)=\frac{P(Y\ \AND\ P)}{P(P)}=\frac{0.006}{0.016}=\frac{3}{8}\]
\[P(Z|P)=\frac{P(Z\ \AND\ P)}{P(P)}=\frac{0.006}{0.016}=\frac{3}{8}\]
So a judge, wise in the ways of statistics, could reasonably make each
firm responsible for these fractions of the supplier damages claim.
One notices that despite $Z$ having better gravel, that firm also
supplied more of it, resulting in the same probability as $Y$.

\hfil **Repeat this problem using a tree diagram.** \hfil}
\reading{Textbook pages 152 to 155}
\newcommand{\bayesanswer}{
  \begin{enumerate}
  \item
    \begin{inparaenum}[~\;(a)]
    \item 0.575
    \item 0.7652  
    \end{inparaenum}
  \item
    \begin{inparaenum}[~\;(a)]
    \item 0.9231
    \item 0.0769
    \end{inparaenum}
  \item
    \begin{inparaenum}[~\;(a)]
    \item 0.0330
    \item 0.2424
    \end{inparaenum}
  \item
    \begin{inparaenum}[~\;(a)]
    \item 0.25
    \item 0.5625
    \item 0.1111
    \end{inparaenum}
  \end{enumerate}
}
\assignment{\answer{\protect\bayesanswer} ** Show all work by
  drawing a contingency table or a tree diagram. Use the correct
  symbols and formulae of probability theory. **
\vspace{-1em}
\begin{enumerate}
\item A statistics instructor knows from past experience that a student
who does all his homework has an 80\% chance of passing the course.  A
student who does not regularly do his homework has only a 30\% chance
of passing.  The instructor notes that in his current class only 55\%
of the students regularly do their homework.
\begin{enumerate}
\item What proportion of all the people in the class pass?
\item What proportion of all those in the class who passed regularly did
their homework?
\end{enumerate}
\item A company has two suppliers for a certain chemical that it uses in
its production process.  Firm $X$ supplies 80\% of the chemical and firm
$Y$ supplies the remainder of the chemical.  95\% of the chemical from $Y$
is good while only 85\% of the chemical from $X$ is good.  A certain
production run is spoiled due to poor chemical.
\begin{enumerate}
\item What is the probability that $X$ supplied the chemical?
\item What is the probability that $Y$ supplied the chemical?
\end{enumerate}
\item Four ticket sellers are employed at a department store.  Betty
sells 30\% of the tickets.  Don sells 30\% of the tickets.  Sally sells
20\% of the tickets and Joe sells 20\% of the tickets.  They all forget
to give the customer their change on occasion.  Betty forgets 2\% of
the time, Don forgets 3\% of the time, Sally forgets 5\% of the time
and Joe forgets 4\% of the time.
\begin{enumerate}
\item What proportion of all customers go away without receiving their
change?
\item Given that a customer returns because they were not given their
change what is the probability that Joe sold them their ticket?
\end{enumerate}
\item (Optional: This is a fairly complex problem.) A marble is to be
randomly drawn out of one of three urns.  Urn $A$ has 10 black and 10
white marbles.  Urn $B$ has 5 white and 15 black marbles.  Urn $C$ has 15
white and 5 black marbles.  The urn is to be chosen by flipping two
coins.  If the coins are both heads, urn $A$ is chosen.  If the coins are
both tails urn $B$ is chosen.  If the coins are of unlike sides, urn $C$ is
chosen.
\begin{enumerate}
\item What proportion of the time will urn $B$ be chosen?
\item What proportion of the time will a white marble be chosen?
\item Given that a white marble was chosen what is the probability that
it came from urn~$B$?
\end{enumerate}
\end{enumerate}
}
\reading{Exercises in the textbook pages 155 to 157}
\newcommand{\basicreviewanswer}{
\begin{enumerate}
\item
\begin{inparaenum}
\item $P(A)=\frac{7}{15}$
\item $P(\NOT A)=\frac{8}{15}$
\item $P(A\ \AND\ L)=\frac{1}{10}$
\item $P(A|L)=\frac{2}{7}$
\item $P(\NOT A\ \AND\ \NOT L)=\frac{17}{60}$
\item $P(L|A)=\frac{3}{14}$
\item $P(A|\NOT L)=\frac{22}{39}$
\end{inparaenum}
\item $\frac{7}{13}$
\item $\frac{9}{169}$
\item $\frac{11}{221}$
\item $\frac{11}{1105}$
\item $\frac{3}{13}$\
\item
\begin{inparaenum}[~\;(a)]
\item 90\%
\item 10\%
\end{inparaenum}
\item 
\begin{inparaenum}[~\;(a)]
\item 0.24
\item 0.74
\item $6:19$
\end{inparaenum}
\item
\begin{enumerate}
\item 0.123
\item about 12\% of the bad credit risks slip through the
screening process.
\end{enumerate}
\item
\begin{enumerate}
\item $P(X|\NOT G)=\frac{12}{13}$ while $P(Y|\NOT G)=\frac{1}{13}$
\item  $12:1$
\end{enumerate}
\item
\begin{inparaenum}[~\;(a)]
\item 0.048
\item 0.08
\end{inparaenum}
\item
\begin{inparaenum}[~\;(a)]
\item 0.008
\item 0.384
\end{inparaenum}
\end{enumerate}
}
\clearpage
\subsection[Review Exercises on Basic\\Probability]{Review Exercises on Basic Probability}
\label{subsec:probreview}
\begin{center}
$\boxed{\mbox{Use proper probability symbols to solve the following questions.}}$\answer{\protect\basicreviewanswer}
\end{center}
\begin{enumerate}
\item An analysis of a collection of loans made to 28 agriculture
industries, ($A$), and 32 food stores ($F$), revealed the following loan
assessments.  (low risk loans = $L$)
\begin{center}
\includegraphics[width=4in]{image3-26.png}
\end{center}
Interpret the meaning and give the value of the following probability
symbols: \begin{inparaenum}
\item $P(A)$ \item $P(\NOT A)$ \item $P(A\ \AND\ L)$ \item $P(A|L)$ \item $P(\NOT A\ \AND\ -L)$ \item $P(L|A)$ \item $P(A|\NOT L)$
\end{inparaenum}
\item A card is drawn from a deck of 52 playing cards.  What is the
probability that the card is black or a six?
\item A card is drawn from a deck and then replaced.  The deck is
shuffled and another card is drawn.
\begin{enumerate}
\item What is the probability that both
cards are face cards?  (i.e., Jack, Queen, King)
\item If both cards are drawn at the same time, what
is the probability that both cards are face cards?
\end{enumerate}
\item If 3 cards are drawn from a deck, what is the probability that
they are all face cards?
\item A card is drawn from a deck, what is the probability that it is a
face card given that it is a spade?
\item In a recent survey of merchants in the downtown core, 80\%
favoured greater powers of arrest be given to police, 60\% favoured a
curfew for persons under 16 years of age, 50\% favoured both proposals.
\begin{enumerate}
\item What \% of the merchants favoured at least one of the proposals?
\item What \% of the merchants favoured none of the proposals?  Hint: 
Draw a Venn Diagram.
\end{enumerate}
\begin{center}
$\boxed{\mbox{The following probability exercises are more difficult}}$
\end{center}
\item To be hired by a company, applicants granted interviews must pass
two separate tests.  Based on experience, only 80\% of those
interviewed pass the first test.  To take the second test an applicant
must pass the first test.  Only 30\% of those who take the second test
pass it.
\begin{enumerate}
\item What proportion of the interviewees are hired?
\item What proportion of the people not hired failed test two?
\item What are the odds of being hired if an interview is granted?
\end{enumerate}
Hint:  Draw a tree diagram.
\item Twenty percent of homebuyers who have mortgages with a certain
bank default on their payments.  45\% of those who default were
initially given a good credit rating.  80\% of those who do not default
initially received a good credit rating.  Based on this analysis:
\begin{enumerate}
\item What is the probability that a person will default given that they
were given a good credit rating initially?
\item Comment on the validity of the initial credit rating.
\end{enumerate}
Hint:  Draw a contingency table.
\item A company has two suppliers for a certain chemical that it uses in
its production process.  Firm X supplies 80\% of the chemical while
firm Y supplies the remainder.  95\% of the chemical from Y is good
while 85\% of the chemical from X is good.  A certain production run is
spoiled because of poor chemical.
\begin{enumerate}
\item Who most likely supplied the chemical given that
it is poor?
\item What are the odds that X supplied it?
\end{enumerate}
Hint: Use a contingency table.
\item Transport Canada estimates that seat belt were worn by drivers in
60\% of all reported accidents.  In 8\% of the accidents where seat
belts were worn, the accident was fatal.  In 20\% of the accidents
where seat belts were not worn the accident was fatal.
\begin{enumerate}
\item What proportion of all reported accidents involved drivers who
were wearing seat belts and were killed?
\item What proportion of all reported accidents involved drivers who
were not wearing seat belts and were killed?
\end{enumerate}
Hint:  Draw a tree diagram.
\item \label{item:airline}A community is serviced by a major air carrier.  80\% of all its
flights arrive on time.  On three separate occasions during the year, a
person travels via this carrier.
\begin{enumerate}
\item What is the probability that the airline is late on all three
occasions?
\item What is the probability that the airline is late on exactly one
occasion?
\end{enumerate}
Hint:  Draw a tree diagram.
\end{enumerate}
\clearpage
\section{Discrete Probability Distributions}
\label{sec:discretedistributions}
\subsection{Definition}
\textbf{Probability distributions} list all possible values
of the random variable together with their probability of
occurrence. If the observations result from a count the distribution
is called a \textbf{discrete probability distribution}.

\example{4 coins are tossed.  Construct a probability distribution of the number
of heads observed among the 4 coins.

Here is a tree diagram with all the equally likely
possibilities:
\begin{center}
\includegraphics[width=6in]{image3-27.png}
\end{center}
\clearpage
Here is the probability distribution.  Because each path is equally
likely divide the sum of the number of outcomes that make up an event
by 16 to find the probability of the event.
\begin{center}
\begin{tabular}{|c|c|}\hline
\X(heads) & P(\X) \\ \hline
0 & 1/16 \\
1 & 4/16 \\
2 & 6/16 \\
3 & 4/16 \\
4 & 1/16 \\ \hline
  & $\sum P(\X)=16/16=1$ \\ \hline
\end{tabular}
\end{center}
}
In Unit 1 of this course we learned that every statistical
distribution has three important characteristics. Probability distributions
are theoretical distributions with these same features.
\begin{enumerate}
\item \textbf{Shape}
\begin{center}
\includegraphics[width=5in]{image3-29.png}
\end{center}
The distribution of number of heads has a symmetrical shape.

\item \textbf{Centre}

The centre of a probability distribution is
  called its \textbf{expected value}.  The expected value is located
  at the balance point of the distribution.
\begin{center}
\includegraphics[width=3in]{image3-30.png}
\end{center}
The formula for finding the mean is:\footnote{In Unit~1 we could have
  written the formula for $\pmean$ in terms of relative frequency
  $\rel$: \[\pmean=\frac{\sum\f\X}{\sum\f}=\left(\frac{1}{\sum\f}\right)\sum\f\X=\sum\left(\frac{1}{\sum\f}\right)\f\X=\sum\left(\frac{\f}{\sum\f}\right)\X=\sum
  \rel\cdot\X=\sum\X\cdot\rel\ \ .\] Since relative frequency is just
  experimental probability, the formula has to be the same.  A similar
  proof can be made for the computing formula for $\pdev$ below.}
\[\boxed{\pmean=\sum X\cdot P(X)}\]

\item \textbf{Variability}

The variance of a distribution is defined as its expected squared
deviation from the mean and the square root of the variance is the
standard deviation. The standard deviation measures the distance from
centre in which the majority of possible outcomes are located.
\begin{center}
\includegraphics[width=3in]{image3-31.png}
\end{center}
The formulae for finding the variance and standard deviation in a
probability distribution are:
\[\pvar=\sum\left(\X-\pmean\right)^2\cdot P(\X)\ \leftarrow\ \mbox{Distribution Variance based on the \textbf{Definition}}\] 
\[\boxed{\pdev=\sqrt{\sum\left(\X-\pmean\right)^2\cdot P(\X)}}\ \leftarrow\ \mbox{Distribution Standard Deviation based on the \textbf{Definition}}\] 
\[\pvar=\sum \X^2\cdot P(\X)-\left(\sum \X\cdot P(\X)\right)^2\ \leftarrow\ \mbox{Distribution Variance by the \textbf{Computing Formula}}\]
\[\boxed{\pdev=\sqrt{\sum \X^2\cdot P(\X)-\left(\sum \X\cdot P(\X)\right)^2}}\ \leftarrow\ \mbox{Distribution Standard Deviation by the \textbf{Computing Formula}}\]
\end{enumerate}
\example{Here are the calculations done in a tabular format for the
mean and standard deviation on the coin flipping example
\begin{center}
\begin{tabular}{|*{6}{c|}}\hline
\rowrulesmall\X\ (heads) & ~~~~$P(\X)$~~~~ & ~~~~$\X P(\X)\ \ (\mbox{hds})$ & $(\X-\pmean)^2\ \  (\mbox{hds}^2)$ & $(\X-\pmean)^2P(\X)\ \ (\mbox{hds}^2)$ & ~~~~~~~~~~~~~~~~~~~~~\\ \hline
0 & 1/16 &  0    & 4 & 4/16 & \\
1 & 4/16 & 4/16  & 1 & 4/16 & \\
2 & 6/16 & 12/16 & 0 &  0   & \\
3 & 4/16 & 12/16 & 1 & 4/16 & \\
4 & 1/16 & 4/16  & 4 & 4/16 & \\ \hline
\rowrulesmall &$\sum P(\X)=1$ & $\sum \X P(\X)=2$ & & $\sum(\X-\pmean)^2P(\X)=1$ & \\ \hline
\end{tabular}
\end{center}
Calculate the mean: $\displaystyle \mu = \sum\X\cdot P(\X) = 2.0\ \mbox{heads}$

Calculate the standard deviation:
$\displaystyle\pdev=\sqrt{\sum\left(\X-\pmean\right)^2\cdot P(\X)} = \sqrt{1\ (\mbox{heads}^2)}=1.0\ \mbox{head}$

Refer back to Section~\ref{sec:defnprobability} on probability
definitions where we estimated this probability experimentally.
Notice that when the theoretical results are compared to what was
observed experimentally, the theoretical parameters closely match the
experimental statistics.  We say that the probability distribution
models the physical situation.  On the basis of the probability
distribution, predictions can be made about a physical situation.}

\subsection*{Calculator Note}
\vspace{-1em}
Some modern calculators allow you to calculate means and standard
deviations of discrete probability distributions.  Try entering your
data like you would for a frequency distribution but in place of the
frequency enter the probability associated with the value.

\reading{Read your textbook pages 177-181, 198-203}
\newcommand{\discreteanswer}{
\begin{enumerate}
\item $\pdev=1.0\ \mbox{head}$
\item
\begin{enumerate}
\item $\pmean=1.19\ \mbox{pair}$
\item $\pdev=0.84\ \mbox{pairs}$; this produces a high \CV
\end{enumerate}
\item
\begin{enumerate}
\item Yes, all possible outcomes and the probability of each are listed
because  $\sum P(\X)= 1$\ .
\item 3.28
\item 1.56
\item trimodal
\item 328 
\end{enumerate}
\item
\begin{inparaenum}[~\;(a)]
\item \$3.75
\item \$0.50  
\end{inparaenum}
\item \$10,900  
\end{enumerate}
}

\assignment{\answer{\protect\discreteanswer}%
\vspace{-1em}
\begin{enumerate}
\item Using the computing formula, recalculate the standard deviation
  for the last example.  Use the remaining space on the table for your
  calculation.
\item A shoe storeowner has kept track of the proportion of times a
customer at the store buys X pairs of shoes.
\begin{center}
\begin{tabular}{|c|ccccc|}\hline
\X & ~0~ & ~1~ & ~2~ & ~3~ & ~4~\\ \hline
$P(\X)$ &  .17 & .56 & .20 & .05 & .02 \\ \hline
\end{tabular}
\end{center}
\begin{enumerate}
\item If this pattern continues to hold, how many pairs of shoes can the
next customer to the store be expected to buy?
\item Will there be much variation in this value from customer to
customer?
\end{enumerate}
\item A drive-in restaurant owner maintains records of the proportion of
vehicles containing a given \# of occupants.
\begin{center}
\begin{tabular}{|c|c|}\hline
\X (occupants) & Proportion of Vehicles \\ \hline
1 & .05 \\
2 & .45 \\
3 & .02 \\
4 & .30 \\
5 & .01 \\
6 & .17 \\ \hline
\end{tabular}
\end{center}
\begin{enumerate}
\item Is this a probability distribution?  How can we verify this?  What
is the significance of the sum of the $P(\X)$ column?
\item What is the mean of this distribution?
\item What is the standard deviation of this distribution?
\item By examining the probability column, what is the shape of this
distribution?
\item If in the future 100 cars pass through the gate, how many people
can we expect to have passed through the gates?
\end{enumerate}
\item A game is played with a 10-sided die.  5 of the sides are red, 4
are green and 1 is blue.  If a blue turns up the player wins \$10.  If
a red turns up the player wins \$1.  **Hint to do this problem set up a
probability distribution.**
\begin{enumerate}
\item What should the player pay if a green turns up in order that this
be a fair game?   (i.e. one in which the expected value over the long
run is \$0)
\item If the operator charges \$5 if a green turns up, how much will the
operator gain per play in the long run?
\end{enumerate}
\item A businessperson wishes to start a business venture.  The person
estimates that there is a 60\% chance of making a \$15,000 profit, a
30\% chance of earning an \$8,000 profit and a 10\% chance of losing
\$5,000 on the venture.  What is the expected profit from this venture?
\end{enumerate}
}

\subsection{The Binomial Distribution}
\subsubsection{Definition}
The \textbf{binomial probability distribution} is a discrete
distribution defined by the following conditions:
\begin{enumerate}
\item The \textbf{experiment} consists of a \textbf{fixed sequence of trials}.
\item Each \textbf{trial} results in either a \textbf{success} or a
  \textbf{failure}. A success means: ``What we were looking for
  happened''.
\item The \textbf{probability of a success in each trial} is \textbf{constant}.
\item The variable $\bm\X$\ is the discrete \textbf{number of successes} in the
  sequence of trials.
\item The \textbf{trials} in the sequence are \textbf{independent}.
\end{enumerate}
Note: These criteria are equivalent to a sequence using replacement
sampling.

When these conditions exist, a mathematical equation exists to calculate
the probabilities in the probability table.

\example{Verify that these conditions hold for question
  \ref{item:airline} of Section~\ref{subsec:probreview}\ .}{%
Recall: A community is serviced by a major air carrier.  80\% of all
its flights arrive on time.  On three separate occasions during the
year, a person travels via this carrier. Find the probability that the
airliner is late on exactly 1 occasion.

\begin{enumerate}
\item The experiment has 3 trials ($=$flights) in it.
\item Each flight is a success ($=$late) or a failure ($=$on time)
\item The probability of success on a trial (a late flight) is fixed at 0.2\ .
\item The variable is the number of successes (late flights) among three flights and
that is discrete.
\item Whether any flight is late or not does not depend on previous
  flights so the trials are independent.
\end{enumerate}
This situation satisfies all five conditions so it is called a
\textbf{binomial experiment}. We will use this example to show how the
mathematical equation is developed to compute binomial
probabilities. The tree diagram for this experiment shows that not all
outcomes for the 3 flights are equally likely.
\begin{center}
\includegraphics[width=3in]{image3-34.png}
\end{center}
On a path with 1 late, a joint sequence of 3 things happens. Each of
these paths has 1 late flight and 2 not late flights. To find the
probability of any of these paths, we must use the multiplication rule
for independent events.  $P(\mbox{Path 4}) = (.2)\cdot(.8)\cdot(.8)$
and $P(\mbox{Path 6})=(.8)\cdot(.2)\cdot(.8)$ and $P(\mbox{Path
  7})=(.8)\cdot(.8)\cdot(.2)$\ .  Notice that all of these
calculations have one factor of .2 and two of .8 so they produce the
same value on multiplication, $(0.2)^1\cdot(0.8)^2$.  Adding the probabilities of the
mutually exclusive paths gives
\begin{eqnarray*}
\boxed{P(\mbox{exactly 1 late})} & = & P(\mbox{Path 4}\ \OR\ \mbox{Path 6}\ \OR\ \mbox{Path 7})\\
 & = & P(\mbox{Path 4})+ P(\mbox{Path 6})+ P(\mbox{Path 7})\\
                 & = & \underbrace{(3)}_{\fbox{\begin{minipage}[b]{.65in}\raggedright Number of paths with 1 late\end{minipage}}}\cdot\underbrace{(0.2)^1\cdot(0.8)^2} _{\fbox{\begin{minipage}[b]{.65in}\raggedright Probability of path with 1 late\end{minipage}}}=\boxed{.384}
\end{eqnarray*}
}
We can generalize this into the \textbf{binomial probability function}:

The probability of \textbf{$\mathbf\X$ successes} among a sequence of
\textbf{$\mathbf n$ independent trials} where the \textbf{probability of a
success on a trial} is $\bm \pprop$ and the probability of a failure is
$\bm{1-\pprop}$ can be calculated as:\footnote{The combination
  ${_n}C_\X$ counts the number of paths with exactly $\X$ successes.
  To see this note that identifying a specific path with $\X$
  successes requires stating which $\X$ of the $n$ branches have
  successes.  This is done by selecting $\X$ numbers without
  replacement from $1\ldots n$, which can be done in ${_n}C_\X$ ways.}
\[\boxed{P(\X)={_n}C_\X\cdot \pprop^\X\cdot (1-\pprop)^{n-\X}}\]

**You may have encountered the symbol \pprop\ in previous mathematics
courses with respect to circle calculations where \pprop\ was about
3.14. \pprop\ is a lower case Greek letter roughly equivalent to the
letter $p$ in our alphabet. We will use \pprop\ to represent a parameter,
the population proportion.**

\example{In the experiment of observing the number of heads in the
  toss of 4 coins, verify that the binomial probability rule could be
  used to calculate probabilities in this. Calculate the probability
  of observing 2 heads in the flip of 4 coins.}{%
  This is a binomial experiment because \begin{inparaenum}[1)]\item we
    have a sequence of four trials (coin flips), \item each coin turns
    up in one of two states, heads (success) or tails (failure), \item
    the probability of a success remains fixed at 0.5, \item the
    number of successes is what is being counted, and \item the
    outcome on each coin is independent from the outcomes on the other
    coins.\end{inparaenum}

  Because this is a binomial experiment we can use the binomial
  probability function to do the calculation. Substitute $n = 4$,
  $\pprop=0.5$, $1-\pprop=0.5$, and $\X=2$.
\[P(2)={_4}C_2\cdot 0.5^2\cdot (1-0.5)^{4-2}=0.375\]
}
We have calculated the value for $\X=2$, but \X\ can have any integer value
from 0 to 4. If we applied this equation to the other \X\ values, we
would have the probability distribution for this experiment without
resorting to drawing the tree diagram or applying the basic probability
rules.
\begin{center}
\begin{tabular}{|c|c|}\hline
\X & $P(\X)$ \\ \hline
0 & 0.0625 \\
1 & 0.2500 \\
2 & 0.3750 \\
3 & 0.2500 \\
4 & 0.0625 \\ \hline
& $\sum P(\X)=1.0000$ \\ \hline
\end{tabular}
\end{center}

Now refer to the binomial probability tables. Notice these tables give
the complete probability distribution for any binomial experiment
where the number of trials, $n$ is 25 or less and the probability of a
success falls into one of the selected values listed in the captions
of the table.

\example{Use the binomial probability tables to verify the probability
distribution for the coin flipping experiment.}{%
Find the location in the table where n = 4, identify the caption where
probability is 0.5 and check the values in the table against the values
in the table above.

If the coins being flipped were not fair so that the chance of getting
heads on an individual coin is~.6, how does this change the
probability distribution for the experiment?  (Use the tables to
complete the table below.)  Is the probability distribution still symmetric?
\begin{center}
\begin{tabular}{|c|c|}\hline
\X & $P(\X)$ \\ \hline
0 & \\
1 & \\
2 & \\
3 & \\
4 & \\ \hline
& $\sum P(\X)=1.0000$ \\ \hline
\end{tabular}
\end{center}
}
\example{Compute the probability of getting exactly 3 sixes in 5 rolls
  of a six-sided die.}{%
First verify that this is a binomial experiment.  In this case $n=5$,
but $\pprop=1/6$ (which is not one of the probability values listed in
the table), $1-\pprop=5/6$, and $\X=3$.  Substitute these values into
the binomial function:
\[P(3)=\com{5}{3}\cdot\left[\frac{1}{6}\right]^3\left[\frac{5}{6}\right]^2=0.0322\
\leftarrow\ \mbox{Must be calculated by calculator}\]

** Notice here that at first glance this may not have seemed to be a
binomial problem since each roll of the die has six possible outcomes
not two.  The problem becomes binomial once it is recognized that
success is getting a six while failure is not getting a six. **
}
\reading{Read your textbook pages 181 to 186.}

\subsubsection{Binomial Parameters}
In Section~\ref{sec:discretedistributions} we learned that once a
probability distribution is constructed, the mean and standard
deviation parameters can be calculated by the formulae:
\[\boxed{\pmean=\sum X\cdot P(X)}\ \ \ \
\boxed{\pdev=\sqrt{\sum\left(\X-\pmean\right)^2\cdot P(\X)}}\]

This is a time consuming procedure especially when $n$ is large.  In
the case of the binomial distribution, because there is a known
function for calculating individual probabilities, these formulae can
be evaluated once and for all to find a formula for finding the mean
and the standard deviation of a binomial distribution.
\[\boxed{\pmean=n\pprop}\ \ \ \ \ \ \
\boxed{\pdev=\sqrt{n\cdot\pprop\cdot(1-\pprop)}}\]

\example{Calculate the mean and standard deviation for the coin flipping
experiment and compare the results with those found in
Section~\ref{sec:discretedistributions}.}{%
In this case $n=4$,  $\pprop=0.5$,  and $1-\pprop=0.5$, so
\[\pmean=(4)\cdot(0.5) = 2.0\ \mbox{heads}\]
\[\pdev=\sqrt{(4)\cdot(0.5)\cdot(0.5)}=1.0\ \mbox{head}\]
These results are identical to those found previously but with
considerably less effort.  These shortcut formulae are only applicable
for binomial probability distributions.
}
\clearpage
\newcommand{\binomialanswer}{
\begin{enumerate}
\item 
\begin{enumerate}
\item $2.9802\times 10^{-8}$
\item 0.1550
\item 12.5
\item 2.5
\end{enumerate}
\item
\begin{enumerate}
\item 0.0038
\item 0.0003
\item 5
\item 2.0
\end{enumerate}
\item
\begin{enumerate}
\item
 \parbox[t]{2in}{\vspace{-1em}\begin{tabular}{|c|ccccc|}\hline
\X & 0 & 1 & 2 & 3 & 4\\\hline
$P(\X)$ & 0.008 & 0.076 & 0.265 & 0.412 & 0.240\\\hline
\end{tabular}}
\item $\pmean = 2.8$
\item $\pdev = 0.92$
\item 0.349
\end{enumerate}
\item \begin{enumerate}
\item $P(\X\ge 1)=.9576$
\item $\pmean=3.0$ failures.
\item In theory the trials are dependent assuming the phones were
  tested without replacement.  However given the large number of
  phones to choose from in the population the probability of failure
  would not change appreciably after a phone was removed from it and
  so a binomial probability calculation is justified.  The
  theoretically accurate calculation would require a hypergeometric
  distribution but the answer would be the same.
\item The issue may have been related to Microsoft having not used a
  random sample.  (The problem was reported to have affected largely
  the Omnia 7 model of Samsung headsets.  Microsoft also suggested
  that those affected may have had a bad Internet connection or too
  little storage on the computer from which the update was installed,
  which also may not have been reflected in the testing lab.)
\end{enumerate}
\end{enumerate}
}
\assignment{\answer{\protect\binomialanswer}
\vspace{-1em}
\begin{enumerate}
\item A class of students wrote a 25 question true and false test.  Each
student guessed at the answer to the questions, what is the probability
that a student achieved exactly:
\begin{enumerate}
\item none correct
\item 13 correct
\item What would the mean mark in the class be?
\item What would the standard deviation of the set of marks in the class
be?
\end{enumerate}
\item If the above test in Problem 1 had been a multiple-choice test
with 5 selections on each question where only one selection is correct,
what would the answers to question 1 be?
\item 70\% of all drivers wear seat belts.  A random sample of 4 cars
are stopped.
\begin{enumerate}
\item Construct the probability distribution for the number of drivers
wearing seat belts.  Use the binomial tables.
\item Compute the mean and standard deviation of the distribution.
\item What is the probability that 2 or fewer drivers are wearing seat
belts?
\end{enumerate}
% The following was taken from this source:
% http://www.bbc.co.uk/news/technology-12564651
% 24 February 2011
% Microsoft says phone update failed 1 in 10 users
\item \begin{enumerate}
\item In February 2011 Microsoft released a software update for
  Windows mobile phones and it was found that the update had problems
  for 1 in 10 users.  If Microsoft tested the update on 30 randomly
  selected phones running the software before its release, what is the
  probability at least one would have shown problems?  (*Hint: Use the
  complement event.*)
\item Out of the 30 phones how many would you expect to fail?
\item Are the 30 trials \emph{really} independent so a binomial
  distribution is justified?
\item Assuming Microsoft did not notice the problem before the
  release, what might account for this given the high probability of
  detection?
\end{enumerate}
\end{enumerate}
}
\reading{Exercises in the text page 187 - 189}
\clearpage
\subsection{The Hypergeometric Distribution}
\subsubsection{Definition}
If the binomial criteria are met except that sampling is done without
replacement, the binomial function cannot be used.  Under these
conditions the consecutive trials are dependent and the
probability of a success varies from stage to stage in the sequence. 
The hypergeometric probability distribution applies in this case.

\example{ A carton of 12 eggs contain four that are rotten.  5 eggs
  are randomly selected from the carton \textbf{without replacement}.
  What is the probability of finding exactly 2 rotten eggs among the 5
  selected?}{%
  This is the hypergeometric case and not the binomial case because
  the trials are dependent.  As in the case of the binomial
  distribution we will identify success to be what we are counting,
  namely a rotten egg. It is easiest to visualize the calculation with
  a sampling diagram.
\begin{center}
\includegraphics[width=2in]{image3-38.png}
\end{center}
\begin{eqnarray*}
\boxed{P(2\ \mbox{rotten})} = \frac{n(2\ \mbox{rotten})}{n(5\ \mbox{eggs})} & = &\frac{\left[\parbox{12em}{\centering Number of ways of selecting 2 from 4 rotten}\right]\cdot\left[\parbox{12em}{\centering Number of ways of selecting 3 from 8 good}\right]}{\left[\parbox{12em}{\centering Number of ways of selecting 5 from 12 eggs}\right]}\\
& = & \frac{\com{4}{2}\cdot\com{8}{3}}{\com{12}{5}} = \frac{(6)\cdot(56)}{792} = \boxed{0.424}
\end{eqnarray*}
}
Generalizing our results we can write down a formula for the hypergeometric distribution.  It is computed as
\[P(\X) = \frac{\left[\parbox{12em}{\centering Number of ways of selecting the successes from the successes}\right]\cdot\left[\parbox{12em}{\centering Number of ways of selecting the failures from the failures}\right]}{\left[\parbox{12em}{\centering Number of ways of selecting the sample from the population}\right]}\]
\clearpage
We therefore get the \textbf{hypergeometric probability function:}

\begin{minipage}[c]{2.5in}
\[\boxed{P(\X)=\frac{\left(\com{S}{\X}\right)\cdot\left(\com{N-S}{n-\X}\right)}
{\com{N}{n}}}\]
\end{minipage}
where~~~~~~~~~~~
\begin{minipage}[c]{3in}
\begin{center}
\begin{description}
\item[S] = \# of successes in the population
\item[N] = \# in the population
\item[$\bm\X$]= \# of successes required
\item[n] = \# in the sample
\end{description}
\end{center}
\end{minipage}

In the example above we have $N=12$, $n=5$, $S=4$, $\X=2$.  By
inspecting the sampling diagram you can identify the necessary
combinations without memorizing the formula.  \reading{Read your
  textbook pages 189 to 192}

\subsubsection{Large Population Limit}
If the population is very large compared to the size of the sample
drawn from it, drawing the sample does not significantly change the
proportion of successes within the population from one draw to the
next.  In this case the binomial distribution can be used to
approximate probabilities with very little error.  Statisticians judge
a population to be large when the sample size $n$ is less than 5\% of
the size of the population $N$ (so $n/N<.05$).  The binomial
calculation only involves 1 combination calculation as opposed to~3 in
the hypergeometric case.
\example{Of the 50,000 voters in a constituency, 35,000 would vote
  for candidate Smith. In a random sample of 10 voters selected from
  the constituency what is the probability that only 2 voters would
  vote for Smith?}{This is really the hypergeometric distribution
  because sampling is done without replacement but as the sample of 10
  is drawn from the 50,000 voters the proportion of voters in favour
  of Smith would stay very close to 70\% on each draw. Look the answer
  up in the binomial tables with $n=10$, $\pprop=0.7$ and $\X=2$. The
  answer by the binomial approximation is $P(2)=0.001$\ .  On the
  calculator the binomial distribution formula gives
  $P(2)=.0014467005$\ .}
\clearpage
\newcommand{\hypergeometricanswer}{
  \begin{enumerate}
  \item
    \begin{enumerate}
    \item 0.0004
    \item 0.3111  
    \end{enumerate}
  \item 0.384
  \item In theory hypergeometric but in practice use the binomial
    equation.  0.1478
  \item 0.0424
  \item
    \begin{enumerate}
    \item 0.3179
    \item 0.5449
    \end{enumerate}
  \item
    \begin{enumerate}
    \item 0.3125
    \item 0.3483
    \end{enumerate}
  \item
    \begin{enumerate}
    \item 0.1258
    \item 4
    \end{enumerate}
  \item
    \begin{enumerate}
    \item .329, significant difference from hypergeometric .424 since small population ($n/N=5/12>.05$).
    \item .001445261037, well approximated by binomial value .0014467005 since $n/N=10/50000<.05$)
    \end{enumerate}
  \end{enumerate} 
}
\assignment{\answer{\protect\hypergeometricanswer}
\begin{enumerate}
\item A committee of 6 is to be struck from a group of 18 people.  7 of
the 18 are female.  If the 6 are to be chosen randomly, what is the
probability that:
\begin{enumerate}
\item no males are chosen?
\item exactly half the committee is male?
\end{enumerate}
\item Suppose a handful of 3 marbles is to be randomly drawn from a box
containing 200 marbles.  If 1/5 of the marbles are white and the rest
are coloured, what is the probability of drawing 1 white marble in the
sample?  **Hint:  3 is less than 5\% of 200.**
\item A committee of 10 is to be chosen at random from a community of
1000.  80 members of the community are receiving social assistance. 
The probability that 2 of the committee members are on social
assistance is to be found.  Is this a hypergeometric or a binomial
case?  Use the appropriate rule to compute this probability.
\item A parts bin contains 10 boxes of bolts from supplier $A$ and 30 from
supplier $B$.  10 boxes are selected at random from the parts bin.  What
is the probability that 5 are from supplier $A$?
\item A committee of 6 is to be struck from an association of 20 people.
 There are 12 males and 8 females in the association.  If the committee
is chosen randomly, what is the probability of choosing:
\begin{enumerate}
\item a committee that is evenly split, male and female
\item a committee with less than 3 females?
\end{enumerate}
\item A parts bin contains 20 bolts.  The threads are stripped on half
of the bolts.  A random sample of 5 bolts is selected from the bin. 
What is the probability that the sample contains 2 bolts with stripped
threads if:
\begin{enumerate}
\item a bolt is replaced before the next is drawn?
\item a bolt is not replaced before the next is drawn?
\end{enumerate}
\item The labour force in a city is comprised of 12,000 workers of whom
2000 are unemployed.  A random sample of 25 workers is to be surveyed
regarding their opinion about job market strategies.
\begin{enumerate}
\item What is the probability that there will be 2 unemployed
workers chosen in the sample?
\item For a truly representative sample, how many unemployed
workers should it contain?
\end{enumerate}
\item
\begin{enumerate}
\item Using the binomial distribution calculate the probability of
  $\X=2$ for the egg example if the eggs are drawn with replacement
  and compare it to the hypergeometric value.
\item Calculate the voter opinion example using the hypergeometric
  formula and compare it to the binomial distribution estimate.
\end{enumerate} 
\end{enumerate}
}
\reading{Exercises page 192}

\subsection{The Poisson Distribution}
\subsubsection{Definition}
The \textbf{Poisson probability distribution} is sometimes referred to
as the \textbf{law of improbable events} because it is used to compute
discrete probabilities where the number of trials is very large and
the probability of a success on a trial is very small.  In many of
these cases the binomial or hypergeometric formulae are the correct
formulae to use but are impractical to calculate.  Recall what happens
to the value of a factorial in a combination when the number of trials
is very large.  Most computing devices soon run out of computing power
for these very large values

If the distribution is discrete, the number of trials very large and the
probability of a success very small, probabilities are sometimes
calculated by the \textbf{Poisson probability function}:
\[\boxed{P(\X)=\frac{\pmean^\X\cdot e^{-\pmean}}{X!}}\]
Here we have:
\begin{itemize}
\item $\displaystyle\boxed{\pmean= n\cdot\pprop}$\ \ \ **Just as in the binomial case.**
\item $\displaystyle e=2.718\ldots$ found with the $\boxed{e^x}$ key on the calculator
\end{itemize}

\example{The accident rate for a certain type of industrial accident
  has been observed to be 1 per 10,000 workers in the industry.  An
  insurance company has 8000 workers insured for this type of
  accident. What is the probability that the insurance company will
  have to pay out exactly 2 claims?}{%
\begin{enumerate}[Step 1)]
\item Find the population parameter, $\bm{\pprop}$, for the proportion
  of workers from this industry who experience this type of accident.
\[\pprop= \frac{1}{10,000} = 0.0001\]
\item Since \pprop\ is small and $n$ is large we can now calculate the
  probability requested using the Poisson formula.  We need the
  \textbf{expected number} \pmean\ of workers who will experience this
  type of accident from among those insured.
\[\pmean= n\pprop= 8000\cdot\frac{1}{10,000}= 0.8\ \mbox{accidents}\]
\item \label{item:poisson} Calculate the probability.
\[P(\X=2)=\frac{\pmean^\X\cdot e^{-\pmean}}{X!}=\frac{0.8^2\cdot e^{-0.8}}{2!}= 0.143785268=0.1438\]
\end{enumerate}
}
Note:
\vspace{-1em}
\begin{itemize}
\item If the expected number of accidents had been given to us we
  could have used the Poisson probability function directly (Step \ref{item:poisson}).
\item This problem is a limiting case of a binomial problem and so
  could be done using the binomial probability function. (See problem \ref{item:binomtopoisson}.)
\item Only from the worker's perspective is the likelihood that he
  or she individually will be injured is what is ``improbable''.  The
  likelihood that at least one of the 8000 workers is injured is quite
  probable. Calculate it! ( Answer: $P(\X\ge 1)=.5507$\ )\vspace{2in}
\end{itemize} 

\subsubsection{Queuing Problems}
The Poisson distribution is often used to solve problems involving
line ups or queues, as the only requirement to do the calculation once
certain criteria are met is the average of the distribution.

\example{
The number of people in an express line was observed to follow a Poisson
distribution with an average of 5 waiting in the line at any time. 
What is the probability that a random check finds there are 7 people
waiting in line?

The average value $\pmean= 5$ persons is given and we are told that
probabilities obey the Poisson rule so substitute $\X=7$ and $\pmean=5$
into the Poisson equation.
\[P(\X=7)=\frac{\pmean^\X\cdot e^{-\pmean}}{X!}=\frac{5^7\cdot e^{-5}}{7!}\]
Calculate the answer by calculator.  You should get .1044\ .
}

Because the a Poisson Distribution depends only upon a single
parameter, $\pmean$, it is possible to tabulate it upon a single page
(compared to the binomial distribution).  Confirm on the formula sheet
the answers for the last two examples using $\pmean=.8$ and $\pmean=5$
respectively.
\reading{Read your textbook pages 193 to 196}
\clearpage
\newcommand{\poissonanswer}{
  \begin{enumerate}
  \item
    \begin{enumerate}
    \item 9
    \item 0.00012
    \item 0.1186
    \end{enumerate}
  \item
    \begin{enumerate}
    \item no, $P(\X=10)=.000056287$\ . Even $P(\X\ge 10)$ is still tiny.
    \item no
    \end{enumerate}
  \item 0.05041
  \item
    \begin{enumerate}
      \item 0.090
      \item 0.053
      \item The improbable event is that a particular person in the
        institution phones the helpdesk in any given 15 minute period.
        If, for example, there were $n=10,000$ people at the
        institution, since $2=\pmean=n\pprop$, the (im)probability of
        this event would be $\pprop=2/10,000=.0002$.
    \end{enumerate}
  \item 0.143790301 well approximated by Poisson's 0.143785268 since $n$ large and $\pprop$ small.
  \end{enumerate}
}
\assignment{\answer{\protect\poissonanswer}
\begin{enumerate}
\item The error rate in typesetting at a shop has been observed to be 1
character in 2000 for a certain type of job.  A job of this type
contains 18000 characters.
\begin{enumerate}
\item How many typesetting errors should they expect on the job?
\item What is the probability of finding 0 typesetting errors?
\item What is the probability of finding 10 typesetting errors?
\end{enumerate}
\item Following a particular office procedure, it has been observed that
the error rate in entering transactions in a journal are 7 per 1000. 
An auditor selects 300 entries and finds 10 errors in transactions
entered in the journal by a new employee.
\begin{enumerate}
\item Is this likely to occur given the error rate of the office?
\item If the auditor observes 10 errors is chance the probable cause of
the error?  Explain.
\end{enumerate}
\item The average number of people in line at the wicket of a parcel
  post counter is 3.  What is the probability that the next time you
  observe this line up that there will be 6~people waiting?
\item The IT helpdesk at a large institution receives on average 2
  calls in any given 15 minute period.  (For simplicity, assume that
  the helpdesk employee is occupied for the full fifteen minutes
  dealing with the issue.)  Use the Poisson table to answer the
  following.\begin{enumerate}
\item What is the probability exactly four helpdesk employees will be
  answering a call in any given 15 minute period?
\item If there are always four employees at the IT switchboard, what
  is the probability that someone will not be able to get help
  immediately when they call the helpdesk?
\item What is the ``improbable event'' in this problem that allows us
  to use the Poisson distribution?
\end{enumerate}
\item \label{item:binomtopoisson} Recalculate the probability of
  paying 2 claims for industrial accidents using the binomial
  probability function.  Compare your answer to the Poisson
  approximation.
\end{enumerate}
}
\reading{Exercises pp 196 - 197}

\clearpage
\newcommand{\discretereviewanswer}{
\begin{enumerate}
\item
\begin{enumerate}
\item 3.11
\item 1.80
\end{enumerate}
\item \$0.40
\item
\begin{enumerate}
\item 0.2621
\item 0.0001
\item 0.7379
\end{enumerate}
\item
\begin{enumerate}
\item 0.4598
\item 0.5632
\end{enumerate}
\item
\begin{enumerate}
\item 0.015
\item 0.0549
\end{enumerate}
\item $1.1\times 10^{-5}$
\end{enumerate}
}
\subsection[Review Exercises on Discrete\\Probability Distributions]{Review Exercises on Discrete Probability Distributions}
\answer{\protect\discretereviewanswer}
\label{subsec:discretereview}
\begin{enumerate}
\item A grocery store keeps track of the proportion of times that a
given number of rotten oranges are found in boxes supplied by a certain
produce wholesaler.  They observed:
\begin{center}
\begin{tabular}{|c|cccccccc|}\hline
\X & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \hline
$P(\X)$ &  0.08 & 0.12 & 0.16 & 0.26 & 0.17 &  0.10 &  0.06 &  0.05 \\\hline
\end{tabular}
\end{center}
\begin{enumerate}
\item On the average, how many rotten oranges are found per box?
\item How much variation is there among boxes in the number of rotten
oranges found per box?
\end{enumerate}
\item \label{item:riggedgame} Consider the rigged betting game
  involving black and white spheres and cubes from
  page~\pageref{page:bettingexample}.  What is your expected winnings
  per game following the revised betting strategy based on knowledge
  of the shape if it costs \$4 to bet on white and \$6 to bet on
  black?  Remember the strategy is to bet on white ($\NOT B$) if it is
  a cube ($C$) and black ($B$) if it is a sphere ($\NOT C$).

  ** Hint: Create a discrete probability distribution with \X\ being
  the possible winnings \mbox{(-\$4, \$4, -\$6, \$6)}.  The respective
  probabilities of each event turn out to be the 4 possible joint
  probabilities (~$P(B\ \AND\ C)$, $P(B\ \AND\ \NOT C)$, $P(\NOT
  B\ \AND\ \NOT C)$, $P(\NOT B\ AND\ C)$ ).  Fill in
  the table and calculate the expected value~$\pmean$.~**
\item Of all the members of a large credit union, 20\% have loans with
the credit union.  A random sample of 6 members are polled regarding
their credit agency.  What is the probability that of the 6:
\begin{enumerate}
\item None have loans with the credit union?
\item All six have loans with the credit union?
\item At least 1 has a loan with the credit union?
\end{enumerate}
\item A stack of 30 bills contains 10 that are counterfeit.  If 2
different bills are examined, what is the probability that: 
\begin{enumerate}
\item One is counterfeit?
\item At least one is counterfeit?
\end{enumerate}
\item An auditor knows that in a certain situation standard office
procedure is not followed about 3\% of the time.  The auditor examines
300 transactions made under this condition.  What is the probability
that:
\begin{enumerate}
\item in 3 transactions procedure was not followed?
\item in less than 5 transactions procedure was not followed?
\end{enumerate}
\item An assembly line is packaging bolts in lots of 100 to a carton. 
The line is set so that the error rate in packaging is 1\%.  That is
1\% of all packages do not have 100 bolts.  Suppose a random sample of
30 cartons of bolts are examined for content.  What is the probability
that 5 cartons do not have the required number of bolts?
\end{enumerate}

\clearpage
\section{Continuous Probability Distributions}
\subsection{Definition}
Continuous distributions model situations where the variable's value
is obtained by a measuring process.  In the cases examined so far, the
variable's value has always been obtained by counting and that is why
the binomial, hypergeometric and Poisson distributions were referred
to as discrete distributions.

A continuous variable might represent a quantity such as:
\begin{center}
Length, Weight, Test scores, Volume, Fuel Economy, etc.
\end{center}

Any measured value, by the nature of the measuring process, is
inaccurate.  A measuring process is incapable of coming up with an
exact value unlike a counting process that always comes up with an
exact value.

If an object has a reported length of 3.51 m, this is interpreted as a
length being in the interval:
\begin{center}
\includegraphics[width=3in]{image3-40.png}
\end{center}
The true value for the length is unknown.  This notion applies to
every measurement.  The reported value is only as accurate as the
device used to take the measurement.  The probability that a
continuous variable assumes some exact value is 0.  So, for instance,
$P(\X=3.51000000\ldots)=0$\ .  Probabilities for continuous variables
must be therefore be specified over an \textbf{interval}. For example
we wish to know \mbox{$P(3.505\ \mbox{m}<\X < 3.515\ \mbox{m})$}.

On a discrete distribution curve, individual probabilities $P$ are
plotted at distinct locations $\X$ on the horizontal axis.  We often
choose to plot these as bars with width one, both for appearance but
also so that the area of the bar also equals the probability
($\mbox{Area}=P\cdot 1=P$).  However, in the discrete case, the
intermediate values between the discrete outcomes are not possible
measurements.  For instance, in our discrete coin-toss histogram below
a value of $\X=1.23$ is not a possible outcome.  On a continuous
distribution curve, there is a point plotted for every value on the
horizontal axis since the value of the variable could be anywhere on
the interval.
\begin{center}
\includegraphics[width=6in]{image3-41.png}
\end{center}

Smooth continuous curves can be represented by a mathematical
expression called a \textbf{probability density function},
$\mathbf{\p(\X)}$.  The function does not calculate probabilities but
calculates the y-values on the curve. It generates the plotted points
on the curve. The $\p(\X)$ curve has the property that the
\textbf{area under the curve is 1}. The probability of an event is
found by determining the \textbf{area under the curve} and above the
\X-axis associated with the \textbf{interval} of the event.

\subsection{Experimental Probability Densities}
\label{subsec:experimentaldensity}
It should be note that in Unit 1 we already created our own
probability density functions when we plotted the relative frequency
density histogram \p\ versus \X, or even better the smoothed out
relative frequency polygon $\p(\X)$ versus \X\ for a continuous
variable.  For example if we created these plots for the distribution
of basketball player heights introduced in Section 6.2 of Unit 1 we
have:
\begin{center}
\begin{asy}
import graph;
import stats;
size(400,200,IgnoreAspect);
real[] bins={169,171,173,175,177,179,181,183,185};
real[] mids={168,170,172,174,176,178,180,182,184,186};
real[] count={4,10,14,73,70,17,10,2};
real[] countwzeros={0,4,10,14,73,70,17,10,2,0};
real zerof(real x) {return 0.0;}
ylimits(0,73);
histogram(bins, count, bars=false);
xaxis("$\mbox{Height(cm)}$",xmin=min(bins)-(bins[1]-bins[0]),xmax=max(bins)+(bins[1]-bins[0]),Bottom,LeftTicks(Ticks=bins));
yaxis("$\f$",Left,RightTicks(trailingzero));
draw(graph(mids,countwzeros),black+dashed+1);
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,73/(2*200));
    draw(pic,graph(pic,zerof,167,187),invisible);
    yaxis(pic,"$\p\ (1/\mbox{cm})$",Right,LeftTicks);
  });
add(q);
label(shift(5mm*N)*"Frequency ($\f$) and Probability Density ($\p$) Versus Height",point(N));
\end{asy}
\end{center}
In Unit 1 if we were interested in measuring the proportion of
observations between the two variable values $\X=173\ \mbox{cm}$ and
$\X=179\ \mbox{cm}$ we would have calculated the area under the
relative frequency density polygon (using the heights measured off the
$\p$-axis) over the interval $(173\ \mbox{cm}, 179\ \mbox{cm})$.  To
consider $\p(\X)$ as a probability density one could simply rephrase
the question as, ``What is the probability that a basketball player in
the sample, chosen at random, lies within interval $(173\ \mbox{cm},
179\ \mbox{cm})$?''  The answer would be the same.  Finally, the more
useful probabilistic interpretation, however, is one of inference,
namely, if the height of any high-school basketball player in Western
Canada is measured, what is the likelihood it lies within
$(173\ \mbox{cm}, 179\ \mbox{cm})$?  Since the sample relative
frequency density should be a good approximation of that for the
population, the answer, once again, is just the area under the curve
over the interval.  As such our work in constructing relative
frequency density polygons $\p(\X)$ amounts to creating probability
density functions experimentally; only a change of interpretation is
required.  \example{Find the probability a randomly selected
  basketball player is between 173 cm and 179 cm by estimating the
  area under the curve.  Shade in the area. (Remember to use the
  probability density axis, $\p$, for the height.  Using the histogram
  line rather than the frequency polygon will be easier since it gives
  rectangles with area base times height.) (Answer: $\approx .785$)}{%
  $P(173\ \mbox{cm}<\X<179\ \mbox{cm})=$\vspace{1in}}

\clearpage
\subsection{The Normal Curve or Bell Curve}
\subsubsection{Definition}
\label{subsubsec:normaldefn}
Any function of a variable with total area under the curve equalling
one could be interpreted as a probability density function, and, as
seen above, we can create our own experimentally that have this
property. We have already seen that special cases of discrete
probability distributions occur: the binomial, hypergeometric, and
Poisson distributions.  Similarly the \textbf{normal curve} or
\textbf{bell curve} is a special case of a probability
density function.  The probability density function for the normal
curve is:
\[\boxed{\p(\X)=\frac{1}{\pdev\sqrt{2\pi}}\cdot e^{-\frac{1}{2}\left(\frac{\X-\pmean}{\pdev}\right)^2}}\]
  It is not necessary to know this equation to work with the
  distribution.  The normal curve is useful for modeling certain types
  of measurement distributions and also shows up theoretically.  As an
  example of the former if we take the parameters $\pmean=177.0\ \mbox{cm}$
  and $\pdev=2.5\ \mbox{cm}$, which are the actual mean and standard
  deviation of the basketball player data, a plot of normal curve
  (solid line) is as follows:
\begin{center}
\begin{asy}
import graph;
import stats;
size(400,200,IgnoreAspect);
real[] bins={169,171,173,175,177,179,181,183,185};
real[] mids={168,170,172,174,176,178,180,182,184,186};
real[] count={4,10,14,73,70,17,10,2};
real[] countwzeros={0,4,10,14,73,70,17,10,2,0};
real zerof(real x) {return 0.0;}
real normalf(real x) {return 1/(sqrt(2pi)*2.47)*exp(-.5((x-176.96)/2.47)^2);}
ylimits(0,73);
/*histogram(bins, count, bars=false);*/
xaxis("$\mbox{Height(cm)}$",xmin=min(bins)-(bins[1]-bins[0]),xmax=max(bins)+(bins[1]-bins[0]),Bottom,LeftTicks(Ticks=bins));
yaxis("$\f$",Left,RightTicks(trailingzero));
draw(graph(mids,countwzeros),dashed+1);
picture q=secondaryY(new void(picture pic) {
    ylimits(pic,0.0,73/(2*200));
    draw(pic,graph(pic,zerof,167,187),invisible);
    draw(pic,graph(pic,normalf,167,187),black+1.5);
    yaxis(pic,"$\p\ (1/\mbox{cm})$",Right,LeftTicks);
  });
add(q);
label(shift(5mm*N)*"Relative Frequency Density and Normal Curve",point(N));
\end{asy}
\end{center}
We see that our frequency polygon (dashed line) derived from the
experimental data is quite close to the normal curve and we would say
our data is approximately \textbf{normally distributed}. It is
important to note that the graph of the normal curve is completely
specified by its mean~\pmean\ and standard deviation~\pdev.  Different
values of \pmean\ and \pdev\ will produce different curves but all of
these curves have essential properties in common.  If we made a table of values for \X\ and $y=\p(X)$ for any normal distribution with a given
mean and standard deviation and plotted the ordered pairs, the curve
that results always has some standard features in common with our example:
\begin{enumerate}
\item The curve is bell-shaped.
\item The curve is symmetrical about \pmean.
\item The curve is asymptotic to the X-axis.
\item \label{item:fixedprop} A fixed proportion of observations (probability) lie within a
  given number of standard deviations of the mean.  The distance from
  the mean is plotted in units of standard score \Z, already
  introduced in Unit 1, Section 16.2: $\boxed{\Z=\frac{\X-\pmean}{\pdev}}$
\end{enumerate}
\reading{page 211}
Because of this last property, it is useful to add a standard score axis $\Z$ below the $\X$-axis:
\begin{center}
\includegraphics[width=4in]{image3-42.png}
\end{center}
\subsubsection{The Empirical Rule}
In order to evaluate probabilities involving normally distributed
variables we need to be able to find the area under the curve for
intervals of interest.  Because of standard
feature~\ref{item:fixedprop} of normal variables detailed in the last
section we can state the following known as the \textbf{Empirical
  Rule}:

If a variable is \textbf{normally distributed} a measurement has a
\begin{itemize}
\item \textbf{68\%} or roughly \textbf{2/3} chance of falling within
  \textbf{1} standard deviation of the mean.
\item \textbf{95\%} chance of falling within \textbf{2} standard
  deviations of the mean.
\item \textbf{99.7\%} chance of falling within \textbf{3} standard
  deviations of the mean.  (Effectively all the measurements fall
  within this interval.)
\end{itemize}

The following diagram illustrates a curve with this dispersion about
average.
\begin{center}
\includegraphics[width=4in]{normal2.png}
\end{center}

In symbols the Empirical Rule states:
\begin{itemize}
\item $P(\pmean-1\pdev<\X<\pmean+1\pdev)=P(-1<\Z<1)\approx.68$
\item $P(\pmean-2\pdev<\X<\pmean+2\pdev)=P(-2<\Z<2)\approx.95$
\item $P(\pmean-3\pdev<\X<\pmean+3\pdev)=P(-3<\Z<3)\approx.997$
\end{itemize}

The Empirical Rule should be memorized to allow quick interpretations
of normally distributed variables.  Note that the Empirical Rule can
be used to interpret the likelihood of a measurement of a normally
distributed variable in the same way we used Chebyshev's Theorem
before in Unit~1 but now more specifically.\footnote{See
  problem~\ref{item:chebynormal}\ page~\pageref{item:chebynormal}.}  A
value of \X\ with $|\Z|\approx 0$ is approximately equal to the mean,
with $|\Z|\approx 1$ is only slightly removed from the mean, with
$|\Z|\approx 2$ is moderately removed from the mean while greater than
three standard deviations different ($|\Z|\gtrsim 3$) is extremely far
from the mean (and hence improbable).

\example{If a set of exam marks are normally
distributed with a mean of 72\% and a standard deviation of~8\%.
\begin{enumerate}
\item What is the range of scores achieved?
\item Between what two scores will the middle 2/3 of
the class fall?
\item Above what value do the top 2.5\% of the scores lie?
\item Is a grade of 40\% a typical mark?
\end{enumerate}}{%
A diagram illustrating the Empirical Rule for this problem is as follows:
\begin{center}
\includegraphics[width=4in]{normal3.png}
\end{center}
Here we labelled the \X-axis just by starting at the mean (72\%) and
going up and down in units of the standard deviation (8\%).

With the aid of the diagram one has:
\begin{enumerate}
\item $\displaystyle R=\X_n-\X_1\approx (\pmean+3\pdev)-(\pmean-3\pdev)=96\%-48\%=48\%$
\item Between $\pmean-1\pdev=64\%$ and $\pmean+1\pdev=80\%$
\item We need a tail of area 2.5\%, so above $\pmean+2\pdev=88\%$
\item $\displaystyle \Z=\frac{\X-\pmean}{\pdev}=\frac{40\%-72\%}{8\%}=-4$, which is not typical ($|\Z|>3$)
\end{enumerate}
}

\subsubsection{Areas Under the Normal Curve}
Sometimes we are interested in the probability associated with an
arbitrary interval of a normal variable~\X\ so the Empirical Rule is
of no use.  If \X\ has mean $\pmean$ and standard deviation $\pdev$,
the procedure used to calculate the area under the normal curve above
such an interval is to first transform it into its equivalent interval
in terms of the standard score $\Z$ which has mean 0 and standard
deviation 1.  The normal curve with this transformed axis is called
the \textbf{standard normal curve}. Areas under this curve can be
calculated\footnote{The student familiar with calculus will recognize
  that the problem is one of evaluating a definite integral of the
  form $\int_a^b e^{-\Z^2/2}\; d\Z$.  Despite its simplicity, the
  integrand has no antiderivative in terms of simple functions and the
  integral must be evaluated numerically.}  and are tabulated on the
formula sheets.  Our tables tabulate the area from 0 to \Z. More
complicated areas are built out of these areas using the properties of
the normal distribution.
\begin{description}
\item[Example 1:]\
\begin{center}
\includegraphics[width=3in]{image3-43.png}

$P(0<\Z<1.28)=0.3997$

(directly from the table)
\end{center}

\item[Example 2:]\
\begin{center}
\includegraphics[width=3in]{image3-44.png}

 $P(-0.50<\Z<0) = 0.1915$

(since, by symmetry of the normal distribution, $P(-0.50<\Z<0)=P(0<\Z<0.50)$\ )
\end{center}
\item[Example 3:]\
\begin{center}
\includegraphics[width=3in]{image3-45.png}

$P(-0.50<\Z<+1.28)= 0.1915+0.3997= 0.5912$

(the total shaded region is the sum of the two previous regions.)
\end{center}

\item[Example 4:]\
\begin{center}
\includegraphics[width=3in]{image3-46.png}

$ P(+0.50<Z<+1.28)=0.3997-0.1915=0.2082$

(the shaded region is the difference of the first two regions.)
\end{center}

\item[Example 5:]\
\begin{center}
\includegraphics[width=3in]{image3-47.png}

$P(Z<+1.28)=0.5+0.3997=.8997$

(half the normal curve, by symmetry, is 0.5 area)
\end{center}
\end{description}
In summary:
\begin{enumerate}
\item The table of normal curve gives the area between centre ($\Z=0$) and a
positive \Z\ value.
\item The area between centre and a negative \Z\ value is identical to the
area between centre and a positive \Z\ value because of the symmetry of
the curve.
\item The area in the table may not be the area on the interval in
  question. These areas might have to be added together or subtracted.
  If a tail area is involved remember half the normal curve is~0.5 in area.
\end{enumerate}

\example{Continuing the previous example, if test scores on a
  personnel test are normally distributed with a mean of 72\% and a
  standard deviation of 8\%.\vspace{-1em}
\begin{enumerate}
\item What proportion of scores fall between 72\% and 90\%?
\item What proportion of scores exceed 90\%?
\item Below what grade do the lowest 10\% of the exams fall?
\end{enumerate}\vspace{-3em}}{%
\begin{center}
  \boxedtext{For all normal distribution problems a properly labelled
    diagram with correct scales on the \X\ and \Z-axes allows easy
    checking of the reasonability of solutions.}
\end{center}
Variable \X\ is the test score so draw a bell curve with a test score
axis as we did in the original Empirical Rule diagram. To find areas
under this curve, a second horizontal axis with the standard score
must be included. (Note the scale ticks have been omitted here for clarity.)

\begin{enumerate}
\item\
\begin{center}
\includegraphics[width=3in]{image3-48.png}
\end{center}
Since $\X=72\%$ is the mean, it corresponds to $Z=0$.  Transform
$\X=90\%$ to its corresponding $\Z$-score:
\[\Z=\frac{X-\pmean}{\pdev}=\frac{90\%-72\%}{8\%}=2.25\]
The area in the shaded region is:
\[P(72\%<\X<90\%)=P(0<Z<2.25)=0.4878\]
from the tables.

\item\
\begin{center}
\includegraphics[width=3in]{image3-49.png}
\end{center}
The area in the right tail is:
\[P(90\%<\X)=P(2.25<\Z)=0.5-0.4878 = 0.0122\]
\item\
\begin{center}
\includegraphics[width=3in]{image3-49p.png}
\end{center}
In this case we work in reverse.  The tail has an area of 10\%=.1000,
which corresponds to a table area of $.5-.1000=.4000$ The closest
value inside the table is 0.3997 which corresponds to a \Z-value of
1.28. Since we are to the left of the mean, we use $\Z=-1.28$.
Inverting our $\Z$-score formula gives:
\[\boxed{\X=\pmean+\Z\pdev}=72\%+(-1.28)\cdot(8\%)=61.76\%=62\%\]
\end{enumerate}
}

\reading{Read pp 206 -- 215 and 219 - 225 in the textbook}

\subsection{Tests for Normality}
One of the most important objectives of statistics is to determine a
goodness of fit of a set of data to a theoretical model. Once we fit a
set of data to a particular theoretical model in statistics, we can
use that model to solve the problems pertaining to the analysis of
that data.

The normal probability model is the most commonly applied model. In
most applied problems it would be good to know that the normal
distribution is a close approximation to the actual unknown
distribution we are working with, particularly because it is easy to
use.  We have already considered some methods to compare a
distribution to the normal distribution:
\begin{compactenum}
\item Plot histograms/frequency polygons and compare the appearance
  observed to that of the normal curve (using the data's mean and
  standard deviation) for shape.  %Also Stem-and-leaf graphs and box plots
\item Compute the descriptive summary measures (mean, median, mode,
  standard deviation) and compare the characteristics of the data with
  those of the theoretical properties of the normal probability
  distribution.
\item Compare the proportions of data within units of standard
  deviations from the mean with those prescribed by the empirical rule.
\end{compactenum}
%The first option says what line to put the picture at
%The second option says whether the picture should be left (l) centre (c)
%or right(r)
\begin{window}[0,r,%
\mbox{\includegraphics[width=3.8in]{height_normal_paper.png}},]
Another approach to checking for normality is to plot a cumulative
relative frequency ogive ($\lcr$ versus \X) on \textbf{normal
  probability paper}. This type of graph paper has a regular
arithmetic horizontal axis for \X, but the vertical axis indicates
cumulative probabilities associated with a normal distribution. It is
a transformed normal scale.  If the plot of data makes a relatively
straight line, the normal distribution is a good approximation and may
be used for solving the problem at hand. Note that the idea of
linearizing data is a common method for recognizing trends in
observations.
%Some graph paper is printed with Z-scores in place of the cumulative
%probabilities. Note that the data is ranked in order from the smallest
%to largest for the plot.
As an example if we plot an ogive for the basketball player heights of
Section 6.2 of Unit 1 on normal probability paper we see that the
points lie quite close to a straight line, suggesting the data is
well-described by a normal distribution.  This was also
suggested by our earlier frequency polygon plot.

Other methods exist for testing the normality of data but are beyond
the scope of this presentation.
\end{window}
% This is the data for the above plot:
% X   <CP
%169    0
%171  .02
%173  .07
%175  .14
%177  .505
%179  .855
%181  .94
%183  .99
%185 1.00
\reading{Exercises pp 215 -- 217 and 225 - 228}
\vfill
\boxedtext{
The normal curve will be used repeatedly in Unit 3.
Students are encouraged to master this topic before proceeding.
}
\clearpage
\newcommand{\normalanswer}{%
\begin{enumerate}
\item
\begin{enumerate}
\item $\mbox{Range}\approx\$46,500-\$28,500=\$18,000$, approx 68\% between \$34,500 and \$40,500, approx 95\% between \$31,500 and \$43,500
\item \begin{inparaenum}[i)]
\item $\Z=+1.50$~(typical)
\item $\Z=-3.17$~(unlikely)
\item $\Z=+7.50$~(very unlikely)
\end{inparaenum}
\item 95\%
\item 97.5\%
\item \$28,500.00
\end{enumerate}
\item
\begin{enumerate}
\item 0.4772
\item 0.2119
\item 0.6730 
\end{enumerate}
\item
\begin{enumerate}
\item 0.50
\item 0.9502
\item 69.6\%
\item 81.2\%
\item 212 people
\end{enumerate}
\item
\begin{enumerate}
\item 0.9131
\item 0.9830
\item 0.8961
\end{enumerate}
\item 81.45\%
\item 96.71 mm to 103.29 mm
\item 73\%
\item $P(-1.00<\Z<1.00)=.6826$, $P(-2.00<\Z<2.00)=.9544$, $P(-3.00<\Z<3.00)=.9974$
\item $k=2$: $95\%>75\%$, $k=3$: $99.7\%>89\%$
\item $P(173\ \mbox{cm}<\X<179\ \mbox{cm})=.7333$ (normal) $\approx~.785$ (original)
\item \begin{enumerate}
\item ~\begin{tabular}{lll}\toprule
Destination & $\smean\ ({}^\circ\mbox{C})$ & $\sdev\ ({}^\circ\mbox{C})$ \\ \midrule
Cancun, Mexico & 29.1 & 1.5 \\ 
Los Angeles, California & 19.5 & 4.0 \\
Malibu, California & 16.3 & 3.0 \\
Mazatlan, Mexico & 26.2 & 1.7 \\
Miami, Florida & 26.3  & 3.1 \\
Phoenix, Arizona & 22.1 & 4.3 \\ 
Puerto Vallarta, Mexico & 26.5 & 1.4 \\
Varadero, Cuba & 28.3 & 3.4 \\ \bottomrule
\end{tabular}
\item \resizebox{\columnwidth}{!}{\begin{tabular}{lrcc}\toprule
Destination & \Z~ & Interpretation of \Z & $P(\X\ge 25^\circ\mbox{C})$ \\ \midrule
Cancun, Mexico & -2.73 & extremely low & 0.9968 \\ 
Los Angeles, California & 1.38 & slightly high & 0.0838\\
Malibu, California & 2.90 & extremely high & 0.0019\\
Mazatlan, Mexico & -0.71 & slightly low & 0.7611 \\
Miami, Florida & -0.42 & approximately average & 0.6628 \\
Phoenix, Arizona & 0.67 & slightly high & 0.2514\\ 
Puerto Vallarta, Mexico & -1.07 & slightly low & 0.8577\\
Varadero, Cuba & -0.97 & slightly low & 0.8340\\ \bottomrule
\end{tabular}}

Here \X\ is the daily high temperature on March $1^{\mbox{\scriptsize st}}$.
\item \resizebox{\columnwidth}{!}{\begin{tabular}{lcc}\toprule
Destination & \pmean\ (beach days) & $P(\X\ge 5)$ \\ \midrule
Cancun, Mexico & 7.0 & $0.999998864\approx 1$\\ 
Los Angeles, California & 0.6 & $7.5098\times 10^{-05}\approx 0$\\
Malibu, California & 0.0 & $5.1836\times 10^{-13}\approx 0$\\
Mazatlan, Mexico & 5.3 & 0.7791 \\
Miami, Florida & 4.6 & 0.5617 \\
Phoenix, Arizona & 1.8 & 0.0132 \\ 
Puerto Vallarta, Mexico & 6.0 & 0.9354 \\
Varadero, Cuba & 5.8 & 0.9052 \\ \bottomrule
\end{tabular}}

Here \X\ is the number of beach days and $P(\X\ge
5)=P(5)+P(6)+P(7)$. Note independence from day to day for weather is
a bad approximation since weather usually comes in systems that go for
multiple days.  As such you might expect the distribution for \X\ to
be more polarized, with all bad and all good days being more likely
than indicated by the binomial distribution.
\end{enumerate}
\end{enumerate}
} 
\assignment{\answer{\protect\normalanswer}%
For each question part below make sure to draw a labeled
  diagram of the normal curve with the appropriate region shaded
  in. Pay attention to the proper use of symbols.
\begin{enumerate}
\item The distribution of wages in a community is approximately normal
  with a mean of \$37,500 and a standard deviation of \$3,000.  ** The following
  questions require only the use of the Empirical Rule **
\begin{compactenum}
\item Draw a labeled diagram to illustrate this information.
\item What are the standard scores of incomes of
\begin{inparaenum}[i)]
\item \$42,000
\item \$28,000
\item \$60,000?
\end{inparaenum}
Which of these wages would you typically find in the community?
\item What proportion of all wage earners in the community earn between
\$31,500 and \$43,500?
\item What is the probability a wage earner in the community earns more
than \$31,500? 
\item What is the minimum wage likely to be observed in the community?
\end{compactenum}
\item The heights of males in the general population is approximately
  normal with a mean of 172 cm and a standard deviation of 10 cm.  If
  a male is selected at random, what is the probability his height
  falls within the range
\begin{compactenum}
\item $172\ \mbox{cm}<\X<192\ \mbox{cm}$ ?
\item $\X>180\ \mbox{cm}$ ?
\item $160\ \mbox{cm}<\X<180\ \mbox{cm}$ ?
\end{compactenum}
\item Scores on an aptitude test have been observed to be approximately
normal with a mean of 76\% and a standard deviation of 5\%.
\begin{compactenum}
\item What proportion of all scores exceed the mean?
\item What proportion of the scores are between 65\% and 85\%?
\item Below what score do the bottom 10\% of all scores fall?
\item Above what score do the top 15\% of all scores fall?
\item If 1000 people took the test, how many would you expect to score
above 80?
\end{compactenum}
\item Delinquent accounts for a chain store are normally distributed
with a mean of \$308.45 and a standard deviation of \$43.09.  If an
account is selected at random from among those that are delinquent,
what is the probability that it falls in the range?
\begin{compactenum}
\item $\X>\$250$
\item $\X<\$400$
\item $\$250<\X<\$400$
\end{compactenum}
\item A personnel office hires only those persons who score in the top
5\% of an applicant test.  Scores on the test vary about an average of
65\% with a standard deviation of 10\%.  What is the cutoff score for being
hired?
\item A machine produces parts that are circular in cross section.  The
diameter of the cross section can be controlled by the production
process to vary normally about a mean of 10 cm with a standard
deviation of 2 mm.  Parts whose diameters differ from the average too
significantly are rejected as scrap.  If the extreme 10\% of the parts
are rejected, what is an acceptable range for the diameter of a part?
\item A set of test scores are normally distributed with a mean of 70\%
and a standard deviation of 10\%.  Suppose a person receives a percentile
of 62.  What was the person's actual score on the test?
\item Confirm the Empirical Rule results using areas from the normal distribution table.
\item \label{item:chebynormal} Using the Empirical Rule, verify that Chebyshev's Theorem applies for the normal distribution with $k=2$ and $k=3$.
\item In Section~\ref{subsec:experimentaldensity} you found the
  probability a basketball player was between 173~cm and 179~cm.  In
  Section~\ref{subsubsec:normaldefn} that probability distribution was
  then modelled with a normal distribution with standard deviation
  $\pmean=177.0\ \mbox{cm}$ and standard deviation $\pdev=2.5\ \mbox{cm}$.
  Recalculate the probability using the normal model and compare it to
  your original result.
% The temperatures for the following problem were found at the
% weather underground (http://www.wunderground.com/) and go up to and
% including 2011.
\item You are interested in going south for a week during Spring
  Break.  The following table gives a sample of past years data (up to
  2011) for the high temperature on March $1^{\mbox{\scriptsize st}}$
  for various locations.
\begin{center}
\begin{tabular}{lccccccccccccccc}\toprule
Destination & \multicolumn{10}{c}{March $1^{\mbox{\scriptsize st}}$ Daily High (${}^\circ$C)} \\ \cmidrule{2-11}
Cancun, Mexico &  28 &  27 &  28 &  28 &  31 &  30 &  28 &  31 &  31 &  29 \\ 
Los Angeles, California &  17 &  22 &  29 &  14 &  19 &  19 &  19 &  17 &  18 &  21 \\
Malibu, California &  13 &  17 &  22 &  14 &  14 &  15 &  17 &  15 &  15 &  21 \\
Mazatlan, Mexico &  25 &  26 &  28 &  26 &  27 &  29 &  26 &  23 &  25 &  27 \\
Miami, Florida &  31 &  21 &  29 &  26 &  28 &  26 &  23 &  26 &  29 &  24 \\
Phoenix, Arizona &  24 &  19 &  30 &  27 &  18 &  24 &  22 &  19 &  16 &  22 \\ 
Puerto Vallarta, Mexico &  24 &  27 &  29 &  26 &  26 &  27 &  27 &  25 &  27 &  27 \\
Varadero, Cuba &  29 &  22 &  28 &  33 &  28 &  24 &  28 &  33 &  29 &  29 \\ \bottomrule
\end{tabular}
\end{center}
Pick one of the above destinations and do the following
calculations. (You can compare the destinations by looking at the
answer key when you're done.)
\begin{enumerate}
\item Calculate the mean and standard deviation for the March
  $1^{\mbox{\scriptsize st}}$ high temperature for your location.
  (Check your answer before proceeding to the next question.)
\item A good day at the beach or lying by an outdoor pool absolutely
  requires a daily high of at least $25^\circ$C.  If we assume the
  daily high temperature for your location is \textbf{normally
    distributed} with the mean and standard deviation you calculated
  from the last question:
\begin{enumerate}
\item Calculate and interpret the \Z-score for $25^\circ$C at your location.
\item What is the probability that a given day at the beginning of
  March will have beach weather (high at least~$25^\circ$C) at your
  location?  (Check your answer before proceeding to the next
  question.)
\end{enumerate}
\item Next, assume you will be staying for one week.  If the weather
  on each day could be considered to be independent -- a bad
  approximation (why?) -- use your probability from the last question
  and the \textbf{binomial distribution} to calculate:
\begin{enumerate}
\item The expected (mean) number of days out of the seven that will have
  beach weather (high at least $25^\circ$C).
\item The probability that you will have at least 5 days of beach
  weather for your week.
\end{enumerate}
\end{enumerate}

\end{enumerate}}
\clearpage
\customlistofanswer
\clearpage
%%%%%%%%%%%%%%
%Input the probability tables for this unit
\input{binomial_poisson_normal_tables.tex}
% Make the formula sheet. Make it an empty page and start a new one so
% student can take it out.
\cleardoublepage
\thispagestyle{empty}
% Note that there may be a better way to do this, but I used the tabular
% environment because I wanted to have fixed width columns using m{}.  I
% then put \centering and $\displaystyle as input to the preamble of each
% column and $ after each column.  Finally note that you can't use \\ to
% end a line - the \centering chokes with a noalign error.  The webpage on
% Tables in the LaTeX wikibook was helpful here.
% The rowrule commands provide extra height and are defined in lectures.sty
\section*{Probability Formulae}
%\subsection*{Counting Rules}
\textbf{\large Counting Rules}\vspace{.2em}\newline
\begin{tabular}{|*{3}{>{\centering$\displaystyle\rowrule}m{.333\textwidth}<{$}}|}\hline
\perm{n}{r}=\frac{n!}{(n-r)!} & n^r & \com{n}{r}=\frac{n!}{r!(n-r)!} \tabularnewline \hline
\end{tabular}\vspace{.5em}

\textbf{\large Probability Rules}\vspace{.2em}\newline
% Note I needed different column widths to prevent wrapping of formulas.
\begin{tabular}{|>{\centering$\displaystyle\rowrule}m{.4\textwidth}<{$}>{\centering$\displaystyle}m{.3\textwidth}<{$}>{\centering$\displaystyle}m{.3\textwidth}<{$}|}\hline
P(A)=\frac{n(A)}{n(\samspa)} & 0\le P(A)\le 1 & P(A)+P(\NOT A)=1 \tabularnewline
P(A\ \OR\ B)=P(A)+P(B)-P(A\ \AND\ B) & &P(A\ \AND\  B)=P(A)\cdot P(B|A) \tabularnewline
P(A\ \OR\ B)=P(A)+P(B) & & P(A\ \AND\  B)=P(A)\cdot P(B) \tabularnewline
& P(B|A)=\frac{P(A\ \AND\  B)}{P(A)} & \tabularnewline\hline
\end{tabular}\vspace{.5em}

\textbf{\large Probability Distribution Functions}\vspace{.2em}\newline
\begin{tabular}{|*{3}{>{\centering$\displaystyle\rowrule}m{.333\textwidth}<{$}}|}\hline
P(\X)={_n}C_\X\cdot \pprop^\X\cdot (1-\pprop)^{n-\X} &
P(\X)=\frac{\left(\com{S}{\X}\right)\cdot\left(\com{N-S}{n-\X}\right)}{\com{N}{n}} &
P(\X)=\frac{\pmean^\X\cdot e^{-\pmean}}{X!}\tabularnewline \hline
\end{tabular}\vspace{.5em}

\textbf{\large Parameters of Probability Distributions}\vspace{.2em}\newline
% Note I needed different column widths to prevent wrapping of formulas.
\begin{tabular}{|>{\centering$\displaystyle\rowrule}m{.25\textwidth}<{$}>{\centering$\displaystyle}m{.35\textwidth}<{$}>{\centering$\displaystyle}m{.4\textwidth}<{$}|}\hline
\multicolumn{3}{|c|}{\rowrule\textbf{General Formulae for Discrete Distributions}}\tabularnewline
\pmean=\sum X\cdot P(X) & \pdev=\sqrt{\sum\left(\X-\pmean\right)^2\cdot P(\X)} &\pdev=\sqrt{\sum \X^2\cdot P(\X)-\left(\sum \X\cdot P(\X)\right)^2} \tabularnewline
\multicolumn{3}{|c|}{\rowrule\textbf{Shortcuts for the Binomial Distribution}}\tabularnewline
\pmean=n\pprop & ~~~~~~~~~~\pdev=\sqrt{n\cdot\pprop\cdot(1-\pprop)} & \tabularnewline\hline
\end{tabular}\vspace{.5em}

\textbf{\large Standard Scores}\vspace{.2em}\newline
\begin{tabular}{|*{2}{>{\centering$\displaystyle\rowrule}m{.5\textwidth}<{$}}|}\hline
\Z=\frac{\X-\pmean}{\pdev} & \Z=\frac{\X-\smean}{\sdev} \tabularnewline%\hline
\X=\pmean+\Z\pdev & \X=\smean+\Z\sdev \tabularnewline\hline
\end{tabular}
% Print the license
\gfdlsinglenewpage
\end{document}
