Finding a Correlation between Bernoulli Variables? Let X and Y be Bernoulli random variables. We don't assume independence or identical distribution, but we do assume that all 4 of the following probabilities are nonzero. 
Let a := P[X = 1, Y = 1], b := P[X = 1, Y = 0], c := P[X = 0, Y = 1],
and d := P[X = 0, Y = 0].
How do I obtain a formula for a correlation between random variables X and Y?

Stefan Hansen's hint is a good one. Here is the complete derivation:
$${\rm E}[X]=a+b=p$$
$${\rm E}[Y]=a+c=q$$
\begin{align}
\mathrm{Var}(X) & ={\rm E}[(X - {\rm E}[X])^2] \\
& = {\rm E}[(X - p)^2] \\
&= p(1-p)^2 + (1-p)(-p)^2 \\
& = p (1-2p+p^2) + p^2 - p^3 \\
& = p - 2p^2 + p^3+p^2-p^3 \\
& = p - p^2 \\
& = p(1-p) 
\end{align}
$$\sigma{_X}  =\sqrt{\mathrm{Var}(X)} = \sqrt{p(1-p)} = \sqrt{(a+b)(1-(a+b))}$$
$$\sigma{_Y}  =\sqrt{\mathrm{Var}(Y)} = \sqrt{q(1-q)} = \sqrt{(a+c)(1-(a+c))}$$
\begin{align}
\mathrm{Cov}(X, Y) &= \rm{E}[XY] - \rm{E}[X]\rm{E}[Y] \\
&=a - pq \\
&=a - (a+b)(a+c) \\
\end{align}
Finally, by substitution into the equation for $\rho_{XY}$:
\begin{align}
\rho_{XY}&=\frac{\mathrm{Cov}(X,Y)}{\sigma_{X}\sigma_{Y}} \\
&=\frac{a - (a+b)(a+c)}{\sqrt{(a+b)(1-(a+b))}\sqrt{(a+c)(1-(a+c))}} \\
&=\frac{a - (a+b)(a+c)}{\sqrt{(a+b)(1-(a+b))(a+c)(1-(a+c))}}
\end{align}
