\documentclass[10pt]{article}
\usepackage{amsmath,amsfonts}

\textwidth15cm \textheight23.5cm

\oddsidemargin-0cm \topmargin-2cm

\newcommand{\x}{\boldsymbol{x}}
\newcommand{\y}{\boldsymbol{y}}
\newcommand{\f}{\boldsymbol{f}}
\renewcommand{\v}{\boldsymbol{v}}
\newcommand{\w}{\boldsymbol{w}}
\renewcommand{\a}{\boldsymbol{a}}
\renewcommand{\b}{\boldsymbol{b}}
\renewcommand{\c}{\boldsymbol{c}}
\newcommand{\e}{\boldsymbol{e}}
\newcommand{\p}{\boldsymbol{p}}
\renewcommand{\Re}{\operatorname{Re}}
\renewcommand{\Im}{\operatorname{Im}}
\newcommand{\Range}{\operatorname{Range}}
\newcommand{\Ker}{\operatorname{Ker}}
\renewcommand{\dim}{\operatorname{dim}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}

\newcommand{\Span}{\operatorname{Span}}
\newcommand{\C}{\mathbb{C}}


\begin{document}

{\LARGE Problem 3 of homework 9:} \vspace{.5cm}

\parindent0cm
(E)\\

The random variable $G_x$ can take the values $x^2$ (in case we
win) and $-x$ (in case we lose). Since we win with probability
$p_x$ we lose with probability $1-p_x$:
\begin{align*}
  E[G_x] &= p_x \, x^2+ (1-p_x) \, (-x) = p_x \, (x^2+x) -x . \\
\end{align*}
\begin{align*}
  E[G_2] &= -\frac {13} 8 ,\quad
  E[G_3] = -\frac {3} 2  ,\quad
  E[G_4] = -\frac {1} 4  ,\quad
  E[G_5] = \frac {5} 2 ,\\
  E[G_6] &= \frac {15} 8  ,\quad
  E[G_7] = 0  ,\quad
  E[G_8] = -\frac {7} 2.
\end{align*}



(A)\\

If we always guess the number obtained in the
previous---statistically independent---trial,  then this number
plays the role of a random variable $X$, and the expected payout
for a particular value of the random variable as has been
calculated in (E) is now a \emph{function of the random variable}
$X$.

The expected payout is therefore
\begin{align*}
  E[E[G_X]]
  & = \sum_{x=2}^8 p_x \, E[G_x] \\
  & = \tfrac1{16} \, \tfrac{-13}8
      + \tfrac2{16} \, \tfrac{-3}2
      + \tfrac3{16} \, \tfrac{-1}4
      + \tfrac4{16} \, \tfrac52
      + \tfrac3{16} \, \tfrac{15}8
      + \tfrac2{16} \, 0
      + \tfrac1{16} \, \tfrac{-7}2 \\
  & = \tfrac{27}{64} .
\end{align*}


\end{document}