Bayes' theorem facts for kids
In probability theory and applications, Bayes' theorem shows the relation between a conditional probability and its reverse form. For example, the probability of a hypothesis given some observed pieces of evidence and the probability of that evidence given the hypothesis. This theorem is named after Thomas Bayes (how to say: /ˈbeɪz/ or "bays") and often called Bayes' law or Bayes' rule.
Formula
The equation used is:
Where:
 P(A) is the prior probability or marginal probability of A. It is "prior" in the sense that it does not take into account any information about B.
 P(AB) is the conditional probability of A, given B. It is also called the posterior probability because it is derived from or depends upon the specified value of B.
 P(BA) is the conditional probability of B given A. It is also called the likelihood.
 P(B) is the prior or marginal probability of B, and acts as a normalizing constant.
Example
A simple example is as follows: There is a 40% chance of it raining on Sunday. If it rains on Sunday, there is a 10% chance it will rain on Monday. If it didn't rain on Sunday, there's an 80% chance it will rain on Monday.
"Raining on Sunday" is event A, and "Raining on Monday" is event B.
 P(A) = 0.40 = Probability of Raining on Sunday.
 P(A`) = 0.60 = Probability of not raining on Sunday.
 P(BA) = 0.10 = Probability of it raining on Monday, if it rained on Sunday.
 P(B`A) = 0.90 = Probability of it not raining on Monday, if it rained on Sunday.
 P(BA`) = 0.80 = Probability of it raining on Monday, if it did not rain on Sunday.
 P(B`A`) = 0.20 = Probability of it not raining on Monday, if it did not rain on Sunday.
The first thing we'd normally calculate is the probability of it raining on Monday: This would be the sum of the probability of "Raining on Sunday and raining on Monday" and "Not raining on Sunday and raining on Monday"
 chance
However, what if we said: "It rained on Monday. What is the probability it rained on Sunday?" That is where Bayes' theorem comes in. It allows us to calculate the probability of an earlier event, given the result of a later event.
The equation used is:
In our case, "Raining on Sunday" is event A, and "Raining on Monday" is event B.
 P(BA) = 0.10 = Probability of it raining on Monday, if it rained on Sunday.
 P(A) = 0.40 = Probability of Raining on Sunday.
 P(B) = 0.52 = Probability of Raining on Monday.
So, to calculate the probability it rained on Sunday, given that it rained on Monday:
or:
In other words, if it rained on Monday, there's a 7.69% chance it rained on Sunday.
Intuitive explanation
To calculate the probability of it having rained on Sunday, given that it rained on Monday, we can take the following steps:
 We know that it rained on Monday. Therefore, the total probability is P(B).
 The probability it rained on Sunday is P(A).
 The probability it rained on Monday, given that it rained on Sunday is P(BA).
 The probability of raining on Sunday AND raining Monday is P(A)*P(BA).
 Therefore, the total probability of it having rained on Sunday, given that it rained on Monday, is the chance of it raining on Sunday and Monday divided by the total chance of it having rained on Monday.
Therefore,
Another way to see this, which shows where Bayes' theorem comes from, is to consider the probability P(AB) that it rains on both Sunday and Monday. This can be calculated in two different ways, which give the same answer for P(AB):
Bayes' theorem is just another way to write that equation.
Images for kids

A blue neon sign, showing the simple statement of Bayes’ theorem