\documentclass[12pt, letterpaper]{amsart}

\usepackage{amsmath, amssymb, amsthm, enumerate}
\usepackage[margin=0.5in]{geometry}
\usepackage[pdflang={en-US}]{hyperref}
%\usepackage[shortlabels]{enumitem}

%\usepackage{tikz}

\renewcommand{\thesection}{\Alph{section}}

\newcommand{\scs}[1]{\begin{scshape}#1\end{scshape}}
\newcommand*{\inv}{^{-1}}
\newcommand*{\RR}{\mathbb{R}}
\newcommand*{\QQ}{\mathbb{Q}}
\newcommand*{\ZZ}{\mathbb{Z}}
\newcommand*{\NN}{\mathbb{N}}
\newcommand*{\ds}{\displaystyle}
\newcommand*{\inte}[2][x]{\int #2\, d#1}
\newcommand*{\der}[2][x]{\frac{d}{d#1}\!\left[ #2 \right]}

\theoremstyle{definition}
\newtheorem*{axioms}{Axioms of Probability}
\newtheorem*{theorem}{Theorem}
%\theoremstyle{definition}
\newtheorem*{definition}{Definition}
\newtheorem{problem}{}
\newtheorem*{challenge}{Challenge}
\newtheorem*{example}{Example}
\newtheorem*{solution}{Solution}
\newtheorem*{method}{Method}
\newtheorem*{note}{Note}

\newcommand{\ax}[1]{\begin{axioms}#1\end{axioms}}
\newcommand{\thm}[1]{\begin{theorem}#1\end{theorem}}
\newcommand{\prob}[1]{\begin{problem}#1\end{problem}}
\newcommand{\dfn}[1]{\begin{definition}#1\end{definition}}
\newcommand{\chal}[1]{\begin{challenge}#1\end{challenge}}
\newcommand{\eg}[1]{\begin{example}#1\end{example}}
\newcommand{\sol}[1]{\begin{solution}#1\end{solution}}
\newcommand{\mthd}[1]{\begin{method}#1\end{method}}
\newcommand{\nt}[1]{\begin{note}#1\end{note}}

\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\vr}[1][r]{\mathbf{#1}}
\newcommand{\del}{\partial}
\newcommand{\grad}[1][f]{\nabla #1}

\title{Counting and probability}
\date{January 24, 2024}

\begin{document}

\ 

\vspace{-.2in}

\maketitle

\vspace{-.2in}

\ax{
Any assignment of probabilities to events in a sample space $S$ must obey the following rules:
\begin{enumerate}[1.]
 \item $P(E) \geq 0$ for any event $E$
 \item $P(S) = 1$
 \item If $E_1, E_2, E_3, \dots$ are disjoint events, then $ P\left( E_1 \cup E_2 \cup E_3 \cup \dots \right) = \sum_{i = 1}^{\infty} P\left( E_i \right)$
\end{enumerate}
}

% \prob{
%   In the experiment of flipping a fair coin twice the sample space $S=\{HH, HT, TH, TT\}$ consists of 4 equally-likely outcomes.
%   What is the probability of each outcome?
%   }


\thm{
  If $S$ is a sample space consisting of $N(S)$ equally likely outcomes and $E$ is an event consisting of $N(E)$ outcomes, then $\displaystyle P(E) = \frac{N(E)}{N(S)} $.
}

\prob{
The experiment of flipping a coin 3 times has a sample space consisting of $8$ equally likely outcomes: $S = \{ HHH, HHT, HTH, THH, ..., TTT\}$.
Let $X$ be the number of heads.
\begin{enumerate}[a)]
% \item Are the events $\{ HH\}$, $\{HT\}$, $\{TH\}$, and $\{TT\}$ disjoint?

% \vfill

% \item What is the union of the events $\{ HH\}$, $\{HT\}$, $\{TH\}$, and $\{TT\}$?

% \vfill

% \item Use axioms 2 and 3 to find a number to finish the equation \[ P(\{ HH\}) + P(\{HT\}) +  P(\{TH\}) +  P(\{TT\}) = \]

% \vfill

% \item What is the relationship between the probabilities of the events $\{ HH\}$, $\{HT\}$, $\{TH\}$, and $\{TT\}$?

% \vfill

% \item Find the probability of each outcome.

%   \vfill
\item What set of outcomes corresponds to $X = 3$?

  \vspace{.4in}
  
\item What set of outcomes correspond to $X=2$?

  \vspace{.4in}
  
\item What set of outcomes correspond to $X=1$?

  \vspace{.4in}
  
  \item What set of outcomes correspond to $X=0$?
  
    \vspace{.4in}
  
\item Use the theorem to calculate $P(X=3)$, $P(X=2)$, $P(X=1)$, and $P(X=0)$.

  \vfill
  
\end{enumerate}
}

% \nt{
% Writing $ P(\{ HH\})$ is kind of annoying, so when we're dealing with simple events (as opposed to compound events), we'll usually leave off the curly braces and just write $ P( HH)$.
% }

% \prob{
% Generalize from the first problem.
% Let $n$ be a positive integer and suppose the sample space for an experiment consists of $n$ equally likely outcomes.
% \begin{enumerate}[a)] 
% \item The probability of any one outcome is \dots

% \vfill

% \item The probability of event $E$ is \dots

% \vfill

% \end{enumerate}
% }

The theorem tells us that (at least some of the time) we can calculate probabilities by counting.
The mathematics of counting is called \textbf{combinatorics}.
Our book is a bit light on this topic; more details are available in sections \href{https://www.randomservices.org/random/foundations/Counting.html}{0.7 and 0.8 of Randomservices.org}.


\mthd{(Fundamental principle of counting)
If a process occurs in two steps and there are $n_1$ options for the first step and $n_2$ options for the second, then there are $n_1 n_2$ total possibilities. 
}

\newpage

\prob{
Suppose a PIN consists of four of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, each of which may be used multiple times (selection with replacement, order matters).
\begin{enumerate}[a)]
\item How many PINs start with 123?

\vspace{.4in}

\item How many PINs start with 12?

\vspace{.4in}

\item How many total PINs are there?

\vspace{.4in}

\item What is the probability that a randomly selected PIN starts with 123?

\vfill

\item What is the probability that a randomly selected PIN starts with 12?

\vfill

\end{enumerate}
}

%\newpage

\prob{
Continue working with 4-digit PINs, but now suppose that each digit can be used at most once.
\begin{enumerate}[a)]

\item In this situation, how many different PINs use just the digits 1, 2, 3, and 4 (selection without replacement, order matters)?

  \vfill
  
%\item Answer the same question, but with arbitrary digits $d_1$, $d_2$, $d_3$, and $d_4$.
  
\item How many different PINs are there if all the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 can be used (at most once)?

  \vfill

\item What is the probability that a randomly selected PIN in this scenario uses just the digits 1, 2, 3, and 4?

  \vfill

%\item How many different PINs are there if each digit can be used at most once and the order doesn't matter (selection without replacement, order doesn't matter)?
%Hint: in part B you calculated how many times different orderings of $d_1d_2d_3d_4$ appeared in your enumeration of PINs in part c. You can use these two numbers to answer this question.

\vfill

\vspace{.5in}

\end{enumerate}
}

\newpage

\prob{How many different PINs are there if each digit can be used at most once and the order doesn't matter (selection without replacement, order doesn't matter)?
Hint: in the last problem you counted the different orderings of $1, 2, 3, 4$.
Any four digits have the same number of orderings. 
And you counted all orderings of four digits from 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

\vfill

}

\prob{
You're now ready to analyze the \href{https://www.walottery.com/JackpotGames/Match4.aspx}{Match 4 lottery} in which 4 numbers are chosen from 1 to 24 without replacement and order doesn't matter.
\begin{enumerate}[a)]
\item How many possible outcomes are there?

\vfill

\item How many do not match any of my chosen numbers $01$ $02$ $03$ $04$?

\vfill

\item How many match at least one of my chosen numbers?

\vfill
\end{enumerate}
}

\chal{
 Continue working with the Match 4 lottery.
\begin{enumerate}[a)]
\item How many outcomes match exactly one of my chosen numbers?
Hint: think of this as a two-step process, with the first step being choosing one of my numbers to match.  

\vspace{.6in}

\item What is the probability that I win any amount of money (by matching 2 or more numbers)?

\vspace{.4in}

\end{enumerate}
}

\end{document}