% Sample Question document for STA256
\documentclass[12pt]{article} 
%\usepackage{amsbsy} % for \boldsymbol and \pmb 
%\usepackage{graphicx} % To include pdf files!
\usepackage{amsmath}
\usepackage{amsbsy}
\usepackage{amsfonts}
\usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref} % For links
\usepackage{fullpage}
%\pagestyle{empty} % No page numbers


\begin{document}
%\enlargethispage*{1000 pt} 

\begin{center}   
{\Large \textbf{Sample Questions: Expected Value, Variance and Covariance}}

STA256 Fall 2019. Copyright information is at the end of the last page.
%\rule{6in}{.01in} % Width and height
\rule{6in}{.005in} % Horizontal line (Width and height)

% \vspace{3 mm}
\end{center}
\begin{enumerate} 

\item {\Large Let $X$ have a continuous uniform distribution on $(L,R)$. Calculate $E(X)$. }
    

\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item Recall that a fair game is one with expected value zero. You wager one dollar, and toss a coin with $P(\mbox{Head}) = \theta$. If it's heads, you win. In dollars, what should the payoff be so that the game is fair?

% (1-theta)*(-1) + theta*a = 0 <=> theta*a = 1=theta <=> a = (1-theta)/theta
% So for example, if P(H)=1/100, payout should be $99.

\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item {\Large Let $X \sim$ Poisson($\lambda$). Calculate $E(X)$. }


