Bays Theorem
Bays Theorem
Bayes' Theorem
The Theorem
Bayes' Theorem for mutually exclusive events
Example
If E1, E2, ... , Ek are mutually exclusive events forming partitions of the
sample space S and if E is any event of S such that P(E) ≠ 0, then
EXAMPLE 1
Of all the smokers in a particular district, 40% prefer brand A and 60%
prefer brand B. Of those smokers who prefer brand A, 30% are
females, and of those who prefer brand B, 40% are female. What is
the probability that a randomly selected smoker prefers brand A, given
that the person selected is a female?
Answer
EXAMPLE 2
If somebody secretly cut the cards and drew out a marble and then
announced to us a red marble had in fact been drawn, could we
compute the probability of the cut being, say, a heart (or more
generally, can we compute the probability of a specified prior event
given that the subsequent event did occur)?
Answer
Part of the challenge in applying Bayes' theorem involves recognizing the types of problems that
warrant its use. You should consider Bayes' theorem when the following conditions exist.
The sample space is partitioned into a set of mutually exclusive events { A1, A2, . . . ,
An }.
Within the sample space, there exists an event B, for which P(B) > 0.
The analytical goal is to compute a conditional probability of the form: P( Ak | B ).
You know at least one of the two sets of probabilities described below.
o P( Ak ∩ B ) for each Ak
o P( Ak ) and P( B | Ak ) for each Ak
Use the Bayes Rule Calculator to compute conditional probability, when Bayes' theorem can be
applied. The calculator is free, and it is easy to use. It can be found under the Stat Tools tab,
which appears in the header of every Stat Trek web page.
Sample Problem
Bayes' theorem can be best understood through an example. This section presents an example
that demonstrates how Bayes' theorem can be applied effectively to solve statistical problems.
Example 1
Marie is getting married tomorrow, at an outdoor ceremony in the desert. In recent years, it has
rained only 5 days each year. Unfortunately, the weatherman has predicted rain for tomorrow.
When it actually rains, the weatherman correctly forecasts rain 90% of the time. When it doesn't
rain, he incorrectly forecasts rain 10% of the time. What is the probability that it will rain on the
day of Marie's wedding?
Solution: The sample space is defined by two mutually-exclusive events - it rains or it does not
rain. Additionally, a third event occurs when the weatherman predicts rain. Notation for these
events appears below.
We want to know P( A1 | B ), the probability it will rain on the day of Marie's wedding, given a
forecast for rain by the weatherman. The answer can be determined from Bayes' theorem, as
shown below.
P( A1 ) P( B | A1 )
P( A1 | B ) =
P( A1 ) P( B | A1 ) + P( A2 ) P( B | A2 )
P( A1 | B ) = 0.111
Note the somewhat unintuitive result. Even when the weatherman predicts rain, it only rains only
about 11% of the time. Despite the weatherman's gloomy prediction, there is a good chance that
Marie will not get rained on at her wedding.