A fair coin is flipped $30$ times. Let $X$ denote the number heads among the first $20$ coin flips and Y denote the number of heads among the last $20$ coin flips. Compute the correlation coefficient of $X$ and $Y$
I have set the indicator, $I_{i}$ as the $i^{th}$ pick being heads. Then... $$ X=I_{1}+...+I_{20}\\ Y=I_{10}+...+I_{30} $$ Which yields $$Cov(X,Y)=\sum_{j=1}^{20}\sum_{i=10}^{30}Cov(I_{i},I_{j})=2Cov(I_{i},I_{j})=2E[I_{1},I_{2}]-2E[I_{1}]E[I_{2}] $$ Since the events are exchangeable. But I am stuck with $$P(\text{First two flips are heads})-P(\text{First flip is heads})^2=0 $$ Which obviously isn't the case.
I will let $J_1 = I_1+\dots+I_{10},J_2 = I_{11}+\dots+I_{20},J_3 = I_{21}+\dots+I_{30}$. Then \begin{align*} \text{Corr}(X,Y) &= \frac{\text{Cov}(J_1+J_2,J_2+J_3)}{\text{SD}(X)\text{SD}(Y)}\\ & = \frac{\text{Cov}(J_1,J_2)+\text{Var}(J_2)+\text{Cov}(J_1,J_3)+\text{Cov}(J_2,J_3)}{\sqrt{20(1/4)\cdot 20(1/4)}}\tag{1}\\ &=\frac{10\cdot (1/4)}{20\cdot (1/4)}\\ &=\frac{1}{2} \end{align*} where in $(1)$ the covariances are zero since each block is disjoint and hence the number of heads in each block is independent.