\documentclass{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{verbatim} \usepackage{amsthm} \setlength{\parindent}{0pt} \begin{document} Jonathan Yu (jsyu) 21-217 HW5 \begin{enumerate} \item \begin{enumerate} \item First, let us compute \[P_X(3) = \sum_{i=1}^3 P_{X,Y}(3,i) = 1/9 + 1/18 + 1/9 = 5/18.\] Then we can compute \[P_{Y|X}(y|3) = P_{X,Y}(3,y) / P_X(3) = 18 P_{X,Y}(3,y) / 5.\] Then we have \begin{align*} P_{Y|X}(1|3) &= 18(1/9)/5\\ P_{Y|X}(2|3) &= 18(1/18)/5\\ P_{Y|X}(3|3) &= 18(1/9)/5. \end{align*} \item \begin{align*} E[X|Y = 2] &= \sum_{x=1}^3 x P_{X|Y}(x,2)\\ &= 1(1/9) + 2(0) + 3(1/18) = 5/18\\ \end{align*} \item We are given the joint PMF, so we can sum the rows and the columns \[\begin{array}{c|c|c|c|c} &1 &2 &3 & \\ 1&1/9 &1/9 &0 &2/9 \\ 2&1/3 &0 &1/6 &1/2 \\ 3&1/9 &1/18&1/9 &5/18\\ &5/9 &3/18&5/18&5/18\\ \end{array}\] Note that $P_X(1)P_Y(1) = (2/9)(5/9) \neq 1/9 = P_{X,Y}(1,1)$. Then $X$ and $Y$ are not independent. \end{enumerate} \item Let $X$ be the number of components that function tomorrow and \[X_i = \left\{\begin{array}{rl} 0&\text{ if component } i \text{ functions tomorrow}\\ 1&\text{ otherwise} \end{array}\right..\] \begin{enumerate} \item By linearity of expectations, \begin{align*} E[X | rain] &= E[\sum_{i=1}^n X_i | rain]\\ &= \sum_{i=1}^n E[X_i | rain]\\ &= \sum_{i=1}^n p_i. \end{align*} \item By linearity of expectations, \begin{align*} E[X] &= E[\sum_{i=1}^n X_i]\\ &= \sum_{i=1}^n E[X_i]\\ &= \sum_{i=1}^n (E[X_i | rain]\alpha + E[X_i | not\ rain](1-\alpha))\\ &= \sum_{i=1}^n (\alpha p_i + (1-\alpha)q_i). \end{align*} \end{enumerate} \item Recall from lecture that \begin{align*} P(X = k | X+Y = n) &= \frac{P(X=k,X+Y = n)}{P(X+Y = n)}\\ &= \frac{P(X=k,Y = n-k)}{P(X+Y = n)}. \end{align*} First, we reduce the numerator to \begin{align*} P(X=k,Y = n-k) &= P(X=k)P(Y = n-k)&\text{independent}\\ &= \left(e^{-\lambda} \frac{\lambda^k}{k!}\right) \left(e^{-\mu} \frac{\mu^{n-k}}{(n-k)!}\right)\\ &= e^{-\lambda-\mu} \frac{\lambda^k \mu^{n-k}}{k!(n-k!)}\\ &= e^{-\lambda-\mu} \lambda^k \mu^{n-k}\frac{1}{n!}{n \choose k}. \end{align*} Similarly, we can reduce the denominator to \begin{align*} P(X+Y = n) &= \sum_{k=0}^n P(X=k,Y = n-k)\\ &= \sum_{k=0}^n P(X=k)P(Y = n-k)&\text{independent}\\ &= e^{-\lambda-\mu}\frac{1}{n!} \sum_{k=0}^n \lambda^k \mu^{n-k}{n \choose k}. \end{align*} Then we have \begin{align*} P(X = k | X+Y = n) &= \frac{e^{-\lambda-\mu} \lambda^k \mu^{n-k}\frac{1}{n!}{n \choose k}} {e^{-\lambda-\mu}\frac{1}{n!} \sum_{k=0}^n \lambda^k \mu^{n-k}{n \choose k}}\\ &=\frac{\lambda^k \mu^{n-k}{n \choose k}}{\sum_{k=0}^n \lambda^k \mu^{n-k}{n \choose k}}\\ \end{align*} \item Let $X$ be the expected time it takes for the miner to escape. Then \begin{align*} E[X] &= E[X | A]P(A) + E[X | B]P(B)\\ &= 10(1/2) + E[X | B](1/2)\\ &= 10(1/2) + (E[X] + 5)(1/2)\\ E[X] &= 5 + E[X]/2 + 5/2\\ E[X]/2 &= 5 + 5/2\\ E[X] &= 10 + 5 = 15. \end{align*} \item We start by conditioning $E[X^3]$ on $X = 1$ to get \[E[X^3] = P(X = 1) E[X^3 | X = 1] + P(X > 1) E[X^3 | X > 1].\] Then by memoryless of $X$ and linearity of expectations, \[E[X^3 | X > 1] = E[(X + 1)^3] = E[X^3] + 3E[X^2] + 3E[X] + 1 = E[X^3] + 3(2-p)/p^2 + 3/p + 1\] We now have \begin{align*} E[X^3] &= p(1) + (1-p)(E[X^3] + 3(2-p)/p^2 + 3/p + 1)\\ E[X^3] &= p + E[X^3] + 3(2-p)/p^2 + 3/p + 1 - pE[X^3] - 3(2-p)/p - 3 - p\\ 0 &= 3(2-p)/p^2 + 3/p - pE[X^3] - 3(2-p)/p - 2\\ pE[X^3] &= 3(2-p)/p^2 + 3/p - 3(2-p)/p - 2\\ E[X^3] &= 3(2-p)/p^3 + 3/p^2 - 3(2-p)/p^2 - 2p\\ &= \big(3(2-p) + 3p - 3(2-p)p - 2p^4\big) / p^3\\ &= \big(6 - 3p + 3p - 6p - 3p^2 - 2p^4\big) / p^3\\ &= \big(6 - 6p - 3p^2 - 2p^4\big) / p^3. \end{align*} \item \begin{enumerate} \item We can find the mean of the sample mean with \begin{align*} E[\bar{X}] &= \frac{1}{n} E[\sum_{i=1}^n X_i]\\ &= \frac{1}{n} \sum_{i=1}^n E[X_i] &\text{by linearity of expectations}\\ &= \frac{1}{n} \sum_{i=1}^n \lambda\\ &= \frac{1}{n} n\lambda\\ &= \lambda. \end{align*} The sample mean does not change when we change $n$. We can find the variance of the sample mean with \begin{align*} var(\bar{X})&= \frac{1}{n^2} var\left(\sum_{i=1}^n X_i\right)\\ &= \frac{1}{n^2} \sum_{i=1}^n var\left(X_i\right) &\text{independent}\\ &= \frac{1}{n^2} \sum_{i=1}^n \lambda\\ &= \frac{1}{n^2} n\lambda\\ &= \frac{\lambda}{n}. \end{align*} For $n = 25$, we get $\frac{\lambda}{25}$ and for $n = 400$, we get $\frac{\lambda}{400}$. \item Note that $var(\bar{X}) = \frac{\lambda}{n}$. We get a better estimation of $\lambda$ with $n = 400$ since it has a lower $var(\bar{X})$. \end{enumerate} \item \begin{enumerate} \item From the pdf we have \begin{align*} 1 &= \int_0^1 1/2 dx + \int_1^2 1/3 dx + \int_2^3 c dx\\ &= 1/2 + 1/3 + c\\ 1/6 &= c. \end{align*} \item From the pdf we have \begin{align*} P(1/2 < X < 5/2) &= \int_{1/2}^1 1/2 dx + \int_1^2 1/3 dx + \int_2^{5/2} 1/6 dx\\ &= x/2 \Big|_{1/2}^1 + x/3 \Big|_1^2 + x/6 \Big|_2^{5/2} \\ &= 1/4 + 1/3 + 1/12 = 8/12 = 2/3. \end{align*} \end{enumerate} \item \begin{enumerate} \item \begin{align*} 1 &= \int_{-1}^1 c(1-x^2) dx\\ &= cx - \frac{x^3}{3} \Big|_{-1}^1 \\ &= (c - \frac{1}{3}) - (-c - \frac{-1}{3})\\ &= (c - \frac{1}{3}) + (c - \frac{1}{3})\\ &= 2c - \frac{2}{3})\\ \frac{5}{3})&= 2c\\ \frac{5}{6})&= c. \end{align*} \item \begin{align*} P(-1/2 < X < 1/2) &= \int_{-1/2}^{1/2} 5/6(1-x^2) dx\\ &= 5/6\Big\[x - \frac{x^3}{3}\Big\]_{-1/2}^{1/2} \\ &= x/2 \Big|_{1/2}^1 + x/3 \Big|_1^2 + x/6 \Big|_2^{5/2} \\ &= 1/4 + 1/3 + 1/12 = 8/12 = 2/3. \end{align*} \end{enumerate} \end{enumerate} \end{document}