Suppose $X_i$, i=1...N, are not-independent random variables identically distributed. Then, take $N_1$ to be a random variable in the interval $[0,N]$. I now define the "composite" random variables $$ Y(N_1) = \sum_{i=1}^{N_1} X_i \qquad Z(N-N_1) = \sum_{i=N_1+1}^{N} X_i \;, $$ and I want to calculate $$ \text{Cov}[Y(N_1),Z(N-N_1)] = ... $$
I'm interested in obtaining an expression involving moments of the distributions for $X$ and $N$.
My attempt was to say $$ \text{Cov}[Y(N_1),Z(N-N_1)] = \mathbb{E}[ \sum_{i=1}^{N_1}\sum_{j=N_1+1}^{N} \text{Cov}[X_i,X_j] ] \\ = \mathbb{E}[ N_1(N-N_1) \text{Cov}[X_i,X_j] ] \\ = (N\langle N_1\rangle-\langle N_1^2\rangle) \text{Cov}[X_i,X_j] $$
which is WRONG!
Where is the mistake?