I saw an equation as like that:
$$P(W) = P(W\mid R,S)+P(W\mid !R,S) + P(W\mid !R,S) + P(W\mid R,!S) + P(W\mid !R,!S)$$
Which of these two statements are true?
$$P(W) = P(W\mid R,S)P(R,S)+P(W\mid !R,S)\,P(!R,S) + P(W\mid !R,S)\,P(!R,S) + P(W\mid R,!S)\,P(R,!S) + P(W\,!R,!S)\,P(!R,!S)$$ or $$P(R,S) = P(R\mid S)\,P(S) = P(S\mid R)\,P(R).$$
Is there any document for it?