Bayes Theorem Calculator

Input










Formula and Output

\[P(A_1|B) = \frac{P(A_1)P(B | A_1)}{P(A_1)P(B|A_1)+P(A_2)P(B|A_2)}\]
\[P(A_1|B) = \frac{ 0.02739 \times 0.8 }{ 0.02739 \times 0.8 + 0.97261 \times 0.2 } = 0.1012\]

Example, Bayes Theorem

Sandra is getting married tomorrow with Mattias, at an outdoor ceremony. In recent years, it has snowed only 10 days each year. Unfortunately, the weatherboy has predicted snow for tomorrow. When it actually snows, the weatherboy correctly forecasts snow 80% of the time. When it doesn't snow, he incorrectly forecasts snow 20% of the time. What is the probability of snow on the day of Sandras wedding?

The probability of A1 means probability of snow on the wedding day,
P(A1) = 10/365 = 0.02739.

The probability A2 means probability of it not snowing on the wedding day, P(A2) = 1 - P(A1) = 0.97261.

The probability P(B|A1) means the probability of the weatherboy predicting snow correctly which is stated in the question as 0.8.

The probability P(B|A2) means the probability of the weatherboy predicted snow incorrectly which is 0.2 because whenever he is not correct he is wrong.