\documentclass[11pt]{article}
\def\Z{\mathbb{Z}}
\def\Q{\mathbb{Q}}
\def\R{\mathbb{R}}
\def\C{\mathbb{C}}
\usepackage{latexsym,amsmath,amssymb}
\usepackage[all]{xy}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\textheight}{8.0in}
\begin{document}
\centerline{Mathematics 375 -- Probability and Statistics 1}
\centerline{Solutions for Problem Set 9}
\centerline{November 12, 2009}
\vskip 10pt
\noindent
5.11. Since $Y_1,Y_2$ are uniformly distributed on this
triangle of area 1, the probability that $(Y_1,Y_2)$ lies 
in any region in the triangle is just the {\it area} of that region.
(Careful -- this is definitely false when the distribution 
is not uniform!)

(a) $P(Y_1\le 3/4, Y_2\le 3/4$  is the area of the 
remaining region when we ``cut off'' two small
triangles of areas $1/32$ and $1/16$ from the big triangle.
That leaves an area of $1 - 3/32 = 29/32$.

(b)  $P(Y_1 - Y_2 \ge 0)$.  $Y_1 \ge Y_2$ below the line
$y_1 = y_2$ in the plane.  This gives the triangle
with vertices $(0,0), (1,0), (1/2,1/2)$, whose area
is $1/4$.
\vskip 10pt
\noindent
5.14.  Given: $f(y_1,y_2) = 6y_1^2y_2$ if $0 \le y_1 \le y_2,
0 \le y_1 + y_2 \le 2$ and  $0$ otherwise.  The region 
where the density is nonzero is the interior of the triangle $T$
with vertices $(0,0), (1,1), (0,2)$.  

(a)  We have $f(y_1,y_2) \ge 0$ for all $y_1,y_2$, so the thing
that needs to be checked is that the total integral is $1$.
\begin{align*}
\int\int_T f(y_1,y_2)\ dA &=
\int_0^1\int_{y_1}^{2-y_1} 6y_1^2y_2\ dy_2\ dy_1\\
&= \int_0^1 3y_1^2((2-y_1)^2 - y_1^2)\ dy_1\\
&= \int_0^1 12y_1^2 - 12y_1^3\ dy_1\\
&= \left. 4y_1^3 - 3y_1^4\right|_0^1 \\
&= 1
\end{align*}
as required for a density function.

(b)  Note that $Y_1 + Y_2 = 1$ defines a line that cuts through
the triangle $T$ from part (a).  The region we want is the 
part of $T$ that lies below that line:
\begin{align*}
P(Y_1 + Y_2 \le 1) &= \int_0^{1/2}\int_{y_1}^{1-y_1} 6y_1^2y_2\ dy_2\ dy_1\\
&= \int_0^{1/2} 3y_1^2((1-y_1)^2 - y_1^2)\ dy_1\\
&= \int_0^{1/2} 3y_1^2 - 6y_1^3\ dy_1\\
&= \left. y_1^3 - (3/2)y_1^4\right|_0^{1/2} \\
&=1/32.
\end{align*}
\vskip 10pt
\noindent
5.15.  The region where the joint density is nonzero is an
infinite wedge-shaped region in the first quadrant bounded
by the $y_1$-axis ($y_2 = 0$) and the line $y_2 = y_1$.  

(a) The inequalities $Y_1 < 2$ and $Y_2 > 1$ define a 
small triangle within the wedge, with vertices at
$(1,1),(2,1),(2,2)$.  To get the desired probability here
it is somewhat simpler to integrate first with respect to 
$y_1$ (doing the other order leads to an integral by parts):
\begin{align*}
P(Y_1 < 2, Y_2 > 1) &= \int_1^2 \int_{y_2}^2 e^{-y_1}\ dy_1\ dy_2 \\ 
&= \int_1^2 e^{-y_2} - e^{-2}\ dy_2\\
&= e^{-1}-2e^{-2}\\
&\doteq .0972.
\end{align*}

(b)  The inequality $Y_1 \ge 2 Y_2$ defines the lower half of the 
wedge-shaped region -- that is, the region below the line
$Y_2 = Y_1/2$.  Again, we set up the integrals to integrate
with respedt to $y_1$ first:
\begin{align*}
P(Y_1 \ge 2Y_2) &= \int_0^\infty \int_{2y_2}^\infty e^{-y_1}\ dy_1\ dy_2\\
&= \int_0^\infty e^{-2y_2}\ dy_2\\
&= \left.\frac{-e^{-2y_2}}{2}\right|_0^\infty\\
&= \frac{1}{2}.
\end{align*}

(c)  The inequality $Y_1 - Y_2 \ge 1$ defines the portion of the 
wedge-shaped region below the line $Y_2 = Y_1 - 1$.  This is 
a line parallel to the upper edge of the wedge, passing through $(1,0)$
on the $Y_1$-axis.  The probability we want is
\begin{align*}
P(Y_1 - Y_2 \ge 1) &= \int_0^\infty \int_{y_2+1}^\infty e^{-y_1}\ dy_1\ dy_2\\
&= \int_0^\infty e^{-y_2 - 1}\ dy_2\\
&= \left. -e^{-y_2 - 1}\right|_0^\infty\\
&= e^{-1}\\
&= \doteq .3679.
\end{align*}
\vskip 10pt
\noindent
5.25.  (a)  The marginal densities are
$$f_1(y_1) = \int_0^\infty e^{-y_1 - y_2}\ dy_2 =  \left. -e^{-y_1 - y_2}\right|_0^\infty = e^{-y_1}$$
if $y_1 > 0$ and zero otherwise.  
Similarly, 
$$f_2(y_2) = \int_0^\infty e^{-y_1 - y_2}\ dy_1 =  \left. -e^{-y_1 - y_2}\right|_0^\infty = e^{-y_2}$$
if $y_2 > 0$ and zero otherwise.
These are both exponential densities with $\beta = 1$.

(b)  $P(1 < Y_i < 2.5) = \int_{1}^{2.5} e^{-y_i}\ dy_i = e^{-1} - e^{-2.5}$ for $i = 1,2$.

(c)  The conditional density is only defined for $y_2 > 0$ (since we must have $f_2(y_2) > 0$
in Definition 5.7).

(d)  The conditional density $f(y_1|y_2) = \frac{e^{-y_1-y_2}}{e^{-y_2}} = e^{-y_1}$.

(e) Similarly, $f(y_1|y_2) = e^{-y_2}$.

(f) The conditional and marginal densities for both variables are \emph{equal}.

(g)  The marginal and conditional probabilities in any interval will also be
equal.
\vskip 10pt
\noindent
5.26.  (a)  The marginal densities are 
\begin{align*}
f_1(y_1) &= \int_0^1 4y_1y_2\ dy_2 = 2y_1, \text{ and similarly }\\
f_2(y_2) &= \int_0^1 4y_1y_2\ dy_1 = 2y_2.
\end{align*}
Looking ahead to the next section, note that these
satisfy the criterion of Theorem 5.4.  So $Y_1$ and $Y_2$
are independent.

(b)  To compute the denominator in the conditional probability, 
we can use the marginal density from part a:
\begin{align*}
P(Y_1 \le 1/2 | Y_2 \ge 3/4) 
&= \frac{P(Y_1 \le 1/2, Y_2 \ge 3/4)}{P(Y_2 \ge 3/4)}\\
&= \frac{\int_0^{1/2}\int_{3/4}^1 4y_1y_2\ dy_2\ dy_1}{\int_{3/4}^1 2y_2\ dy_2}\\
&= \frac{\int_0^{1/2} 2y_1\ dy_1 \int_{3/4}^1 2y_2\ dy_2}{\int_{3/4}^1 2y_2\ dy_2}\\
&= \int_0^{1/2} 2y_1\ dy_1\\
&= 1/4.
\end{align*}
(The cancellation works this way because of independence.)  
\vskip 10pt
\noindent
5.54.  No -- $Y_1, Y_2$ cannot be independent when 
the interval of $y_2$ values where the density is 
nonzero depends on $y_1$.  (You can also see this directly
by computing $f_1(y_1)$ and $f_2(y_2)$.  The region
where the joint density is nonzero is the triangle
with vertices at $(0,0), (2,0), (2,1)$.  So
$$f_1(y_1) = \int_0^{y_1/2} 1\ dy_2 = \frac{y_1}{2}$$
(when $0 \le y_1 \le 2$; 0 otherwise).
Similarly,
$$f_2(y_2) = \int_{2y_2}^2 1\ dy_1 = 2 - 2y_2$$
(when $0 \le y_2 \le 1$; 0 otherwise).
The product $f_1(y_1)f_2(y_2)$ is not the same as $f(y_1,y_2)$.)
\vskip 10pt
\noindent
5.59.   No -- same reason as 5.54.  The marginal densities
are 
$$f_1(y_1) = \int_0^{y_1} e^{-y_1}\ dy_2 = y_1 e^{-y_1}$$
and
$$f_2(y_2) = \int_{y_2}^\infty e^{-y_1}\ dy_1 = e^{-y_2}.$$
Note that $f(y_1,y_2) \ne f_1(y_1)f_2(y_2)$.  
\vskip 10pt
\noindent
5.65.  (a)  The marginal density of $Y_1$ is computed as follows.
Note that we try to split up the integral so that 
the integrand is a product of functions of $y_1$ and $y_2$ alone.
That allows factors depending only on $y_1$ to be taken outside
the integral sign: 
\begin{align*}
f_1(y_1) &= 
\int_0^\infty \left(1 - \alpha(1 - 2e^{-y_1})(1 - 2e^{-y_2})\right)e^{-y_1-y_2}\ dy_2\\
&= e^{-y_1}\int_0^\infty e^{-y_2}\ dy_2 
- \alpha (1 - 2e^{-y_1}) e^{-y_1} \int_0^\infty (1 - 2e^{-y_2})e^{-y_2}\ dy_2\\
&=  e^{-y_1}\int_0^\infty e^{-y_2}\ dy_2  - 
- \alpha (1 - 2e^{-y_1}) e^{-y_1} \cdot \left(\int_0^\infty e^{-y_2}\ dy_2 - \int_0^\infty 2e^{-2y_2}\ dy_2\right)\\
&= e^{-y_1}\cdot 1 - \alpha (1 - 2e^{-y_1}) e^{-y_1} (1 - 1) \\
&= e^{-y_1}
\end{align*}
(since the integrals in the next to last line are all integrals
of exponential densities over the interval where they are nonzero,
hence each equals 1).  Hence $Y_1$ is exponentially distributed
with mean $\beta = 1$.  

(b)  We have $f_2(y_2) = e^{-y_2}$ by the symmetry of the joint 
density.  So $Y_2$ is also exponential with mean $\beta = 1$.  

(c)  By a general result (Theorem 5.4), $Y_1$ and $Y_2$ are independent
if and only if $f(y_1,y_2) = f_1(y_1)f_2(y_2)$.  Here, this is true
if and only if
$$e^{-y_1 -y_2} =  \left(1 - \alpha(1 - 2e^{-y_1})(1 - 2e^{-y_2})\right)e^{-y_1-y_2} = e^{-y_1-y_2} - \alpha(1 - 2e^{-y_1})(1 - 2e^{-y_2})e^{-y_1-y_2} $$
which is true if and only if $\alpha = 0$.
\vskip 10pt
\noindent
5.76.  This can be done most easily by using the
marginal densities for the $Y_i$ (although there
are several other valid methods too).  Note that 
$f_1(y_1) = \int_0^1 4y_1y_2\ dy_2 = 2y_1$ if $0 \le y_1 \le 1$, and zero otherwise.
Similarly for $f_2(y_2)$ by the symmetry of the joint
density.  

(a)  $E(Y_1) = \int_0^1 y_1 f_1(y_1)\ dy_1 = \int_0^1 2y_1^2\ dy_1 = \frac{2}{3}$.

(b)  Then the variance is:
$$V(Y_1) = E(Y_1^2) - \left(\frac{2}{3}\right)^2 = \int_0^1 2y_1^3\ dy_1 - \frac{4}{9}
= \frac{1}{2} - \frac{4}{9} = \frac{1}{18}.$$

(c)  By linearity, $E(Y_1 - 3Y_2) = E(Y_1) - 3E(Y_2) = \frac{2}{3} - 2 = \frac{-4}{3}$.
This can also be computed, for instance, as the integral:
$$\int_0^1 \int_0^1 (y_1 - 3y_2)\cdot 4y_1 y_2\ dy_2\ dy_1.$$
\vskip 10pt
\noindent
5.79.   To integrate over this region, is probably easiest to 
integrate with respect to $y_1$ first:
\begin{align*}
E(Y_1Y_2) &= \int_0^1 \int_{y_2-1}^{-y_2+1} y_1y_2\ dy_1\ dy_2\\ 
&= \int_0^1 y_2 \frac{(-y_2 + 1)^2 - (y_2 - 1)^2}{2}\ dy_1\\
&= 0,
\end{align*}
since everything cancels out in the integrand.
\vskip 10pt
\noindent
5.80. Using the joint density, we multiply out and integrate term by term:
\begin{align*}
E(30Y_1 + 25Y_2) &= \int_0^1 \int_0^1 (30y_1 + 25y_2)(y_1 + y_2)\ dy_2\ dy_1\\
&= \int_0^1 \int_0^1 30y_1^2 + 55y_1 y_2 + 25 y_2^2\ dy_2\ dy_1\\
&= \int_0^1 30y_1^2 + \frac{55}{2}y_1 + \frac{25}{3}\ dy_1\\
&=\frac{385}{12}.
\end{align*}
\vskip 10pt
\noindent
{\it Additional Problem}
\vskip 10pt
By the definition of the $\Gamma$ function
and the fact that the two integration variables are independent 
of each other (i.e. $s$ is a constant with respect to $t$ and 
vice versa),
\begin{align}
\label{eq1}
\Gamma(p)\Gamma(q) 
&= \int_0^\infty s^{p-1} e^{-s}\ ds\cdot \int_0^\infty t^{q-1} e^{-t}\ dt\nonumber\\
&=\int_0^\infty s^{p-1} e^{-s}\cdot \int_0^\infty t^{q-1} e^{-t}\ dt\ ds\\
&=\int_0^\infty \int_0^\infty s^{p-1} t^{q-1} e^{-(s+t)}\ dt\ ds.\nonumber
\end{align}
The region of integration here is the entire first quadrant in the 
$(s,t)$-plane ($s$= horizontal axis, $t$= vertical axis).

Now we do the first change of variables, letting 
$u = s+t$ and putting $u$ on the horizontal axis, $s$ on the 
vertical axis in the new coordinate system.  The $s$-axis
in the old coordinate system maps to the line through $(1,1)$ in
the new coordinates.  The $t$-axis in the old coordinates maps
to the $u$ axis in the new coordinates
and the first quadrant in the $(s,t)$ plane maps to the ``wedge''
bounded by $s = u$ and the $u$-axis in the new coordinates.
This means that the new form of the double integral (\ref{eq1}) is 
\begin{equation}
\label{eq2}
\int_0^\infty \int_0^u s^{p-1} (u-s)^{q-1} e^{-u}\ ds\ du.
\end{equation}

Next, we perform the second change of coordinates, letting
$\lambda = s/u$, $u = u$.  Note that the value of $\lambda$ at 
any point is the {\it slope of the line through that point and 
the origin}.  Hence the wedge corresponds to the infinite
``rectangle'' $0 \le \lambda \le 1$, $0 \le u \le \infty$ 
in the new coordinates, and with the given information
about how the area element transforms, we get that (\ref{eq2}) becomes:
\begin{equation}
\label{eq3}
\int_0^\infty \int_0^1 (\lambda u)^{p-1} (u-\lambda u)^{q-1} e^{-u} u d\lambda\ du.
\end{equation}

Then, working with the integrand in (\ref{eq3}), we can simplify,
then split the result back up into two one-variable integrals
(reversing the process we did above in the first step):
\begin{align*}
&\int_0^\infty \int_0^1 \lambda^{p-1} (1-\lambda)^{q-1} u^{p+q-1} e^{-u} d\lambda\ du\\
&= \int_0^\infty \int_0^1 \lambda^{p-1} (1-\lambda)^{q-1} u^{p+q-1} e^{-u} d\lambda\ du\\
&=\int_0^1 \lambda^{p-1} (1-\lambda)^{q-1}\ d\lambda\cdot \int_0^\infty u^{p+q-1} e^{-u}\ du\\
&=B(p,q)\Gamma(p+q)
\end{align*}
(by the definitions of the beta and gamma functions).  We have shown that
$$\Gamma(p)\Gamma(q) = B(p,q)\Gamma(p+q),$$
from which we get the desired equality by dividing both sides
by $\Gamma(p+q)$.  (Again, very cool!!)

\end{document}
