Bayes Theorem

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 3

Bayes Theorem

For two events A and B where B follows event A, event A can occur in A1,
A2… An mutually exclusive ways, and event b can occur in B1, B2…Bn
mutually exclusive ways then

P (A1/B1) = P(A1).P(B1/A1)

[P(A1).P(B1/A1) + P(A2).P(B1/A2) +….+P(An).P(B1/An)]

for any specific events A1 and B1

Notes; The given condition is reversed in the numerator.

When to use Bayes Theorem

1. The sample space is partitioned into a set of mutually exclusive


events [A1, A2.. ..An

2. Within the sample space there exists an event B, for which P(B)
>0

3. The analytical goal is to compute a conditional probability of


the form P(Ak/B)

4. You know P(Ak) and P(B/Ak) for each Ak

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.

Why use Bayes??

Two mutually exclusive events – it rains or it does not rain

A third event – the weatherman predicts rain

We have probabilities for each event

Solution

P(A1) = It rains on Marie’s wedding = 5/365 = 0.0136985 use 0.014

P(A2) = it doesn’t rain = 360/365 = 0.9863014 use 0.986


P(B/A1) = 0.9 (When it rains the weatherman predicts rain 90% of the
time)

P(B/A2) = 0.1 (When it doesn’t rain he predicts rain 10% of the time)

A (A1/B) = (0.014)(0.9)/ [(0.014)(0.09) + (0.986)(0.1) = 0.111

Therefore when the weatherman predicts rain, it actually rains only about
11% of the time.

Example 2

Of 100 people, 40 are conservative, 35 are Labour and 25 are Alliance


voters. Also the percentage of Conservative, Labour and Alliance voters
who read The Times are 50%, 40% and 80% respectively. If one of the 100
people is observed reading The Times what is the probability that he is (a)
a Conservative voter, (b) a Labour voter, (c) an Alliance voter?

Note: Three mutually exclusive events with another event, all with
probabilities – use Bayes!

Solution

A1 – Conservative voter = 0.4, A2 Labour = 0.35, A3 Alliance = 0.25, B


‘reads The Times’

(a) P(A1/B) = P(A1) P(B/A1)

P(A1) P(B/A1) + P(A2) P(B/A2) + P(A3) P(B/A3)

= (0.4)(0.5)/ (0.4 x 0.5) + (0.35 x 0.4) + (0.25 x .8) =


0.20/0.54 = 0.37

For the others the denominator remains the same (as with all Bayes
problems)

(b) P(A2/B) = (0.35 x 0.4)/0.54 = 0.259

(c) P(A3/B) = (0.25 x 0.8)/0.54 = 0.37

Note all three probabilities sum to 1

Example 3
A test set has a 98% probability of correctly classifying a faulty item as
defective and a 4% probability of classifying a good item as defective. If in
a batch of items tested 3% are actually defective, what is the probability
that when an item is classified as defective, it is truly defective?

Two mutually exclusive events – defective or not defective with a third


event correctly classifying, therefore use Bayes.

P(A1) - item is defective = 0.03

P(A2) – item is not defective = 0.97

P(B/A1) – classified defective and is defective = 0.98

P(B/A2) – classified defective and is not defective = 0.04

P(A1/B) = P(A1)P(B/A1)

P(A1)P(B/A1) + P(A2)P(B/A2)

= (0.3)(0.98)/(0.3 x0.98) + (0.97 x 0.04) = 0.43

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy