% use [nosolutions] flag to hide solutions.
% use [solutions] flag to show solutions.
\documentclass[solutions]{../../resources/ormc_handout}


% Quick P() macro.
% \P is already defined,
% but we won't need it in this doc.
\renewcommand{\P}[1] {P(#1)}
\newcommand{\Pt}[1] {
	\ensuremath{\P{\text{#1}}}
}

\begin{document}

	\maketitle
		<Intermediate 2>
		<ORMC Summer Sessions>
		{Probability}
		{
			Prepared by Mark on \today \\
			Based on a handout by Oleg Gleizer
		}

\problem{}
A Zoo manager thinks of a way
to set up a new pavilion.
He has 7 different plants
and 12 different animals. \\

\begin{itemize}
	\item How many ways are there to choose two animals and three plants?
	\vfill
	\item The manager finds that he only has 5 exhibits available. How many different sets of animals can he choose, if only one can be in each exhibit time?
	\vfill
\end{itemize}

\problem{}
How many different 7-symbol license plates are possible if the first three symbols are letters and the remaining four are digits 0-9? \\
\hint{Symbols can repeat, but letters must be uppercase}
\vfill

\pagebreak

\problem{}
There are two plates on a table.
One plate has 10 identical candies,
the other has 8 different fruits. \\

\begin{itemize}
	\item How many ways are there to choose one candy?
	\vfill
	\item How many ways are there to choose seven candies?
	\vfill
	\item How many ways are there to choose five fruits?
	\vfill
	\item How many ways are there to choose three candies and six fruits?
	\vfill
	\item Gregory chooses two fruits and two candies, and lines up the four objects on the table. In how many ways can he do it?
	\vfill
	\item Gregory chooses five fruits and seven candies, and lines up the twelve objects on the table. In how many ways can he do it?
	\vfill
\end{itemize}


\pagebreak



\vspace{190pt}

\pagebreak

\begin{center}
\section{Probability}
\end{center}
\vspace{10pt}

A \textit{probability}, also known as a \textit{chance}, is a number showing how likely some event is to happen. Let us call the event $X$. Then the probability of $X$ taking place is

$$
\P{X} = \frac{
	\text{The number of the outcomes such that $X$ happens.}
}{
	\text{The number of all the possible outcomes.}
}
$$

Note that by definition, $0 \leq P(X) \leq 1$. \\

In some of the following problems, we will be flipping a coin. Let us use $H$ to represent the event of the coin landing heads, and $T$, the event of the coin landing tails.


\problem{}
Compute each of the following:
\begin{enumerate}
	\item \Pt{Rolling a six-sided die and getting 2}
	\item \Pt{Flipping a coin twice and getting the sequence HH}
	\item \Pt{Flipping a coin twice and getting one head and one tail in any order}
	\item \Pt{Rolling two six-sided dice and getting a sum of 5}
\end{enumerate}


\vfill
\pagebreak

Some parts of the previous problem involve repeated trials: two dice, or two coins. You may have solved these by listing out all the possible outcomes. Though this simple approach works for small problems, it isn't particularly useful for larger ones: ten coin flips create 1024 possible outcomes, and ten dice rolls, 60466174.

\medskip

A better way to think about repeated trials is as a ``tree,'' where each outcome represents a path. The following tree represents two coin flips, and the four paths down it (from left to right) correspond to the four possible outcomes: HH, HT, TH, TT.

% Ugly hack
\tikzstyle{level 1}=[level distance=3.5cm, sibling distance=3.5cm]
\tikzstyle{level 2}=[level distance=3.5cm, sibling distance=2cm]
\tikzstyle{split} = [text width=1em, text centered]
\tikzstyle{tsplit} = [text width=0, text centered]
\tikzstyle{end} = [minimum width=3pt, inner sep=0pt]

\begin{center}
	\begin{tikzpicture}[grow=right]
	\node[tsplit] {}
		child {
			node[split] {T}
				child {
					node[end, label=right:{T\ \ \ (TT)}] {}
					edge from parent
				}
				child {
					node[end, label=right:{H\ \ \ (TH)}] {}
					edge from parent
				}
				edge from parent
		}
		child {
			node[split] {H}
			child {
					node[end, label=right:{T\ \ \ (HT)}] {}
					edge from parent
				}
				child {
					node[end, label=right:{H\ \ \ (HH)}] {}
					edge from parent
				}
			edge from parent
		};
\end{tikzpicture}
\end{center}

If we label each edge with the probability of each event, we can calculate the probability of each outcome by multiplying the edges we passed:

\begin{center}
	\begin{tikzpicture}[grow=right]
	\node[tsplit] {}
		child {
			node[split] {T}
				child {
					node[end, label=right:{T\ \ \ ({TT, $\frac{1}{4}$})}] {}
					edge from parent
					node[below] {$\frac{1}{2}$}
				}
				child {
					node[end, label=right:{H\ \ \ ({TH, $\frac{1}{4}$})}] {}
					edge from parent
					node[below] {$\frac{1}{2}$}
				}
				edge from parent
				node[below] {$\frac{1}{2}$}
		}
		child {
			node[split] {H}
			child {
					node[end, label=right:{T\ \ \ ({HT, $\frac{1}{4}$})}] {}
					edge from parent
					node[below] {$\frac{1}{2}$}
				}
				child {
					node[end, label=right:{H\ \ \ ({HH, $\frac{1}{4}$})}] {}
					edge from parent
					node[below] {$\frac{1}{2}$}
				}
			edge from parent
				node[below] {$\frac{1}{2}$}
		};
\end{tikzpicture}
\end{center}

We can formalize this idea as follows:

\proposition{}
If we have two independent events $A$ and $B$, then $\Pt{A and B} = \P{A} \times \P{B}$. \\
Usually we write $\Pt{A and B}$ as $\P{A \cap B}$. \\

\vfill

Here's another important thought:

\proposition{}
If the probability of event $A$ happening is $\P{A}$, the probability of $A$ \textit{not} happening is $1 - \P{A}$

\pagebreak

\problem{}
There are three cans of white paint and two cans of black paint in a dark storage room. You take two cans out without looking. What is the probability that you'll choose two cans of the same color?
\vfill

\problem{}
Hospital records show that of patients
suffering from a certain disease,
75\% die of it. What is the probability
that of 5 randomly selected patients,
4 will recover? \\
\hint{What is the probability of a patient recovering?}
\vfill

\problem{}
When Oleg calls his daughter Anya,
the chance of the call getting through is 60\%.
How likely is it to have at least one connection
in four calls?
\vfill

\problem{}
The chance of a runner to improve
his own personal record in a race is $p$.
What is the probability that his record will improve after 3 races?
\vfill

\newpage

\problem{}
You toss a pair of fair dice five times.
What is the probability that you get a sum of ten exactly two times?
\vfill

\problem{}
You toss a pair of fair dice five times.
What is the probability that you get ten
at least twice?
\vfill

\problem{}
A fair coin is tossed 4 times. What is the chance of getting more heads than tails?
\vfill



\problem{}
A pharmaceutical study shows that a new drug causes negative side effects in 3 of every 100 patients.
To check the number, a researcher chooses 5 random people to survey.
Assuming the study is accurate, what is the probabilty of the following? \\

\begin{enumerate}
	\item None of the five patients experience side effects.
	\item At least two experience side effects.
\end{enumerate}

\vfill
\pagebreak

\problem{}
You pick up a natural number (positive integer)
at random. What is the probability
that the number is divisible by either two
or three?

\vfill

\problem{}
Three players are tossing a fair coin.
The first to have a HEAD wins.
What are the players' chances of winning?

\vfill

\section{Harder Probabilities}

\problem{}
Oleg wrote ten letters to Math Circle parents
and addressed the ten envelopes. However, he
left the final stages of mailing to a careless clerk who
didn't pay attention, inserting the letters
into the envelopes at random.
(However, he did manage to fit exactly
one letter in each envelope.)
What is the probability that exactly nine of
the ten letters is correctly addressed?

\vfill

\problem{}
On a sold-out flight, the first person to
board the plane forgot which seat was his
and chose a random seat. Subsequent passengers
took their assigned seat if available, or a
randomly chosen seat if not. When the last
person boards, there is only one seat left.
What is the probability that this was the
seat assigned to the last passenger?

\vfill
\pagebreak

\problem{}
Your new neighbor has two children.
Assuming that it is equally likely
for a child to be a boy or a girl,
what is the probability that both
of the neighbor's children are girls?
Does the probability change if you
discover that one of the children
is indeed a girl? If so, how?

\vfill


\problem{}
A bag contains a marble which is either
black or white --- but we don't know which.
We put a white marble into the bag and shake it.
We then draw out a white marble.
What is the probability that the marble
left inside the bag is also white?

\vfill

\problem{The Monty Hall Problem}
You are a contestant on a certain game show.
There are three doors.
Behind one door is a brand-new car.
Behind the other two doors are goats.
You are invited to choose one of the doors.
Before opening the selected door, the game show host
opens one of the other two doors, revealing a goat.
You can now either keep your (original)
choice, or switch to the other unopened door.
Which choice gives you a better chance of winning
the car? Does it matter? Explain your answer.
\vfill

\end{document}