\setcounter{ExampleCounter}{1}
Remember, a random variable describes the results of an experiment. There is a certain kind of experiment that often arises, like the following example:
\paragraph{Ex:} Suppose you run a manufacturing plant making light bulbs. Through extensive testing, you've found that the probability that a particular light bulb is defective is 0.02\%. In a batch of 1000 light bulbs, what is the probability that 1 light bulb is defective? What about 2, or 3? 10? Fewer than 10, or more than 10?
All of these questions can be answered when we recognize that this problem is an example of a \textbf{binomial random variable}.\\
\begin{proc}{Binomial Experiment}
A binomial random variable comes from a binomial experiment, which has the following characteristics:
\begin{enumerate}
\item A fixed number of trials ($n$). Think of testing the 1000 light bulbs.
\item There are two possible outcomes for each trial; call them success and failure (in this case, success might be a defective light bulb).
\begin{itemize}
\item Probability of success: $p$
\item Probability of failure: $1-p$
\end{itemize}
\item The probability of success is the same for each trial.
\item The trials are independent.
\item The random variable $X$ describes the number of successes.
\end{enumerate}
\end{proc}
\vfill
\pagebreak
\begin{example}{Are These Binomial?}
Decide whether each of the following is a binomial random variable.
\begin{enumerate}[(a)]
\item A coin is tossed ten times. Let $X$ be the number of heads.\\
This\sol\ is the prototypical example of a binomial random variable, where $n=10$ and $p=0.5$.\\
\item Five basketball players attempt a free throw. Let $X$ be the number of free throws made.\\
If\sol one player shot five free throws, that could be considered a binomial experiment, but since it is five different players, the probability of success on each trial is not consistent.\\
\item A random sample of 250 voters is chosen from a list of 10,000 registered voters. Let $X$ be the number of who support the incumbent mayor for reelection.\\
This\sol can be considered a binomial experiment, since the trials are independent and the probability of success is consistent.
\end{enumerate}
\end{example}
\subsection{Notation}
The question with a binomial random variable is always: ``what is the probability of $x$ successes?'' or ``what is the probability of more/less than $x$ successes?''
For example, the probability of 5 successes would be written $P(X=5)$, and the probability of less than or equal to 5 successes would be written $P(X \leq 5)$.
Both kinds of questions can be answered if we have the probability distribution. For example, if there are three trials, we'd want to fill out the following table:
\begin{center}
\begin{tabular}{c | c}
$x$ & $P(x)$\\
\hline
0 & \\
1 & \\
2 & \\
3 &
\end{tabular}
\end{center}
For $n$ trials, there can be anywhere from 0 to $n$ successes. The probability of any number of successes will, of course, depend on the probability $p$ of each individual success.\\
Okay, so how do we actually calculate the probability of a certain number of successes?
\vfill
\pagebreak
\begin{formula}{Binomial Distribution Formula}
The probability of $x$ successes in a binomial experiment is
\[P(X=x) = \binom{n}{x} p^x (1-p)^{n-x}\]
where $\binom{n}{x}$ is the ``$n$ choose $x$,'' the number of ways to select $x$ items from a pool of $n$ items.
\end{formula}
When we actually do problems, though, we don't typically use the formula.
\subsection{Using the Table}
Rather than using the formula, we can use a table that was built with the formula (looking up a value in the table is quicker than evaluating the formula).
The table is essentially the probability distribution function for different numbers of trials and different probabilities of success. Below is a segment of this table (the full table is in the appendix).
\begin{center}
\textbf{Binomial Probabilities}\\
\includegraphics[width=0.8\textwidth]{BinomTableFragment}
\end{center}
\vfill
\pagebreak
For instance, for three trials where $p=0.15$, the probability distribution function is
\begin{center}
\begin{tabular}{c | c}
$x$ & $P(x)$\\
\hline
0 & 0.6141\\
1 & 0.3251\\
2 & 0.0574\\
3 & 0.0034
\end{tabular}
\end{center}
(notice that the probabilities all add up to 1, so this is a valid probability distribution function).
\begin{example}{Binomial Probabilities}
If $n=3$ and $p=0.15$, find the following probabilities:
\begin{enumerate}[(a)]
\item $P(X=2) = 0.0574$
\item $P(X \leq 1) = 0.9392$
\item $P(X > 2) = 0.0034$
\end{enumerate}
\end{example}
\begin{example}{Multiple-Choice Quiz}
A student takes a quiz with four multiple-choice questions, each with five possible answers. What is the probability that the student gets at least three correct answers if she guesses on each question?\\
Here\sol\ $n=5$ and $p=0.2$, so \[P(X \geq 3) = P(X=3) + P(X=4) = 0.0256+0.0016 = 0.0272.\]
\end{example}
\vfill
\pagebreak
\subsection{Using Your Calculator}
There's an even easier way to calculate binomial probabilities: using the built in function on your calculator. If you press \includegraphics[height=0.3in]{Calc2ndVars} and scroll down, you'll find two relevant options: \texttt{binompdf} and \texttt{binomcdf}.
\begin{center}
\includegraphics[width=3in]{CalcBinom}
\end{center}
\paragraph{\texttt{binompdf}:} The probability of exactly $x$ successes.
\paragraph{\texttt{binomcdf}:} The probability of less than or equal to $x$ successes.\\
If, for instance, you select \texttt{binompdf}, you might see a menu like the following:
\begin{center}
\includegraphics[width=3in]{CalcBinomMenu}
\end{center}
After you enter the number of trials, the probability of success, and the number of successes in question, click \texttt{Paste}, and you'll see something like the following:
\vfill
\pagebreak
\begin{center}
\includegraphics[width=3in]{CalcBinomPaste}
\end{center}
\paragraph{Note:} On a TI-83, you should instead type in the three pieces, separated by commas. The syntax is
\begin{center}
\texttt{binompdf(n,p,x)} \hspace{0.2in} or \hspace{0.2in} \texttt{binomcdf(n,p,x)}
\end{center}
\begin{example}{Airline Flights}
At a particular airport, 81\% of the flights arrived on time last year. If 15 flights are randomly selected, find the probability that
\begin{enumerate}[(a)]
\item exactly 10 of the flights are on time.
\begin{center}
\texttt{binompdf(12,0.81,10)} $= 0.2897$
\end{center}
\item exactly 12 of the flights are on time.
\begin{center}
\texttt{binompdf(12,0.81,12)} $= 0.0798$
\end{center}
\item 11 or fewer flights are on time.
\begin{center}
\texttt{binomcdf(12,0.81,11)} $= 0.9202$
\end{center}
\item fewer than 10 flights are on time.
\begin{center}
\texttt{binomcdf(12,0.81,9)} $= 0.4060$
\end{center}
\item more than 9 flights are on time.
\begin{center}
$1-$ \texttt{binomcdf(12,0.81,9)} $= 0.5940$
\end{center}
\item 11 or more flights are on time.
\begin{center}
\texttt{binomcdf(12,0.81,10)} $= 0.3043$
\end{center}
\end{enumerate}
\end{example}
\vfill
\pagebreak
\begin{example}{Google Searches}
According to a Nielsen report, 65\% of Internet searches in May 2010 used Google. If a sample of 25 searches are randomly selected, find the probability that
\begin{enumerate}[(a)]
\item exactly 20 of them used Google.
\begin{center}
\texttt{binompdf(25,0.65,20)} $= 0.0506$
\end{center}
\item 15 or fewer used Google.
\begin{center}
\texttt{binomcdf(25,0.65,20)} $= 0.3697$
\end{center}
\item more than 22 used Google.
\begin{center}
$1-$ \texttt{binomcdf(25,0.65,22)} $= 0.0021$
\end{center}
\item fewer than 12 used Google.
\begin{center}
\texttt{binomcdf(25,0.65,11)} $= 0.0255$
\end{center}
\item 17 or more used Google.
\begin{center}
$1-$ \texttt{binomcdf(25,0.65,16)} $= 0.4668$
\end{center}
\end{enumerate}
\end{example}
\paragraph{Mean:} The expected value of a binomial random variable is \[E(X) = np.\] Note that this makes sense: if you flip a coin 10 times, you can expect to get 5 heads, for instance.
\vfill
\pagebreak
\begin{example}{College Enrollment}
The \emph{Statistical Abstract of the United States} reported that 67\% of students who graduated from high school in 2007 enrolled in college. Thirty high school graduates are sampled; find the probability that
\begin{enumerate}[(a)]
\item exactly 18 of them enroll in college.
\begin{center}
\texttt{binompdf(30,0.67,18)} $= 0.1068$
\end{center}
\item more than 15 of them enroll in college.
\begin{center}
$1-$ \texttt{binomcdf(30,0.67,15)} $= 0.9601$
\end{center}
\item fewer than 20 of them enroll in college.
\begin{center}
\texttt{binomcdf(30,0.67,19)} $= 0.4000$
\end{center}
\end{enumerate}
How many of these students would you expect to enroll in college?
\[E(X) = np = (30)(0.67) \approx 20\]
\end{example}
\begin{example}{Driver's Exam}
Sixty-five percent of people pass the state driver's exam on the first try. A group of 50 individuals who have taken the driver's exam is randomly selected. Find the probability that 30--35 of them passed on the first try.\\
There are two ways to tackle this problem:
\paragraph{One Way:} Use \texttt{binompdf} to find the individual probabilities of 30, 31, 32, 33, 34, and 35 passing, and add them up.
This gets tedious, though.
\paragraph{Another Way:} Use \texttt{binomcdf} to cover this range by subtracting:
\begin{center}
\texttt{binomcdf(50,0.65,35)} $-$ \texttt{binomcdf(50,0.65,29)} $= 0.8122 - 0.1861 = 0.6261$
\end{center}
\end{example}
\vfill
\pagebreak
\subsection{Summary}
\begin{itemize}
\item To find $P(X = \textrm{ number})$, use \texttt{binompdf(n,p,}number\texttt{)}.
\item To find $P(X \leq \textrm{ number})$, use \texttt{binomcdf(n,p,}number\texttt{)}.
\item To find $P(X < \textrm{ number})$, use \texttt{binomcdf(n,p,}number$-1$\texttt{)}.
\item To find $P(X \geq \textrm{ number})$, use $1-$\texttt{binomcdf(n,p,}number$-1$\texttt{)}.
\item To find $P(X > \textrm{ number})$, use $1-$\texttt{binomcdf(n,p,}number\texttt{)}.
\item To find $P(a \leq X \leq b)$, use \texttt{binomcdf(n,p,b)} $-$ \texttt{binomcdf(n,p,a-1)}.\\ (pay attention to the inequalities)
\end{itemize}