## What is the 'Bayes' Theorem'

Bayes' theorem,Â named after 18th-century British mathematician Thomas Bayes, is a mathematical formula for determining conditional probability. The theorem provides a way to revise existing predictions or theories given new or additional evidence. In finance, Bayes' theorem can be used to rate the risk of lending money to potential borrowers.

The formula is as follows:

Bayes' theorem is also called Bayes' Rule or Bayes' Law.

## BREAKING DOWN 'Bayes' Theorem'

Applications of the theorem are widespread and not limited to the financial realm. As an example, Bayes' theorem can be used to determine the accuracy of medical test results by taking into consideration how likely any given person is to have a disease and the general accuracy of the test.

Bayes' theorem gives the probability of an event based on information that is or may be related to that event. The formula can be used to see how the probability of an event occurring is affected by new information, supposing the new information is true. For example, say a single card is drawn from a complete deck of 52 cards. The probability that the card is a king is 4 divided by 52, which equals 1/13 or approximately 7.69%. Remember that there are 4 kings in the deck. Now, suppose it is revealed that the selected card is a face card. The probability the selected card is a king, given it is a face card, is 4 divided by 12, or approximately 33.3% (there are 12 face cards in a deck).

## Deriving Bayes' Theorem Formula

Bayes' Theorem follows simply from the axioms of conditional probability. Conditional probability is the probability of an event given that another event occurred. For example, a simple probability question may be "What is the probability of AMZN stock price falling?" Conditional probability takes this question a step further by asking "What is the probability of AMZN stock price falling given that the DJIA index fell earlier?"

The conditional probability of A given that B has happened can be expressed as:

P(A|B) = P(A and B) / P(B) = P(Aâˆ©B) / P(B)

If A is AMZN price falls and B is DJIA is already down, then the conditional probability expression reads as "the probability that AMZN drops given a DJIA decline is equal to the probability that AMZN price declines and DJIA declines over the probability of a decrease in the DJIA index.

P(Aâˆ©B) is the probability of bothÂ A andÂ B occurring. This also the same as the probability ofÂ A occurring times the probability thatÂ B occurs given that A occurred, expressed as P(A) x P(B|A). Using the same reasoning,Â P(Aâˆ©B) is also the probability thatÂ B occurs times the probability thatÂ A occurs given thatÂ B occurs, expressed as P(B) x P(A|B). The fact that these two expressions are equal leads to Bayes' Theorem, which is written as:

if, P(Aâˆ©B) = P(A) x P(B|A) = P(B) x P(A|B)

then, **P(A|B) = [P(A) x P(B|A)] / P(B)**.

Where P(A) and P(B) are the probabilities of A and B without regard to each other.

P(B|A) is the probability that B will occur given A is true.

Finally, P(A|B) is the conditional probability of A occurring given B is true.

The formula explains the relationship between the probability of the hypothesis before getting the evidence P(A) and the probability of the hypothesis after getting the evidence P(A|B), given a hypothesis A and evidence B.

As another example, imagine there is a drug test that is 98% accurate, meaning 98% of the time it shows a true positive result for someone using the drug and 98% of the time it shows a true negative result for nonusers of the drug. Next, assume 0.5% of people use the drug. If a person selected at random tests positive for the drug, the following calculation can be made to see whether the probability the person is actually a user of the drug.

(0.98 x 0.005) / [(0.98 x 0.005) + ((1 - 0.98) x (1 - 0.005))] = 0.0049 / (0.0049 + 0.0199) = 19.76%

Bayes' theorem shows that even if a person tested positive in this scenario, it is actually much more likely the person is not a user of the drug.