\documentclass[t]{paulslides}
\usepackage{pgf,tikz}
\usepackage{enumerate}
\usetikzlibrary{arrows}
\usepackage{amsthm}

\definecolor{UniBlue}{RGB}{83,121,170}
\setbeamercolor{block title}{use=structure,fg=white,bg=blue!75!black}
\setbeamercolor{block body}{use=structure,fg=black,bg=blue!10!white}

\title{MA162: Finite mathematics}
\subtitle{Properties of Probabilities}
\author{Paul Koester}
\institute{University of Kentucky}
\date{February 24, 2014}

\begin{document}

\maketitle

\begin{frame}[t]{Some Rules for Computing Probabilities}
 \begin{itemize}
   \item \(0 \leq P(E) \leq 1\) for any event \(E\) \vfill
   \item \( P(S) = 1\) where \(S\) is the entire sample space \vfill
   \item \( P(E \cup F) = P(E) + P(F) - P(E\cap F)\) \vfill
   \item \(P(E^c) = 1 - P(E) \) \vfill
 \end{itemize}
\end{frame}

\begin{frame}[t]{Balls in Urns}
An urn contains some number of balls, some are red, some are white, and some are yellow.\\
You reach in and grab a ball at random.\\
You are twice as likely to grab a white ball than a red ball.\\
You are four times more likely to grab a yellow ball than a red ball.\\
What is the probability you grab a white ball?
%  This uses P(S) = 1
\end{frame}

\begin{frame}[t]{Flipping coins}
 A fair coin is flipped 3 times.  
 \begin{itemize}
  \item What is the probability of turning up exactly two heads?  \vfill
  \item What is the probability of turning up at least two heads?  \vfill
  \item What is the probability of first flip is heads?  \vfill
  \item What is the probability that the first flip shows heads OR exactly two flips show heads? \vfill
 \end{itemize}
% use this to introduce tree diagrams and informally introduce independence
\end{frame}

\begin{frame}[t]{Too many dice?}
 A fair 6 sided die is rolled 50 times.  
 \begin{itemize}
  \item What is the probability of rolling a ``2'' exactly 1 time?  \vfill
  \item What is the probability of rolling a ``2'' at least 1 time?  \vfill
  \item What is the probability of rolling a ``2'' at most 1 time?  \vfill
 \end{itemize}
% More on independence and second part exploits the complement
\end{frame}

%
%\begin{frame}[t]{Drawing Cards}
% Two cards are drawn from a standard deck of 52 cards.
% (A recent HW question asked similar questions for a single card.  Notice the question for 2 cards is much more involved!)
% \begin{itemize}
%  \item What is the probability the two cards have the same suit? \vfill
%  \item What is the probability that a card has a number between 3 and 7? \vfill
%  \item What is the probability that the two card hand contains a King or a Spade? \vfill
%  \item What is the probability that the two card hand contains a King and a Spade?\vfill
% \end{itemize}
%\end{frame}

\begin{frame}[t]{Trees}
\begin{scriptsize}
Multi-stage probability experiments are best visualized with a tree diagram.

  \begin{center}
  \begin{tikzpicture}[
        grow=right,
        sloped,
        level 1/.style ={level distance=5cm, sibling distance=3cm},
        level 2/.style ={level distance=5cm, sibling distance=1.5cm}
%       edge from parent fork right,
%       level distance=30mm,
%       level 1/.style={sibling distance=15mm},
%       level 2/.style={sibling distance=4mm}
  ]
  \node {}
    child {
        node {B}
            child {  node {D}  edge from parent node[below] {$0.3$} }
            child {  node {C} edge from parent node[above] {$0.7$} }
      edge from parent node[below] {$0.6$}
    }
    child {
        node {A}
            child {  node {D}  edge from parent node[below] {$0.75$} }
            child {  node {C} edge from parent node[above] {$0.25$} }
      edge from parent node[above] {$0.4$}
    };
  \end{tikzpicture}
  \end{center}
  The final outcomes are represented by the nodes on the far right of the tree.\\
  Technically, the nodes on the right are represented as intersections, but we often do not write them as intersections.\\
  The probability of a given outcome is obtained by multiplying all of the ``branching'' probabilities.\\
  For example, \(P(A \cap C) = 0.4 \cdot 0.25 = 0.1\), whereas \(P(A) = 0.4\)\\
\end{scriptsize}

\end{frame}

