# Questions

## Housing Day

Suppose Harvard College is conducting its housing lottery. For simplicity's sake, we'll say that there are 1200 Freshmen that will be randomly assigned to 12 houses. Let $$X\_1, X\_2, \ldots, X\_{12}$$ count how many students are place in Pforzheimer ($$X\_1$$), all the way to Eliot ($$X\_{12}$$) (organized by best house to worst).

{% tabs %}
{% tab title="Q" %}
Are $$X\_1$$ and $$X\_2$$ independent?
{% endtab %}

{% tab title="A" %}
No they are not. Since the number of Freshmen is constrained to 1200, knowing that a lot of people got into one house decreases the number of people that could be in the remaining houses.
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Q" %}
What is the joint distribution of $$X\_1, X\_2, \ldots, X\_{12}$$?
{% endtab %}

{% tab title="A" %}
By the story of the Multinomial distribution, $$(X\_1, X\_2, \ldots, X\_{12}) \sim Mult\_{12}\left({1200, \left({1/12, \dots, 1/12}\right)}\right)$$
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Q" %}
What is the marginal distribution of $$X\_1$$, the number of students who are placed into Pforzheimer House, and the joint distribution of $$X\_1$$ and $$1200 - X\_1$$?
{% endtab %}

{% tab title="A" %}
In this case, we can group together bins that are not in Pforzheimer House together. We have $$X\_1 \sim Bin\left({1200, 1/12}\right)$$ $$(X\_1, 1200 - X\_1) \sim Mult\_2\left({1200, (1/12, 11/12)}\right)$$
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Q" %}
What is the conditional distribution of $$X\_1$$ given $$X\_{10} + X\_{11} + X\_{12} = 450$$?
{% endtab %}

{% tab title="A" %}
$$X\_1 | X\_{10} + X\_{11} + X\_{12} = 450 \sim Bin\left({750, 1/9}\right)$$
{% endtab %}
{% endtabs %}

## Jelly Beans

I have a jar of 30 jellybeans: 10 red, 8 green, 12 blue. I draw a sample of 12 jellybeans without replacement. Let $$X$$ be the number of red jellybeans in the sample, $$Y$$ the number of green jellybeans.

{% tabs %}
{% tab title="Q" %}
Find $$Cov(X, Y)$$.
{% endtab %}

{% tab title="A" %}
Let $$X = I\_1 + \ldots + I\_{12}$$, and $$Y = J\_1 + \ldots + J\_{12}$$, where

$$$
\begin{aligned}
I\_i &= \begin{cases}
1 & \textrm{if $$i$$th jellybean in sample is red} \\
0 & \textrm{otherwise}
\end{cases} \\
J\_i &= \begin{cases}
1 & \textrm{if $$i$$th jellybean in sample is green} \\
0 & \textrm{otherwise}
\end{cases}\end{aligned}
$$$

We can now solve using indicator variables and the fundamental bridge.

$$
\begin{aligned}
Cov\left({I\_1, J\_1}\right) &= E\left({I\_1 J\_1}\right) - E\left({I\_1}\right) E\left({J\_1}\right) \\
&= 0 - \left({\frac{10}{30}}\right)\left({\frac{8}{30}}\right) \\
Cov\left({I\_1, J\_2}\right) &= E\left({I\_1 J\_2}\right) - E\left({I\_1}\right) E\left({J\_2}\right) \\
&= \left({\frac{10}{30}}\right)\left({\frac{8}{29}}\right) - \left({\frac{10}{30}}\right)\left({\frac{8}{30}}\right) \\
Cov\left({X, Y}\right) &= \sum\_{i=1}^{12} Cov\left({I\_i, J\_i}\right) + 2 \sum\_{i < j} Cov\left({I\_i, J\_j}\right) \\
&= \sum\_{i=1}^{12} Cov\left({I\_1, J\_1}\right) + 2 \binom{12}{2} Cov\left({I\_1, J\_2}\right) \\
&= 12 \cdot Cov\left({I\_1, J\_1}\right) + 12 \cdot 11 \cdot Cov\left({I\_1, J\_2}\right) \\
&= - \frac{96}{145}\end{aligned}
$$

It's good to do a little sanity check at the end: it makes sense that the covariance is negative. If the sample contains a lot of red jellybeans, the sample probably has fewer green jellybeans. Another way to solve this is to create an indicator for each red jellybean and each green jellybean in the jar, where the indicator equals 1 if the jellybean is in the sample and 0 otherwise.
{% endtab %}
{% endtabs %}

## Stat Courses

Let $$X$$ be the number of statistics majors in a certain college in the class of 2030, viewed as an r.v. Each statistics major chooses between two tracks: a general track in statistical principles, and a track in quant finance. Suppose that each statistics major chooses randomly which of these two tracks to follow, independently, with probability $$p$$ of choosing the general track. Let $$Y$$ be the number of statistics majors who choose the general track, and $$Z$$ be the number of statistics majors who choose the quantitative finance track.

{% tabs %}
{% tab title="Q" %}
Suppose that $$X \sim \text{Pois}(\lambda)$$. Find the correlation between $$X$$ and $$Y$$.
{% endtab %}

{% tab title="A" %}
By the chicken-egg story, we know that $$Y$$ and $$Z$$ are independent Poisson random variables, with rate parameters $$\lambda p$$ and $$\lambda q$$, respectively. We must first find the covariance between $$X$$ and $$Y$$.

$$
Cov(X,Y) = Cov(Y+Z, Y) = Var(Y) + Cov(Y,Z) = \lambda p
$$

We now plug this into the equation for correlation:

$$
Corr(X,Y)  =\frac{Cov(X,Y)}{\sqrt{Var(X)Var(Y)}} = \frac{\lambda p}{\sqrt{\lambda \lambda p}} = \sqrt{p}
$$
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Q" %}
Let $$n$$ be the size of the Class of 2030, where $$n$$ is a known constant. For this part and the next, instead of assuming that $$X$$ is Poisson, assume that each of the $$n$$ students chooses to be a statistics major with probability $$r$$, independently. Find the joint distributions of $$Y$$, $$Z$$, and the number of non-statistics majors, and their marginal distributions.
{% endtab %}

{% tab title="A" %}
Under this new model, we have that $$X\sim \text{Bin}(n,r)$$. By the multiplication rule, we have that the probability of a student becoming a general Statistician is $$rp$$, a Goldman-Sachs Statistician is $$rq$$, and a non-Statstician (lame) is $$1-r$$. Therefore, we can apply the story of the Multinomial here: $$(Y, Z, n-X) \sim Mult\_3(n, (rp, rq, 1-r))$$
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Q" %}
Continuing as in the previous part, find the correlation between $$X$$ and $$Y$$.
{% endtab %}

{% tab title="A" %}
We use the fact that covariance of the marginal distributions in a multinomial is given by $$-np\_i p\_j$$.

$$
\begin{aligned}
Cov(X,Y) &= Cov(Y+Z, Y)\\
&= Var(Y) + Cov(Z,Y) \\
&= nrp(1-rp) - n(rp)(rq)\\
&=npr(1-r)
\end{aligned}
$$
{% endtab %}
{% endtabs %}
