\documentclass{article}
\input{18440-preamble}

\begin{document}
\pset{8}{Dan Ports}{2003/11/12}{drkp@mit.edu}

\begin{ppart}{Problem 1}
\paragraph{Part a}
The cumulative distribution function 
\begin{eqnarray*}
F_{XY}(a,b) &=& \iint \frac{1}{\pi} \set{S \st x \le a, y \le b}\\
            &=& \int_{-1}^{\min\set{a,1}}\int_{-\sqrt{1-a^2}}^{\min\set{b,\sqrt{1-a^2}}} \frac{1}{\pi}\;dy\;dx
\end{eqnarray*} assuming $a > -1$ and $b > -1$. 

By cases:

If $a \le -1$ or $b \le -1$, $F_{XY}(a,b) = 0$. If $-1 < a \le 1$ and $-1 < b \le \sqrt{1-a^2}$,
\[
F_{XY}(a,b) = \int_{-1}^{a}\int_{-\sqrt{1-x^2}}^b \frac{1}{\pi}\,dy\,dx = \frac{2\sin^{-1} a + 2 a \sqrt{1-a^2}+4ab+4b+\pi}{4\pi}
\]
If $-1 < a \le 1$ and $\sqrt{1-a^2} < b \le 1$,
\begin{eqnarray*}
F_{XY}(a,b) &=& \int_{-1}^{a}\int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}}\frac{1}{\pi}\;dy\;dx\\
&=&\frac{2\sin^{-1}a+2a\sqrt{1-a^2}+\pi}{2\pi}
\end{eqnarray*}
If $a > 1$ and $-1 \le b < 1$
\[
F_{XY}(a,b) = \int_{-1}^{1}\int_{-\sqrt{1-x^2}}^b \frac{1}{\pi}\,dy\,dx = \frac{4b+\pi}{2\pi}
\]
If $a > 1$ and $b > 1$, $F_{XY}(a,b) = 1$.

\paragraph{Part b}
Because the distribution is uniform over a disc of radius 1, $f_{XY}(a,b) = \frac{1}{\pi}$ if $a^2 + b^2 < 1$ and zero otherwise.
\paragraph{Part c}
The expected value is
\begin{eqnarray*}
\E{\abs{X}} &=& \iint_S \abs{X}\;dA \\
&=& \frac{1}{\pi} \int_0^{2\pi}\int_0^1 \abs{r \cos \theta} r \:dr\:d\theta \\
&=& \frac{4}{3\pi} \approx .4244
\end{eqnarray*}
\paragraph{Part d}
We expect $\E{\abs{X}}$ to be less than $\frac{1}{2}$ because the area with $\abs{X} < \frac{1}{2}$ is larger than the area with $\abs{X} > \frac{1}{2}$; they both have width 1, but the inner section has greater height.
\end{ppart}

\begin{ppart}{Problem 2}
\paragraph{Part a}
If both $i$ and $j$ are non-zero, $p_{XY}(i,j) = 0$ since this would require both girls and boys to be at the post office, and the bus only picks up one or the other.

For $i>0$, \[p_{XY}(i,0) = p e^{-\lambda_B} \frac{\lambda_B^i}{i!}\]
and similarly for $j>0$ \[p_{XY}(0,j) = (1-p) e^{-\lambda_G} \frac{\lambda_G^j}{j!}\]
since these are Poisson distributions with parameter $\lambda_B$ or $\lambda_G$ chosen with probability $p$ or $1-p$ respectively.
Finally, \[p_{XY}(0,0) = pe^{-\lambda_B} + (1-p)e^{-\lambda_G}\]

\paragraph{Part b}
The probability mass function $p_X(i)$ is defined by
$p_X(i) = \sum_j p_{XY}(i,j)$
For $i$ nonzero,
\[p_X(i) = p_{XY}(i,0) = p e^{-\lambda_B} \frac{\lambda_B^i}{i!}\]
and
\[p_X(0) = p_{XY}(0,0) + \sum_{j=1}^\infty p_{XY}(0,j) = pe^{-\lambda_B} + (1-p)\]
since the total probability that the girls are chosen is $1-p$.

