%%% Document Class
\documentclass[11pt]{letter}
\usepackage[margin=1in]{geometry}
%%% Packages
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{mathtools}
%%% Variables
\newcommand{\courseName}{Math 480A2}
\newcommand{\hwNumber}{7}
\newcommand{\hwDueDate}{October 13, 2022}
%%% Definitions
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\CC}{\mathbb{C}}
\renewcommand{\implies}{\rightarrow}
\renewcommand{\iff}{\leftrightarrow}
\renewcommand{\vec}[1]{\mathbf{#1}}
\DeclareMathOperator{\Prob}{Pr} % probability
\newcommand{\Exp}{\mathbb{E}} % expected value
\newcommand{\C}{{\rm c}} % complement
\renewcommand{\theenumi}{\Alph{enumi}}
\newcounter{saveenum}
%%% Document
\begin{document}
\begin{center}
{\large \courseName, Homework \hwNumber}\\
Due \hwDueDate\\
\end{center}
{\small \textit{Homework is graded out of a total of 10 points. Collaboration is permitted, but you must list all coauthors on a problem's solution at the top of the page, and your writing must be your own.}}
\vspace{5mm}
\textbf{Problem 1.} (6 points) In the following, consider the random outcomes of a fair 12-sided die, where ``fair'' here means that each outcome has an equal chance of occurring.
\begin{enumerate}
\item Describe a discrete probability space which represents the situation given above, including a set $X$ of outcomes, and a probability function describing the likelihood of each outcome.
\item Let $D$ be the random variable on $X$ mapping each outcome to its number of positive divisors. (E.g.\ $R(6) = 4$ since 6 is divisible by 1, 2, 3, and 6.) Compute the expected value of $D$.
\setcounter{saveenum}{\value{enumi}}
\end{enumerate}
The random variable $D$ allows us to define a probability function on the set of its possible values as follows: if $d$ is a positive integer representing a possible number of divisors, then define $\Prob(d) = \Prob[D = d]$, where the right side of this equation is the probability of the random variable $D$ taking value $d$ over the original probability space $X$. This probability function is called the \emph{push-forward} distribution of $X$ by the random variable $D$.
\begin{enumerate}
\setcounter{enumi}{\value{saveenum}}
\item Compute the push-forward distribution of $X$ by the random variable $D$, expressed as a probability function $p$ on the set $Y = \{1, 2, 3, \ldots\}$ of positive integers. (\textit{Hint}. In other words, compute the values of the function $p(d) = \Prob[D = d]$ for each positive integer $d$.)
\end{enumerate}
\vspace{5mm}
\textbf{Problem 2.} (4 points) Now consider the following random system: we repeatedly roll a fair 4-sided die until a 4 is rolled, at which point we stop, and we record the sequence of rolls as our outcome. Thus if we rolled a 3 and then a 4, the outcome would be the finite sequence $(3, 4)$, and if we rolled a 2, followed by a 1, followed by a 2, followed by a 4, then the outcome would be the sequence $(2, 1, 2, 4)$.
\begin{enumerate}
\item Describe a discrete probability space which represents the situation given above, including a set $X$ of outcomes, and a probability function $p$ describing the likelihood of each outcome. Show that $\sum_{x \in X} p(x) = 1$ for this set $X$ and probability function $p$.
\item Let $L$ be the random variable on $X$ mapping each outcome to its number of rolls, i.e.\ to its length as a sequence. (E.g.\ $L((2, 1, 2, 4)) = 4$.) Using Markov's inequality and the fact that the expected value of $L$ is 4, find an upper bound on the probability that a sequence of rolls has length at least 10.
\end{enumerate}
\textbf{Challenge.} (1 bonus point) Prove that the random variable $L$ from the previous problem has expected value 4.
\end{document}