\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item Let the continuous random variable $X$ have density
    {\Large
    $f_{_X}(x) = \left\{ \begin{array}{ll} 
   \frac{\alpha}{x^{\alpha+1}} & \mbox{ for } x \geq 1  \\
   0     & \mbox{otherwise}  
   \end{array}  \right. $
    } % End size
Where $\alpha>0$.

        \begin{enumerate}
            \item Verify that $f_{_X}(x)$ integrates to one. \vspace{80mm}
            \item Calculate $E(X)$. For what values of $\alpha$ does $E(X)$ exist?
        \end{enumerate}

\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item {\Large Let $X \sim N(\mu,\sigma^2)$. Calculate $E(X)$. }

\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% \item {\Large Let $X$ have a binomial distribution with parameters $n$ and $p$. Calculate $E(X)$. }

%\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item {\Large Let $X$ have a Gamma distribution with parameters $\alpha$ and $\lambda$. Calculate $E(X^k)$. } % Update!


\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% \item  {\Large Prove $Var(a+X) = Var(X)$. }

%\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item  {\Large Prove $Var(bX) = b^2Var(X)$. }

\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item  {\Large Show $Var(X) = E(X^2)-[E(X)]^2$.}

\pagebreak

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\item  {\Large Let $X \sim$ Uniform(0,1). Calculate $Var(X)$.}

%\pagebreak


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item  {\Large Let $X$ have density $e^{-x}$ for $x \geq 0$ and zero otherwise. Calculate $Var(X)$.}

\pagebreak


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item  {\Large Let $X \sim N(\mu,\sigma^2)$. Calculate $Var(X)$.}


\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item {\Large Show $Cov(X,Y) = E(XY) - E(X) E(Y)$.}

\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item {\Large Let $X$ and $Y$ be independent (continuous) random variables. Show $E(XY)=E(X)E(Y)$. }

 \vspace{150mm}

\item If $X$ and $Y$ are independent, $Cov(X,Y) = $ 

\end{enumerate} % End of all the questions

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\noindent
\begin{center}\begin{tabular}{l}
\hspace{6in} \\ \hline
\end{tabular}\end{center}
This handout was prepared by  \href{http://www.utstat.toronto.edu/~brunner}{Jerry Brunner},
Department of Mathematical and Computational Sciences, University of Toronto. It is licensed under a 
\href{http://creativecommons.org/licenses/by-sa/3.0/deed.en_US}
     {Creative Commons Attribution - ShareAlike 3.0 Unported License}. Use any part of it as you like and share the result freely. The \LaTeX~source code is available from the course website: 
     
\begin{center}
\href{http://www.utstat.toronto.edu/~brunner/oldclass/256f19} {\small\texttt{http://www.utstat.toronto.edu/$^\sim$brunner/oldclass/256f19}}
\end{center}

\end{document}

\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\item {\Large  The discrete random variables $x$ and $y$ have joint distribution 
\begin{center}
\begin{tabular}{c|ccc} 
        &  $x=1$   & $x=2$    & $x=3$   \\  \hline
$y=1$   &  $3/12$  & $1/12$   & $3/12$  \\
$y=2$   &  $1/12$  & $3/12$   & $1/12$  \\ 
\end{tabular}
\end{center}         
    \begin{enumerate}
        \item What is $E(X|Y=1)$? \vspace{80mm}
        \item What is $E(Y^2|X=2)$? \vspace{70mm}
    \end{enumerate}
}% End size

\begin{tabular}{c|ccc} 
        &  $x=1$   & $x=2$    & $x=3$   \\  \hline
$y=1$   &  $3/12$  & $1/12$   & $3/12$  \\
$y=2$   &  $1/12$  & $3/12$   & $1/12$  \\ 
\end{tabular}

\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item  % Simple but requiring a clear head. Of course E(Y|X=x) has to equal x^2/2 unless you make a mistake.
{\large
Let $f_{x,y}(x,y) = 3$ for $0 < x < 1 $ and $ 0 < y < x^2$, and zero otherwise. \vspace{40mm}
    \begin{enumerate}
        \item Using $f_x(x)=3x^2$ for $0<x<1$, what is $f_{y|x}(y|x)$? Don't forget the support.  \vspace{80mm}
        \item Find $E(Y|X=x)$, where $x$ is a fixed constant between zero and one.  \vspace{80mm} 


\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

        \item Find $E(Y)$ by double expectation. \vspace{100mm}
        \item Using $f_y(y)=3(1-y^{1/2})$ for $0<x<1$, calculate $E(Y)$ directly.
    \end{enumerate}

 } % End size


\pagebreak %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item  {\large Show that $Cov(X,Y) = E(XY)-E(X)E(Y)$} \vspace{130mm}

\item  {\large Show that if $X$ and $Y$ are independent, $Cov(X,Y)= 0$.        }

\pagebreak %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item  The discrete random variables $x$ and $y$ have joint distribution 
{\large 
\begin{center}
\begin{tabular}{c|ccc} 
        &  $x=1$   & $x=2$    & $x=3$   \\  \hline
$y=1$   &  $3/12$  & $1/12$   & $3/12$  \\
$y=2$   &  $1/12$  & $3/12$   & $1/12$  \\ 
\end{tabular}
\end{center}        
    \begin{enumerate}
        \item Find $Cov(X,Y)$. \vspace{120mm}
        \item Are $X$ and $Y$ independent?
    \end{enumerate}
} % End size

\pagebreak %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item  {\large Show $Var(aX + bY) = a^2Var(X)+b^2Var(Y) + 2abCov(X,Y)$         }

\pagebreak %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item  {\large Prove that $Var\left(\sum_{i=1}^n a_iX_i \right) = \sum_{i=1}^n a_i^2Var(X_i) 
\, + \, \sum\sum_{i \neq j} a_ib_j Cov(X_i,X_j)$.         }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%









% The answer is a number. Circle your answer.

% MESSY!
    \item Continuing with
    {\Large
    $f_{x,y}(x,y) = \left\{ \begin{array}{ll} 
   2e^{-(x+y)} & \mbox{for $ 0 \leq x \leq y$ and $y \geq 0$}  \\
   0     & \mbox{otherwise}  
   \end{array}  \right. $
   
\noindent
Obtain $F_{xy}(x,y)$. Consider $x<y$ and $x>y$ separately.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\item  {\Large          }

\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



More questions, maybe for HW.
\begin{enumerate}
    \item Let $X$ and $Y$ be independent (discrete) random variables. Show $E\left(g(X)h(Y)\right)=E\left(g(X)\right)E\left(h(Y)\right)$.
    \item Let $X \sim$ Uniform(1,2). Find $E(\frac{1}{X})$.
    \item True or false? $E(\frac{1}{X}) = 1/E(X)$. If it is true, prove it in general. If it is false, give a counter-example.
    \item 
    \item 
\end{enumerate}








