\documentclass[10pt]{article}
% Set the margins to be something normal.
\usepackage[margin=0.5in]{geometry}
% Fun lists!
\usepackage{enumitem}
\usepackage{textcomp}
\setitemize{label=\textrightarrow, itemsep=0pt}
% Math symbols.
\usepackage{amsmath, amssymb, amsfonts, nicefrac}
% No indents.
\setlength\parindent{0pt}
% Nice fonts :)
\usepackage{tgschola}
\newcommand{\prob}[1]{\mathbf{P}\hspace{-0.2pt}\left[#1\right]}
\newcommand{\expect}[1]{\mathbf{E}\hspace{-0.2pt}\left[#1\right]}
\setlength\parskip{0pt}
\begin{document}
\thispagestyle{empty}
{
\centering
\huge{Week 12 Recitation Problems} \\
\Large{MATH:114, Recitations 309 and 310} \\[2em]
}
\normalsize{Names:} \hrulefill
\vspace{2em}
A \textit{random variable} is a function that assigns numbers to outcomes of an experiment. Let's use coin tosses as an example: the possible outcomes, or the \textit{sample space}, is the set $ \Omega = \{H, T\}$, for $H$eads and $T$ails. We can set up $C$ to be a random variable that models a coin-flipping game: if the coin turns up heads, I get two dollars, and otherwise I gain one dollar. Our random variable looks like this: $$ C = \begin{cases} 1 & \text{if the coin lands on $T$} \\ 2 & \text{if the coin lands on $H$} \end{cases}$$ We can also assign \textit{probabilities} to each value of $C$: for example, the probability that our coin lands on $H$ (or that we get two dollars) is $$ \prob{C = 2} = \frac{1}{2}.$$ Because the probabilities of all values of $C$ have to sum to $1$, we also know that $$ \prob{C=1} = \frac 12.$$ The \textit{expected value} of a random variable is a long-term average: each time I play the game, how much money can I expect to win? Because we have $2$ possible values for our random variable, the expected value is $$ \sum_{i=1}^2 i \cdot \prob{C = i}$$
\vspace{1em}
1. What is the expected value of the random variable $C$? In other words, how much should money should I expect to win every time I play the game?
\vspace{6em}
2. If I play the game $1000$ times, how much money should I expect to win?
\vspace{6em}
\dotfill \\[1em]
Now, because I'm interested in winning some serious cash, I want to know something in particular: how many flips do I need before I get my first $H$? Let's define our random variable together.
\vspace{1em}
3. What are the possible ``strings'' of coin flips that have all $T$s and then one $H$? In other words, what is my \textit{sample space}? I've started the list for you: \vspace{-2em}
{\LARGE $$ \hspace{-5em}\Omega = \left\{ H, TH, TTH, \right.$$ }
How many possible outcomes are there?
\newpage
4. Let's make a random variable called $\mathbf{Flips}$, and define it like this: $$ \mathbf{Flips} = \begin{cases} 1 & \text{one flip until the first head} \\ \vdots & \vdots \\ n & \text{$n$ flips until the first head} \\ \vdots & \vdots \end{cases}$$
What is the probability of getting $TTH$ --- that is, $\mathbf{Flips} = 3$? What is the probability that $\mathbf{Flips} = n$, for some natural number $n$?
\vspace{0.07\textheight}
5. Let's check that our probabilities sum to $1$. The \textit{partial sum} $S_n$ is the sum of our first $n$ terms in our sequence of probabilities. For example,
\begin{align*}
S_3 &= \prob{\mathbf{Flips} = 1} + \prob{\mathbf{Flips} = 2} + \prob{\mathbf{Flips} = 3} \\
&= \frac 12 + \frac 14 + \frac 18
\end{align*}
Can you express $S_3$ where only \textit{one} term has an exponent? \textit{(Hint: multiply $S_3$ by $\nicefrac 12$, then subtract the result from $S_3$, and do some algebra.)} Can you express $S_n$ the same way?
\vspace{0.1\textheight}
6. Take the limit of your expression for $S_n$. Using that limit, what can we say about the sum of the probabilities as $n$ goes to infinity?
\vspace{4em}
\dotfill \\[1em]
7. Write out the first few terms of $\expect{\mathbf{Flips}}$, the expected value of $\mathbf{Flips}$. If $p_i = \prob{\mathbf{Flips} = i}$, we can write it like:
\begin{align*}
\expect{\mathbf{Flips}} &= (1 \cdot p_1) + (2 \cdot p_2) + (3 \cdot p_3)\cdots \\
&= (p_1) + (p_2 + p_2) + (p_3 + p_3 + p_3) + \cdots \\
&= (p_1 + p_2 + p_3 + \cdots) + (p_2 + p_3 + \cdots) + (p_3 + \cdots) + \cdots
\end{align*}
where each of the terms are grouped into partial sums. We know the value of $p_1 + p_2 + p_3 + \cdots$ (look at the last problem)! What is the value of $p_2 + p_3 + \cdots$?
\vspace{6em}
8. What is the expected value of $\mathbf{Flips}?$
\end{document}