\documentclass[letterpaper,11pt]{article}
\newcommand{\removefromfile}[1]{}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[shortlabels]{enumitem}
\usepackage[colorlinks=true,linkcolor=blue,citecolor=blue]{hyperref}
\usepackage[margin=1in]{geometry}
\usepackage[most]{tcolorbox}
\newcommand{\expect}[1]{\mathbb{E}\left[#1\right]}
\newcommand{\Var}[1]{\mathrm{Var}\left(#1\right)}
\renewcommand{\Pr}{\mathbb{P}}
\newcommand{\Prob}[1]{\Pr\left(#1 \right)}
\def\code#1{\textcolor{blue}{\texttt{#1}}}
\begin{document}
\title{{\bf Problem Set 8} }
\author{Name: TODO}
\date{}
\maketitle
\section*{Collaborators}
TODO: List collaborators, if any.
\newpage
\section*{Task 1 (Practice with conditional expectation)}
Suppose $X$ and $Y$ have the following joint PMF:
\begin{center}
\begin{tabular}{|c | c| c| c|}
\hline
X/Y & 1 & 2 & 3 \\
\hline
0 & 1/4 & 3/16 & 1/16 \\
\hline
1 & 1/8 & 0 & 3/8 \\
\hline
\end{tabular}
\begin{enumerate}[a)]
\item (3 points) what is $\Prob{X=1~|~Y=2}$?
\begin{tcolorbox}
TODO: Your solution here.
\end{tcolorbox}
\item (3 points) What is $\expect{X~|~Y=2}$?
\begin{tcolorbox}
TODO: Your solution here.
\end{tcolorbox}
\item (4 points) What is $$ \expect{\frac{X}{Y} ~\Big|~ X^2 + Y^2 \le 4 }?$$
Use the fact that if events $A_1, \dots, A_n$ partition an event $A$, then
\[ \expect{F \mid A} \quad = \quad \sum_{i=1}^{n} \expect{F \mid A_i} \Prob{A_i\mid A} \quad = \quad \frac{1}{\Prob{A}} \sum_{i=1}^{n} \expect{F \mid A_i} \Prob{A_i} \]
for any random variable $F$.
\begin{tcolorbox}
TODO: Your solution here.
\end{tcolorbox}
\end{enumerate}
\end{center}
\newpage
\section*{Task 2 (TA positions)}
12 students have decided to apply for a TA position next quarter.
The number of courses that they can be a TA for is a Poisson random variable with mean 5. Suppose that each student independently chooses exactly one of the courses to apply for uniformly at random (and independently of the choices of the other applicants). Suppose also that each student has probability 0.2 of being acceptable as a TA to the professor teaching any course they apply for. Use the law of total expectation to compute the expected number of courses that have at least one applicant acceptable to the professor for that course.
\begin{tcolorbox}
TODO: Your solution here.
\end{tcolorbox}
\newpage
\section*{Task 3 (Lazy Grader)}
Prof.\ Lazy decides to assign final grades in CSE 312 by
ignoring all the work the students have done and instead using the
following probabilistic method: each student independently will be
assigned an A with probability $\theta$, a B with probability
$3\theta$, a C with probability $\frac{2}{3}$, and an F with
probability $\frac{1}{3} - 4\theta$. When the quarter is over, you
discover that only 10 students got an A, 35 got a B, 40 got a C, and 15
got an F.
\medskip
\noindent Find the maximum likelihood estimate for the parameter
$\theta$ that Prof.\ Lazy used. Give an exact answer as a simplified
fraction. You do not need to check second order conditions.
\begin{tcolorbox}
TODO: Your solution here.
\end{tcolorbox}
\newpage
\section*{Task 4 (Continuous MLE)}
\begin{enumerate}[a)]
\item Let $x_1, x_2, \ldots, x_n$ be independent
samples from an exponential distribution with unknown parameter
$\lambda$. What is the maximum likelihood estimator for $\lambda$?
\begin{tcolorbox}
TODO: Your solution here.
\end{tcolorbox}
\item Given $\theta>0$. Suppose that $x_1, \ldots, x_n$ are i.i.d. realizations (aka samples) from the model
$$f(x; \theta) = \begin{cases}
\theta x^{\theta -1} & 0 < x < 1 \\
0 & \text{otherwise}.
\end{cases}
$$
Find the maximum likelihood estimate for $\theta$.
\begin{tcolorbox}
TODO: Your solution here.
\end{tcolorbox}
\end{enumerate}
\newpage
\section*{Task 5 (Elections)}
Individuals in a certain country are voting in an election between 3 candidates: $A$, $B$ and $C$. Suppose that each person makes their choice independent of others and votes for candidate A with probability $\theta_1$, for candidate B with probability $\theta_2$ and for candidate C with probability
$1 - \theta_1 - \theta_2$. (Thus, $0 \le \theta_1 + \theta_2 \le 1 $.) The parameters $\theta_1, \theta_2$ are unknown.
Let $n_A$, $n_B$, and $n_C$ be the number of votes for candidate $A$, $B$, and $C$, respectively.
What are the maximum likelihood estimates for $\theta_1$ and $\theta_2$ in terms of $n_A, n_B,$ and $n_C$?
(You don't need to check second order conditions.)
\begin{tcolorbox}
TODO: Your solution here.
\end{tcolorbox}
\newpage
\section*{Task 6 ((Un)biased Estimation)}
Let $x_1, \ldots, x_n$ be independent samples from Unif$(0,\theta)$, the continuous uniform distribution on $[0, \theta]$. Then, consider the estimator $\hat{\theta}_{\mathrm{first}} = 2x_1$, i.e., our estimator ignores the samples $x_2, \ldots, x_{n}$ and just outputs twice the value of the first sample.
Is $\hat{\theta}_{\textrm{first}}$ unbiased?
\begin{tcolorbox}
TODO: Your solution here.
\end{tcolorbox}
\end{document}