---
# System prepended metadata

title: 機率HW9

---

機率HW9
===

## 1.
### (a.)
$p(1,1)+p(1,3)+p(2,3)=k(1+1+1+9+4+9)=1$
$k=\frac{1}{25}$
### (b.)
$p_x(X=1)=p(1,1)+p(1,3)=\frac{1}{25}(1+1+1+9)=\frac{12}{25}$
$p_x(X=2)=p(2,3)=\frac{13}{35}$
$p_y(Y=1)=p(1,1)=\frac{2}{25}$
$p_y(Y=3)=p(1,3)+p(2,3)=\frac{1}{25}(1+9+4+9)=\frac{23}{25}$
### (c.)
$E(X)=1\times\frac{12}{25}+2\times\frac{13}{25}=\frac{38}{25}$
$E(Y)=1\times\frac{2}{25}+3\times\frac{23}{25}=\frac{71}{25}$

## 2.
| $p(x,y)$ |y= 0 | 1 |2|3|4|5|$p_x$|
| -------- | -------- | -------- |-|-|-|-|-|
|x=2|$\frac{1}{36}$|0|0|0|0|0|$\frac{1}{36}$|
|3|0|$\frac{2}{36}$|0|0|0|0|$\frac{2}{36}$|
|4|$\frac{1}{36}$|0|$\frac{2}{36}$|0|0|0|$\frac{3}{36}$|
|5|0|$\frac{2}{36}$|0|$\frac{2}{36}$|0|0|$\frac{4}{36}$|
|6|$\frac{1}{36}$|0|$\frac{2}{36}$|0|$\frac{2}{36}$|0|$\frac{5}{36}$|
|7|0|$\frac{2}{36}$|0|$\frac{2}{36}$|0|$\frac{2}{36}$|$\frac{6}{36}$|
|8|$\frac{1}{36}$|0|$\frac{2}{36}$|0|$\frac{2}{36}$|0|$\frac{5}{36}$|
|9|0|$\frac{2}{36}$|0|$\frac{2}{36}$|0|0|$\frac{4}{36}$|
|10|$\frac{1}{36}$|0|$\frac{2}{36}$|0|0|0|$\frac{3}{36}$|
|11|0|$\frac{2}{36}$|0|0|0|0|$\frac{2}{36}$|
|12|$\frac{1}{36}$|0|0|0|0|0|$\frac{1}{36}$|
|$p_y$|$\frac{6}{36}$|$\frac{10}{36}$|$\frac{8}{36}$|$\frac{6}{36}$|$\frac{4}{36}$|$\frac{2}{36}$|

## 3.
### (a.)
$f_x(t)=\int^t_0 2dy=2t ,0 \le t \le 1$
$f_y(t)=\int^1_t 2dx=2-2t ,0 \le t \le 1$
### (b.)
$E(X)=\int^1_0 xf_x(x)dx=\int^1_0 x(2x)dx=\frac{2}{3}x^3|^1_0=\frac{2}{3}$
$E(Y)=\int^1_0 yf_y(y)dy=\int^1_0 y(2-2y)dy=y^2-\frac{2}{3}y^3|^1_0=\frac{1}{3}$
### (c.)
$P(X < \frac{1}{2})=\int^{\frac{1}{2}}_0 f_x(x)dx=\int^{\frac{1}{2}}_0 2xdx=x^2|^{\frac{1}{2}}_0=\frac{1}{4}$
$P(X < 2Y)=\int^1_0\int^x_{\frac{x}{2}}f(x,y)dydx=\int^1_0\int^x_{\frac{x}{2}}2dydx=\int^1_0xdx=\frac{1}{2}$
$P(X=Y)=0$

## 4.
$p_x(1)=p(1,1)+p(1,2)=\frac{1}{7}+\frac{2}{7}=\frac{3}{7}$
$p_y(1)=p(1,1)+p(2,1)=\frac{1}{7}+\frac{5}{7}=\frac{6}{7}$
$p(1,1)=\frac{1}{7} \neq p_x(1)\times p_y(1)$
X and Y are dependent.


## 5.
$f(x,y)=e^{-x} \times 2e^{-2y}$
$f_x=e^{-x}$
$f_y=2e^{-2y}$
X and Y are independent.
So $E(X^2Y)=E(X^2)E(Y)$
$E(X^2)=\int^{\infty}_0 x^2e^{-x}dx=2$
$E(Y)=\int^{\infty}_0 2ye^{-2y}dy=\frac{1}{2}$
$E(X^2Y)=2 \times \frac{1}{2}=1$

## 6.
$p_Y(y)=\Sigma^2_{x=1} p(x,y)=\frac{5+2y^2}{25}$
$p_{X|Y}(x|y)=\frac{p(x,y)}{p_Y(y)}=\frac{x^2+y^2}{5+2y^2} , x=1,2 ,y=0,1,2$ 

$P(X=2|Y=1)=p_{x|y}(2|1)=\frac{5}{7}$

$E(X|Y=1)=1 \times P(X=1|Y=1)+2 \times P(X=2|Y=1)=p_{X|Y}(1|1)+2\times p_{X|Y}(2|1)=\frac{2}{7}+\frac{10}{7}=\frac{12}{7}$

## 7.
### (a.)
$2\times \frac{1}{2}=1$
$f(x,y)=2,x \ge 0 ,y \ge 0 ,x+y \le 1$
$f(x,y)=0 ,otherwise$
### (b.)
$f_Y(y)=\int^{1-y}_02dx=2-2y,0 <y<1$
$f_{X|Y}(x|y)=\frac{f(x,y)}{f_Y(y)}=\frac{1}{1-y},x \ge 0 ,y \ge 0 ,x+y \le 1$
### (c.)
$E(X|Y=y)=\int^{1-y}_0xf_{X|Y}(x|y)dx=\int^{1-y}_0\frac{x}{1-y}dx=\frac{1-y}{2},0 <y<1$

## 8.
### (a.)
$F_z(t)=P(Z \le t)=P(max(x,y)\le t)=P(x \le t ,y \le t)=P(x\le t)P(y \le t)$ 
$P(x\le t)=P(y \le t)=\frac{1+t}{2}$
$$
F_z(t)=
\left\{
\begin{eqnarray}
  0 \qquad t \le -1\\
  \frac{(1+t)^2}{4} \qquad -1 \le t \le 1 \\
  1 \qquad t \ge 1 \\
\end{eqnarray}
\right.
$$
###
$f_Z(t)=F^{\prime}(t)=\frac{1+t}{2}$
$E(Z)=\int^1_{-1}tf(t)dt=\int^1_{-1}\frac{t+t^2}{2}dt=\frac{1}{2}(\frac{t^2}{2}+\frac{t^3}{3})|^1_{-1}=\frac{1}{3}$



