Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Consider $n$ independent trials, each of which results in any of the outcomes $i$,$\ i=1,2,3$, with respective probabilities $p_1,p_2,p_3,\ p_1+p_2+p_3=1$. Let $N_i$ denote the number of trials that result in outcome $i$. How do I show that $Cov(N_1,N_2)=-np_1p_2$? Why is it intuitive that the covariance is negative?

Currently, I have the following.

For $i=1,...,n$ let

$$X_i = \begin{cases} 1 & \text{if trial} \ i \text{ results in outcome 1} \\ 0 & \text{if trial } i \text{ does not result in outcome 1}\end{cases}$$

Similarly, for $j=1,...,n$, let

$$Y_j = \begin{cases} 1 & \text{if trial} \ j \text{ results in outcome 2} \\ 0 & \text{if trial } j \text{ does not result in outcome 2}\end{cases}$$

How do I argue the following?

$$N_1 = \sum_{i=1}^{n}X_i,\ N_2=\sum_{j=1}^{n}Y_j$$

How should I proceed using the properties of covariance from this point?

share|cite|improve this question
Why intuitive? Because if we know that $N_1$ is biggish, then there is an increased likelihood that $N_2$ is smallish, and vice-versa. – André Nicolas Sep 29 '12 at 6:06
The above was the intuition. – André Nicolas Sep 29 '12 at 6:12
up vote 2 down vote accepted

Why intuitive? Because if we know that $N_1$ is biggish, then there is an increased likelihood that $N_2$ is smallish, and vice-versa. They are negatively correlated.

To compute the covariance, note that $$E(N_1)=E(X_1+\cdots X_n)=E(X_1)+\cdots+E(X_n).$$ But $E(X_i)=p_1$, so $E(N_1)=np_1$. Similarly, $E(N_2)=np_2$.

Finally, we must find $E(N_1N_2)$. So we want $$E((X_1+X_2+\cdots+X_n)(Y_1+Y_2+\cdots +Y_n)).$$ Imagine expanding $$(X_1+X_2+\cdots+X_n)(Y_1+Y_2+\cdots +Y_n).$$ Lots of terms. Note first that for any $i$, $X_iY_i=0$, since $X_i$ and $Y_i$ cannot be $1$ at the same time. So we can forget about these, and our expanded product is a sum of terms of the shape $X_iY_j$ where $i\ne j$. But $X_i$ and $Y_j$ are independent, so $E(X_iY_j)=E(X_i)E(Y_j)=p_1p_2$.

Finally, how many terms are there of the form $X_iY_j$ with $i\ne j$? For every choice of $i$, there are $n-1$ possibilities for $j$, giving a total of $n(n-1)$.

We conclude that $E(N_1N_2)=n(n-1)p_1p_2$. Subtract $E(N_1)E(N_2)$, which is $n^2p_1p_2$.

Forgot: Why is $N_1=X_1+X_2+\cdots X_n$? Call the three possible outcomes $A$, $B$, and $C$. We have $X_i=1$ if $A$ happens, $X_i=0$ otherwise. So adding up the $X_i$ just means adding a $1$ whenever $A$ happens. Basically for $i=1$ to $n$ we are writing down a $1$ whenever $A$ happens. The number of these $1$'s, which is the sum of these $1$'s, is the number of times $A$ happened. This by definition is $N_1$.

share|cite|improve this answer

Intuitively, $N_2$ will more often be larger when $N_1$ is small than when $N_1$ is large (because there is more space for more type 2 outcomes when there are fewer type 1 outcomes) and this leads to a negative covariance.

I would calculate using $$Var(X_3) = Var(X_1+X_2) = Var(X_1)+2Cov(X_1,X_2)+Var(X_2)$$

$$np_3(1-p_3) = np_1(1-p_1)+2Cov(X_1,X_2)+np_2(1-p_2)$$

$$n(1-p_1-p_2)(p_1+p_2) = np_1(1-p_1)+2Cov(X_1,X_2)+np_2(1-p_2)$$

and expand and solve.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.