# Bivariate random variable problem

#### Yankel

##### New Member
Hello

I am trying to solve this problem:

A coin is given with probability 1/3 for head (H) and 2/3 for tail (T).
The coin is being drawn N times, where N is a Poisson random variable with E(N)=1. The drawing of the coin and N are independent. Let X be the number of heads (H) in the N draws. What is the correlation coefficient of X and N ?

So I started this by creating a table as if it was a finite problem, just to see how it behaves, but it didn't lead me too far. Since there is independence, every event P(X=x , N=n) is equal to P(X=x|N=n)*P(N=n). So this is like a tree diagram sample space. In order to find the correlation, I need the covariance and the variances. The variance of N, it's easy, 1. How do I find the rest of the stuff ?

Thanks !

#### BGM

##### TS Contributor
Firstly note that $X$ has a compound distribution, i.e. it can be expressed as

$X = \sum_{i=1}^N Z_i$

with the convention that $X = 0$ when $N = 0$

$Z_i$ are i.i.d. $\text{Bernoulli}\left(\frac {1} {3} \right)$ and independent of $N \sim \text{Poisson}(1)$

Next you can use Law of total variance and covariance to help you.

http://en.wikipedia.org/wiki/Law_of_total_variance
http://en.wikipedia.org/wiki/Law_of_total_covariance

Let's try first. (You will need to know some basic facts/properties.)