Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

BAYE’S

THEOREM
MARIA IMRAN
IMAAN MUFTI
WHAT IS BAYES
THEOREM?
“In probability theory and
statistics, bayes theorem
describes the probability of an
event, based on conditions that
might be related to the event.”

2
• Bayes' Theorem was named after
18th-century mathematician
Thomas Bayes.
• Bayes' Theorem allows you to
update the predicted
probabilities of an event by
incorporating new information.
• The theorem has become a
useful element in the
implementation of machine
learning.

3
CONDITIONAL PROBABILITY
The conditional probability of A given B, is the probability that event A occurs,
provided that event B has already occurred.

FORMULAS:
• P(A|B)= P(A∩B)
P(B)
• P(B|A)= P(B∩A)
P(A)

1
The probability
Of “B” being true
given that “A” is true The probability
Of “A” being true

P(A|B) = P(B|A) . P(A)


P(B)
The probability The probability
Of “A” being true given Of “B” being true
that “B” is true

5
If A1, A2,…,An is a partition of the sample space,

P(A|B) = P(B|A ) . P(A )


n
ΣP(B|A )P(A )
i=1

6
EXAMPLE

A bag 1 contains 4 white and 6


black balls while another Bag 2
contains 4 white and 3 black balls.
One ball is drawn at random from
one of the bags, and it is found to
be black.
Find the probability that the candy
was drawn from Bag 1 given that it
was black.

7
SOLUTION:
Let A1 be the event of choosing bag 1
A2 the event of choosing bag 2
And B be the event of drawing a black ball.
We have to find P(A1|B):
As there are only two bags , so P(A1) = P(A2) = ½
P(B|A1) = P(Ball is black | ball is picked from bag1) = 6/10 = 3/5
P(B|A2) = P(Ball is black | ball is picked from bag2) = 3/7
By putting the values in the formula of Bayes’ Theorem, we get
= (1/2)x(3/5)
(1/2)x(3/5) + (1/2)x(3/7)
= 7/12

8
APPLICATIONS OF BAYES THEOREM:
One of the applications of Bayes’ theorem is
“Bayesian Spam Filters”
• Identify the particular words
• False negative
• False positive
• Identify the probability of the event that an
email is spam, given that it contains those
specific words

9
IDENTIFYING SPAM E-MAILS USING
BAYES THEOREM:
P(S|E) = P(E|S) P(S)
P(E|S) P(S) + P(E|S) P(S)
P(S) = P(S) = ½
Hence, the probability that a e-mail is
spam, given that it contains the
particular word is:
P(S|E) = P(E|S)
P(E|S) + P(E|S)

10
THANK YOU!

You might also like