It's just much simpler if you use the rules for variances and covariances that don't involve means . This is a Bayes rule problem. A is the event that an individual is HIV infected. B is the event that an individual tests positive. Note that then we have A c is the event that an individual is not HIV infected.
B c is the event that an individual tests negative.
From this we can calculate the other quantities needed for the formula The second line here is a bit tricky. To see it you must remember that a conditional probability is just an ordinary probabilty considered as a function of the variable in front of the bar with the variable behind the bar fixed . Thus the complement rule involves complementing the event in front of the bar . By definition, the c. d. The only remaining task is to find the functional form of F on the support.