% \documentclass[serif]{beamer} % Serif for Computer Modern math font.
\documentclass[serif, handout]{beamer} % Handout to ignore pause statements.

\hypersetup{colorlinks,linkcolor=,urlcolor=red}


\usefonttheme{serif} % Looks like Computer Modern for non-math text -- nice!
\setbeamertemplate{navigation symbols}{} % Suppress navigation symbols
% \usetheme{Berlin} % Displays sections on top
\usetheme{Frankfurt}  % Displays section titles on top: Fairly thin but still swallows some material at bottom of crowded slides
%\usetheme{Berkeley}

\usepackage[english]{babel}
\usepackage{amsmath} % for binom
\usepackage{amsfonts} % for \mathbb{R} The set of reals
% \usepackage{graphicx} % To include pdf files!
% \definecolor{links}{HTML}{2A1B81}
% \definecolor{links}{red}
\setbeamertemplate{footline}[frame number] 

\mode<presentation>

\title{Counting Methods for Computing Probabilities\footnote{ This slide show is an open-source document. See last slide for copyright information.} \\ (Section 1.4)}
\subtitle{STA 256: Fall 2019}
\date{} % To suppress date

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
% Text Section 1.4 title
\frametitle{Uniform Probability on Finite Spaces} \pause 
% \framesubtitle{}
If the sample space is finite \pause and all outcomes of an experiment are equally likely, \pause
{\Large
\begin{eqnarray*}
    P(A) &=& \frac{\mbox{Number of ways for $A$ to happen}} 
                {\mbox{Total number of outcomes}} \pause \\
         &&\\
         &=& \frac{|A|}{|S|}
\end{eqnarray*} \pause
} % End size

\vspace{8mm}
Need to count.
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{A Boring Example} \pause
%\framesubtitle{} 
Roll a fair die. What is the probability of an odd number? \pause

\begin{eqnarray*}
    P(\mbox{Odd}) &=& \pause P(\{1,3,5\})  \pause \\
                  &&\\
                  &=& \frac{3}{6} \pause \\
                  &&\\
                  &=&  \frac{1}{2}
\end{eqnarray*}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Multiplication Principle}
\framesubtitle{Also called the Fundamental Principle of Counting} \pause

If there are $k$ experiments and the first has $n_1$ outcomes, the second  has $n_2$ outcomes, etc., \pause then there are 
\begin{displaymath}
    n_1 \times n_2 \times \cdots \times n_k
\end{displaymath}
outcomes in all.
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Sample Question}
%\framesubtitle{} 
If there are nine horses in a race, in how many ways can they finish first, second and third? \pause
\begin{displaymath}
    9 \times 8 \times 7 = 504
\end{displaymath}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Permutations: Ordered subsets}
\framesubtitle{The notation $_nP_k$ is not in the text} \pause
The number of \emph{permutations} (ordered subsets) of $n$ objects taken $k$ at a time is
\pause
\vspace{4mm}

{\Large
\begin{eqnarray*}
     _nP_k & = & n \times (n-1) \times \cdots \times (n-k+1) \\ \pause
           & = & \frac{n!}{(n-k)!} 
\end{eqnarray*}
} % End size
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Combinations: Unordered subsets}
\framesubtitle{The vocabulary ``combinations" is not in the text} \pause
The number of \emph{combinations} (unordered subsets) of $n$ objects taken $k$ at a time is
\pause
\vspace{4mm}

{\Large
\begin{displaymath}
     \binom{n}{k} = \frac{n!}{k! \, (n-k)!} 
\end{displaymath}
} % End size
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Example}  
% \framesubtitle{}
If a club has 30 members, how many ways are there to choose a committee of 5? \pause

%{\LARGE
\begin{eqnarray*}
  \binom{30}{5} & = &  \frac{30!}{5!(30-5)!} \\ 
   &  &  \\
   & = &142,506
\end{eqnarray*} 
%} % End size
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Proof of $\binom{n}{k} = \frac{n!}{k! \, (n-k)!}$}  \pause
% \framesubtitle{}
Choose an unordered subset of $k$ items from $n$. \pause Then place them in order. \pause By the Multiplication Principle, \pause

%{\LARGE
\begin{eqnarray*}
   &  & _nP_k = \pause \binom{n}{k} \times k! \\ \pause
   & \Rightarrow &  \frac{n!}{(n-k)!} = \binom{n}{k} \times k! \\ \pause
   & \Rightarrow &  \binom{n}{k} = \frac{n!}{k! \, (n-k)!}
\end{eqnarray*} 
 $\blacksquare$
%} % End size
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Example} 
%\framesubtitle{} 
How many ways are there to deal a hand of 5 cards from a standard deck of 52 cards? \pause
\begin{eqnarray*}
    \binom{52}{5} \pause & = & \frac{52!}{5! \, 47!}  \pause \\
    & = & 2,598,960
\end{eqnarray*} \pause

\begin{itemize}
    \item If you could inspect one hand per second, \pause
    \item It would take a little over 30 days to examine them all. \pause
    \item Working 24/7. \pause
    \item The point is that these counting arguments allow you to ``count" objects that are so numerous you could not literally even look at them all.
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{frame}
\frametitle{Binomial Theorem}
\framesubtitle{Binomial coefficients appear in the Binomial Theorem} 
{\LARGE
\begin{displaymath}
    (a+b)^n = \sum_{k=0}^n \binom{n}{k} a^kb^{n-k}
\end{displaymath} 
} % End size
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{frame}
\frametitle{Multinomial Coefficients}
% \framesubtitle{Proposition C in the text} 
The number of ways that $n$ objects can be divided into $\ell$ subsets with $k_i$ objects in set $i$, $i = 1, \ldots,\ell$ is
\vspace{2mm} \pause

{\LARGE
\begin{displaymath}
    \binom{n}{n_1~\cdots~k_\ell}=\frac{n!}{k_1!~\cdots~k_\ell!}
\end{displaymath} 
} % End size
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Multinomial Theorem}
\framesubtitle{Nice to know} 
{\LARGE
\begin{displaymath}
    (x_1 + \cdots + x_\ell)^n = \sum_{\mathbf{k}} \binom{n}{k_1~\cdots~k_\ell} x_1^{k_1} \cdots x_\ell^{k_\ell}
\end{displaymath} 
} % End size
where the sum is over all non-negative integers $k_1, \ldots, k_\ell$ such that $\sum_{j=1}^\ell k_j = n$.
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{frame}
\frametitle{Copyright Information}

This slide show was prepared by  \href{http://www.utstat.toronto.edu/~brunner}{Jerry Brunner},
Department of Statistical Sciences, University of Toronto. It is licensed under a 
\href{http://creativecommons.org/licenses/by-sa/3.0/deed.en_US}
     {Creative Commons Attribution - ShareAlike 3.0 Unported License}. Use any part of it as you like and share the result freely. The \LaTeX~source code is available from the course website:

\vspace{5mm}
\href{http://www.utstat.toronto.edu/~brunner/oldclass/256f19} {\small\texttt{http://www.utstat.toronto.edu/$^\sim$brunner/oldclass/256f19}}

\end{frame}


\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{frame}
\frametitle{} \pause
%\framesubtitle{} 
\begin{itemize}
    \item  \pause
    \item  \pause
    \item 
\end{itemize}
\end{frame}