Similarly,
\[p_Y(j) =
\begin{cases}
(1-p) e^{-\lambda_G} \frac{\lambda_G^j}{j!}\,\,& j>0\\
(1-p)e^{-\lambda_G} + p & j=0
\end{cases}
\]
\paragraph{Part c}
Let $A=\set{1}$ and $B=\set{1}$. Then $\Pr{X\in A \,\mathrm{and}\, Y\in B} = 0$ since $p_{XY}(1,1) = 0$. Also, $\Pr{X\in A} = p_X(1) = p\lambda_B e^{-\lambda_B}$ and $\Pr{Y\in B} = p_Y(1) = (1-p)\lambda_G e^{-\lambda_G}$. The product of these is clearly nonzero. So $\Pr{X\in A\, \mathrm{and}\, Y\in B} = 0 \neq \Pr{X\in A}\, \Pr{Y\in B}$. Thus $X$ and $Y$ are not independent.
\paragraph{Part d}
The values of $X$ are given by its probability mass function $p_X$. Since for all non-zero values of $i$, $p_X(i)$ is identical to the probability mass function of a Poisson random variable with parameter $\lambda_B$ scaled by $p$, the expected value $\E{X}$ is simply obtained by scaling the expected value of the Poisson random variable accordingly:
\[\E{X} = p\lambda_B\]
and similarly
\[\E{Y} = (1-p)\lambda_G\]
By linearity of expectation
\[\E{X+Y} = \E{X}+\E{Y} = p\lambda_B + (1-p)\lambda_G\]
\paragraph{Part e}
For $m>0$, $X+Y$ can only equal $m$ if $X=m$ or $Y=m$; no other cases are possible. So 
\[
p_{X+Y}(m) = p_X(m) + p_Y(m) = p e^{-\lambda_B} \frac{\lambda_B^m}{m!} + (1-p) e^{-\lambda_G} \frac{\lambda_G^m}{m!}
\]
and if $m=0$
\[
p_{X+Y}(0) = p_{XY}(0,0) = pe^{-\lambda_B} + (1-p)e^{-\lambda_G}
\]
If $\lambda_B = \lambda_G = \lambda$ then the formula reduces to
\[p_{X+Y}(m) = \left[p+(1-p)\right] \left(e^{-\lambda} \frac{\lambda^m}{m!}\right) = e^{-\lambda} \frac{\lambda^m}{m!}\]
for $m\ge0$ (the $m=0$ case is also satisfied by this equation). This is the probability mass function of a Poisson distribution with parameter $\lambda$.
\paragraph{Part f}
The example differs from this problem in that, in the example, each of the day's customers can be a boy or girl, independent of the other. In this problem, all the customers on one day have the same gender. Since the total number of customers in each case is a Poisson random variable, and the proportions of each gender are the same, the expectations of $X$, $Y$, and $X+Y$ and the distributions of $X+Y$ are identical (assuming $\lambda_B = \lambda_G = \lambda$. But the distributions of $X$ and $Y$ are not independent in this problem.
\end{ppart}

\begin{ppart}{Problem 3}
\paragraph{Part a}
The probability of success of each trial in this experiment is $\frac{4}{3\pi}$. So if the trial is performed 1000 times, the expected number of successes is $\frac{4000}{3\pi}$. If $N$ successes are actually obtained, the value of $\pi$ is approximately $\frac{4000}{3N}$.
\paragraph{Part b}
The procedure performs 1000 trials with probability of success $p=\frac{4}{3\pi}$. We expect the number of successes to be given by a binomial distribution, so the variance is $1000 p(1-p) = 1000\frac{4}{3\pi}(1-\frac{4}{3\pi}) = \frac{4000(3\pi-4)}{9\pi^2} \approx 244.3$. So the standard deviation of $N$ is $\sigma \approx \sqrt{244.3} \approx 15.63$. The binomial distribution approximates the normal distribution for large $n$, so we can say with over 95\% confidence that $N$ will be within two standard deviations, or 31.26 of the expected value $\frac{4000}{3\pi}$ (using the area $\Phi$ under the standard normal distribution). So $N$ will probably be between $\frac{4000}{3\pi}-31.26 \approx 393.154$ and $\frac{4000}{3\pi}+31.26 \approx 455.673$. Thus the approximation for $\pi = \frac{4000}{3N}$ will be between $\frac{4000}{3 \; 393.154} \approx 2.926$ and $\frac{4000}{3 \; 455.673} \approx 3.391$, with just over 95\% confidence.
\paragraph{Part c}
Suppose we wish the error in the approximation to be not more than 0.0005, again with approximately 95\% ($2 \sigma$) confidence. Let $X_i$ be Bernoulli random variables representing each trial, and $Y = \frac{\sum_{i=1}^n X_i}{n}$. Then $\E{Y} = \frac{4}{3\pi}$, and $\Var Y = \frac{n}{n^2} = \frac{\frac{4}{3\pi}(1-\frac{4}{3\pi})}{n} \approx \frac{.2443}{n}$. So $\sigma_Y = \sqrt{\Var Y} \approx \sqrt{\frac{.2443}{n}} \approx \frac{.4943}{\sqrt{n}}$. Again, with over 95\% probability, the result will differ from the expected value by less than $2 \sigma = \frac{.9886}{\sqrt{n}}$. 

We want $3.1410 < \frac{4}{3Y} < 3.1420$, or equivalently $.424358 < Y < .42493$. Subtracting the mean $\frac{4}{3\pi}$, $-.000055 < Y-\mu_Y < .00008$. So we need the difference from the expected value, $2\sigma =  \frac{.9886}{\sqrt{n}}$ to be less than .000055. $n$ must be larger than $5.518 \times 10^8$.
\end{ppart}
\end{document}
