Bayes' Theorem, also known as Bayes' Rule, is used in statistics and probability theory to relate marginal probabilities and conditional probabilities. In the context of Bayesian probability theory, it is used to update degrees of belief (probabilities) given new information.
Bayes' theorem is stated mathematically as
where X and Y are independent statements, I is available background information, and
P(X | Y,I) is the posterior probability for X given Y and I,
P(Y | X,I) is the likelihood for Y given X and I,
P(X | I) is the prior probability for X given only I, and
P(Y | I) is sometimes called the evidence or probability for Y given only I.