I am given that $X$ is a Bernoulli random variable. I am also given vector $Y$ where $Y_1 = X$ and other $Y_i$ are also in Bernoulli Distribution.
Then, I am given $Z = Y_1 + ... + Y_n$ and am asked to calculate covariance between $X$ and $Z$.
So it seems like they are not independent. $E[X] = p$ and $E[Z] = np$ so $Cov(X,Z) = E[XZ] - np^2$ but when I tried to expand this out, I eventually ended up getting $0$ so does that mean the random variables are actually independent from each other or am I making some math error there? How would I go about getting $E[XZ]$? Help would be appreciated. Thanks.
$$\begin{split}Cov(X,Z)&=Cov(X, X+Y_2+...+Y_n)\\ &=Cov(X,X)+Cov(X,Y_2)+...+Cov(X,Y_n)\\ &=Var(X)\\ &=p(1-p)\end{split}$$
$$\begin{split}Cov(X, Z)&=p(1-p)+n^2p^2+(n-1)*n^2p^2-n^3p^2\\ &=p(1-p)\end{split}$$