# Covariance of dependent random variables from a Poisson process

Question: Given a Poisson process $N(t),t≥0$ with rate $λ$, calculate the covariance of $N(2)$ and $N(3)$.

Attempt: So clearly $N(2) \sim Po(2\lambda)$ and $N(3) \sim Po(3\lambda)$. So, $\mathbb{E}(N(2))=2\lambda$ and $\mathbb{E}(N(3))=3\lambda$.

We know $Cov(N(2),N(3))=\mathbb{E}(N(2)N(3))-\mathbb{E}(N(2))\mathbb{E}(N(3))$

Now, I saw somewhere that $\mathbb{E}(N(2)N(3))=\mathbb{E}(N(2)\mathbb{E}(N(3)|N(2))$ but I can't quite seem to get to it nor see whether it's actually useful?

To "get to" the formula you mention, use the law of total expectation: $$\mathbb{E}[X \mid \mathcal{G}_1] = \mathbb{E}[\mathbb{E}[X \mid \mathcal{G}_2] \mid \mathcal{G}_1]$$ for any random variable $X$ and any $\sigma$-fields $\mathcal{G}_1 \subseteq \mathcal{G}_2$. Apply this to $X=N(2)N(3)$ and $\mathcal{G}_1 = \sigma(N(2))$, $\mathcal{G}_2 = \mathcal{F}$ (the original $\sigma$-field for the space).
Let$\ (0<s<t<\infty)$. Then, defintion of covariance yields $$(1)\ \ \ \ cov(N_s,N_t) = E[(N_s)-E[N_s]) (N_t-E[N_t])]$$ For a Poisson process, $E[N_t]=\lambda t$, and $E[N_s]=\lambda s$ $$(2)\ \ \ cov(N_s,N_t) = E[(N_s-s\lambda)(N_t-t\lambda)]=E[N_sN_t]-s\lambda E[N_t]-t\lambda E[N_s]+st\lambda ^2=E[N_sN_t]-st\lambda ^2$$
Then, $$(3)\ \ \ \ E[N_sN_t] = E[(N_t-N_s)(N_s-N_0)]+E[N_s^2]\ \ \ \ (since \ N_0=0)$$ Since $(0,s)$ and $(s,t)$ are disjoint and therefore independent $$(4)\ \ \ \ E[N_sN_t] = E[(N_t-N_s)]E[(N_s-N_0)]+E[N_s^2]=\lambda ^2(t-s)s+E[N_s^2]=st\lambda ^2-s^2\lambda^2+E[N_s^2]$$ Subsititute the result of (4) into the result of (3) $$(5)\ \ \ \ cov(N_s,N_t)=-s^2\lambda^2+E[N_s^2]$$ Now, $E[X^2]=var(X)+E[X]^2$ for any random variable $X$ $$(6)\ \ \ cov(N_s,N_t)=-s^2\lambda ^2+var(N_s)+E[N_s]^2=-s^2\lambda^2 +s\lambda +s^2\lambda^2 = \lambda s$$  You can see that if we had defined $t<s$, the two would switch in step (3), and we would end up with $cov(N_s,N_t) = \lambda t$. So, we can say that the covariance function of a Poisson process in general is $$R_N(s,t)=cov(N_s,N_t)=\lambda min\{s,t\}$$ So, I do think the answer to this question is $cov(N_2,N_3)=2\lambda$.
Hint: Write ${\rm E}[N(3)N(2)]$ as $${\rm E}[(N(3)-N(2))N(2)]+{\rm E}[N(2)^2]$$ and use that $(N(t))_{t\geq 0}$ has independent increments.