Let $X_{1},X_{2},X_{3}....X_{n}$ be independent and identically distributed random variables with continuous density symmetric around 0.
Also suppose $\mathbb{E}(|X_{1}|)$=2.
Define two variables Y and Z as
$Y=\sum_{i=1}^{n}X_{i}$ and $Z=\sum_{i=1}^{n}$1$_{X_{i}>0}$
We are asked to find the covariance between Y and Z.
My approach:
As $X_{i} $ has symmetric density around 0, $\mathbb{P}(X_{i}>0)=\frac{1}{2}$ and because Z is an indicator function for each $X_{i}$ being greater than 0, Z $\sim$ Bin(n,$\frac{1}{2}$).
Because $\mathbb{E}(|X_{i}|)$=2, $\int_{0}^{\infty}xf_{x}(x) dx=1$ and $\int_{-\infty}^{0}xf_{x}(x) dx=-1$
Which means that expectations of $x$ given $x$ is positive or negative are 1 and -1 respectively.
Now $\mathrm{Cov}(Y,Z)=\mathbb{E}(YZ) - \mathbb{E}(Y)\mathbb{E}(Z)$, let’s call $W=f(Y,Z)=YZ$, using law of iterated expectations with a slight abuse of notation
$\mathbb{E}(W)=\mathbb{E}(\mathbb{E}(W|Z=r)$, where the first expectation on right is with respect to the marginal of Z and inner expectation is with respect to conditional distribution of W with for a given Z=r.
For the inner expectation, given a value of Z=r, the term in Z would have exactly $r$ $1$’s and $n-r$ $0$’s which would be multiplied with each $X_{i}$ term in Y so $W|(Z=r)=r(\sum_{i=1}^{n}X_{i})$ so that the inner expectation becomes $\mathbb{E}(W|Z=r)=r\mathbb{E}(\sum_{i=1}^{N}X_{i})$.
The expectation on right has exactly $r$ times $1$’s and $n-r$ times $-1$’s corresponding to $X_{i}$ being positive $r$ times with expectation of $1$ and negative $n-r$ times with expectation of $-1$.
So $\mathbb{E}(W|Z=r)=r(2r-n)=2r^{2}-rn$
Since Z$\sim$ Bin(n,$\frac{1}{2}$), $\mathbb{E}(Z)=\frac{n}{2}$, $\mathrm{Var}(Z)=\frac{n}{4}$ so $\mathbb{E}(Z^{2})=\frac{n}{4}+\frac{n^{2}}{4}=\frac{n(n+1)}{4}$
Hence the final expression becomes $\mathbb{E}(W)=2\mathbb{E}(r^{2})-n\mathbb{E}(r)=\frac{n^{2}+n}{2}-\frac{n^{2}}{2}=\frac{n}{2}$
And since $\mathbb{E}(Y)=0$ due to symmetric density around 0,
$\mathrm{Cov}(Y,Z)=\mathbb{E}(W)-\mathbb{E}(Y)\mathbb{E}(Z)=\frac{n}{2}$
Is the above approach correct for finding the covariance between Y and Z? Any suggestions/corrections will helpful