Bayes' rule

From CS2800 wiki

Bayes' rule (also called Bayes' law or Bayes' identity) is a simple equation relating [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A) [/math] and [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(A \href{/cs2800/wiki/index.php/%5Cmid}{\mid} B) [/math]:

[math]\href{/cs2800/wiki/index.php/Pr}{Pr}(A \href{/cs2800/wiki/index.php/%5Cmid}{\mid} B) = \frac{\href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A) \href{/cs2800/wiki/index.php/Pr}{Pr}(A)}{\href{/cs2800/wiki/index.php/Pr}{Pr}(B)} [/math]
Proof:
By definition, [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(A \href{/cs2800/wiki/index.php/%5Cmid}{\mid} B) = \href{/cs2800/wiki/index.php/Pr}{Pr}(A \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} B) / \href{/cs2800/wiki/index.php/Pr}{Pr}(B) [/math] and [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A) = \href{/cs2800/wiki/index.php/Pr}{Pr}(A \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} B) / \href{/cs2800/wiki/index.php/Pr}{Pr}(A) [/math]. Multiplying by the denominators gives [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(A \href{/cs2800/wiki/index.php/%5Cmid}{\mid} B) \href{/cs2800/wiki/index.php/Pr}{Pr}(B) = \href{/cs2800/wiki/index.php/Pr}{Pr}(A \href{/cs2800/wiki/index.php/%E2%88%A9}{∩} B) = \href{/cs2800/wiki/index.php/Pr}{Pr}(B \href{/cs2800/wiki/index.php/%5Cmid}{\mid} A)\href{/cs2800/wiki/index.php/Pr}{Pr}(A) [/math]. Dividing by [math]\href{/cs2800/wiki/index.php/Pr}{Pr}(B) [/math] gives the result.