\begin{frame}[t]{Another Probability Rule}
 \begin{itemize}
  \item E is an event \vfill
  \item \(F_1, F_2, \ldots, F_r\) are events satisfying \vfill
   \begin{itemize}
    \item \(S = F_1 \cup F_2 \cup \cdots \cup F_r \)
    \item Each pair \(F_i\) and \(F_j\) are mutually exclusive, for \(i \neq j\)
   \end{itemize} \vfill
  \item Then \( P(E) = P(E\cap F_1) + P(E\cap F_2) + \cdots + P(E\cap F_r)\) \vfill
 \end{itemize}
 This rule is best visualized with a tree diagram.
\end{frame}

\begin{frame}[t]{Trees}
  \begin{center}
  \begin{tikzpicture}[
        grow=right,
        sloped,
        level 1/.style ={level distance=5cm, sibling distance=3cm},
        level 2/.style ={level distance=5cm, sibling distance=1.5cm}
%       edge from parent fork right,
%       level distance=30mm,
%       level 1/.style={sibling distance=15mm},
%       level 2/.style={sibling distance=4mm}
  ]
  \node {}
    child {
        node {B}
            child {  node {D}  edge from parent node[below] {$0.3$} }
            child {  node {C} edge from parent node[above] {$0.7$} }
      edge from parent node[below] {$0.6$}
    }
    child {
        node {A}
            child {  node {D}  edge from parent node[below] {$0.75$} }
            child {  node {C} edge from parent node[above] {$0.25$} }
      edge from parent node[above] {$0.4$}
    };
  \end{tikzpicture}
  \end{center}
  Find the probability of C.\\  
\end{frame}

\begin{frame}[t]{More Urns}
\begin{itemize}
  \item Urn A contains 10 balls.  8 are white and 2 are red.
  \item Urn B contains 12 balls.  4 are white, 6 are red, and 2 are yellow.
  \item Roll a single 6 sided die.  
  \begin{itemize}
    \item If value of die is 5 or 6, draw a ball at random from Urn A.
    \item If value of die is 1, 2, 3, or 4, draw a ball at random from Urn B.
  \end{itemize}
  \item Draw a tree to represent this experiment.
  \item What is the probability the ball is white?
  % Tree diagram, also \( P(W \cap A)\) and \(P(W \cap B)\)
\end{itemize}
\end{frame}



\begin{frame}[t]{Gaming}
 \begin{itemize}
  \item A group of 243 video gamers were asked about video game habits. \vfill
  \item Question 1: Which game consoles do you own?  ``Own PS 3'', ``Own XBox 360'', ``Own neither'', ``Own both'' \vfill
  \item Question 2: How many hours per week do you play?  ``no more than 2 hours'', ``between 2 to 6 hours'', ``more than 6 hours'' \vfill
  \item Results are recorded on next page \vfill
 \end{itemize}
\end{frame}

\begin{frame}[t]{Gaming}
 \begin{tabular}{l|llll|l}
 			& PS 3 only	& XBox only	& Both	& Neither	& Total \\ \hline
 \(<2\) hours   	&   47		&    23		&   7	&   17		&  94   \\
 \(2\) to \(6\) hours	&   34		&    41		&  11	&    3		&  89   \\ 
 \(> 6\) hours		&   15		&    18		&  25	&    2		&  60   \\ \hline
 total			&   96		&    82		&  43	&   22		& 243   \\
 \end{tabular}

 \begin{itemize}
  \item Probability random gamer owns an XBox but not a PS-3? \vfill
  \item Probability random gamer owns a PS-3? \vfill
  \item Probability random gamer plays at least 2 hours per week? \vfill
  \item Probability random gamer owns an XBox and plays two hours or less per week? \vfill
 \end{itemize}
\end{frame}

\begin{frame}[t]{Conditional Gaming}
 \begin{tabular}{l|llll|l}
 			& PS 3 only	& XBox only	& Both	& Neither	& Total \\ \hline
 \(<2\) hours   	&   47		&    23		&   7	&   17		&  94   \\
 \(2\) to \(6\) hours	&   34		&    41		&  11	&    3		&  89   \\ 
 \(> 6\) hours		&   15		&    18		&  25	&    2		&  60   \\ \hline
 total			&   96		&    82		&  43	&   22		& 243   \\
 \end{tabular}

 \begin{itemize}
  \item Restrict attention only to gamers who own both consoles.  What is probability they play at least two hours per week? \vfill
  \item Restrict attention to gamers who play less than two hours per week. What is probability they own a PS 3? \vfill
 \end{itemize}
\end{frame}

\end{document}

