Section 3.8 of "Ian Goodfellow and Yoshua Bengio and Aaron Courville. Deep Learning" says
suppose we first sample a real number $x$ from a uniform distribution over the interval $[−1, 1]$. We next sample a random variable $s$. With probability $\frac{1}{2}$, we choose the value of $s$ to be $1$. Otherwise, we choose the value of $s$ to be $−1$. We can then generate a random variable $y$ by assigning $y = sx$. Clearly, $x$ and $y$ are not independent, because $x$ completely determines the magnitude of $y$. However, $Cov(x, y) = 0$.
how to derivate this?
$E[(x-E[x])(y-E[y])] = E[(x-E[x])(sx-E[sx])]$