# Conditional Expectation of random sum of independent random variables (when $N$ and $X_i$ are dependent)

In this question, $Y=X_1+X_2+\dots+X_N$ where $X_1,X_2,\dots,N$ are jointly independent random variables, $X_1,X_2 ...$ identically distributed continuous random variables with finite expectation, and $N$ a discrete random variable with finite expectation.

It was shown that:

$E(Y) = E(N)E(X)$, and

$Var(Y) = E(N)Var(X) + Var(N)E(X)^2$

Here we assumed that $X_i$ and $N$ are independent. The question I have is what are the mean and variance of $Y$ if $X_i$ and $N$ are dependent\correlated?