I am given this question in my statistics course:
Let $A$ and $B$ be $2$ events such that $A\cup B = \Omega$. Prove that $ P(A\cap B)= P(A) P(B) - P(\bar{A} )P(\bar{B})$
Hint: Define the following two random variables and use covariance.
$\qquad\qquad\qquad X = \begin{cases} 1 & \text{if $A$ occurs} \\ 0 & \text{otherwise} \end{cases} \qquad\qquad Y = \begin{cases} 1 & \text{if $B$ occurs} \\ 0 & \text{otherwise} \end{cases} $
$\,$
I was able to prove it using this method:
$RHS =P(A)P(B) - (1-P(A))(1-P(B))$
$\space = P(A)P(B) - ( 1-P(B)-P(A)+ P(A)P(B))$
$\space = P(A) + P(B) - 1$
$\space= P(A) + P(B) - (P(A) + P(B) - P(A\cap B))$
$\space= LHS$
I was not, however, able to prove it using the hint (or covariance).
Any help would be much appreciated. Thank you!