SlideShare a Scribd company logo
Dr. C.V. Suresh Babu
(CentreforKnowledgeTransfer)
institute
Introduction
• Bayes' theorem is also known as Bayes' rule, Bayes' law, or Bayesian
reasoning, which determines the probability of an event with
uncertain knowledge.
• In probability theory, it relates the conditional probability and
marginal probabilities of two random events.
• Bayes' theorem was named after the British mathematician Thomas
Bayes. The Bayesian inference is an application of Bayes' theorem,
which is fundamental to Bayesian statistics.
(CentreforKnowledgeTransfer)
institute
What is Bayes Theorem?
• Bayes Theorem is a method of calculating conditional probability.
• The traditional method of calculating conditional probability (the
probability that one event occurs given the occurrence of a different
event) is to use the conditional probability formula, calculating the
joint probability of event one and event two occurring at the same
time, and then dividing it by the probability of event two occurring.
• However, conditional probability can also be calculated in a slightly
different fashion by using Bayes Theorem.
(CentreforKnowledgeTransfer)
institute
• When calculating conditional probability with Bayes theorem, you use the
following steps:
• Determine the probability of condition B being true, assuming that condition
A is true.
• Determine the probability of event A being true.
• Multiply the two probabilities together.
• Divide by the probability of event B occurring.
• This means that the formula for Bayes Theorem could be expressed like this:
P(A|B) = P(B|A)*P(A) / P(B)
• Calculating the conditional probability like this is especially useful when the
reverse conditional probability can be easily calculated, or when calculating
the joint probability would be too challenging.
(CentreforKnowledgeTransfer)
institute
How?
• It is a way to calculate the value of P(B|A) with the knowledge of
P(A|B)
• Bayes' theorem allows updating the probability prediction of an event
by observing new information of the real world.
• Example: If cancer corresponds to one's age then by using Bayes'
theorem, we can determine the probability of cancer more accurately
with the help of age.
(CentreforKnowledgeTransfer)
institute
Bayes' theorem
• Bayes' theorem can be derived using product rule and conditional probability of
event A with known event B:
• As from product rule we can write:
• P(A ⋀ B)= P(A|B) P(B) or
• imilarly, the probability of event B with known event A:
• P(A ⋀ B)= P(B|A) P(A)
• Equating right hand side of both the equations, we will get:
• The above equation (a) is called as Bayes' rule or Bayes' theorem. This equation
is basic of most modern AI systems for probabilistic inference.
(CentreforKnowledgeTransfer)
institute
Bayes' rule
or
Bayes' theorem
(CentreforKnowledgeTransfer)
institute
• It shows the simple relationship between joint and conditional
probabilities. Here,
• P(A|B) is known as posterior, which we need to calculate, and it will be
read as Probability of hypothesis A when we have occurred an evidence B.
• P(B|A) is called the likelihood, in which we consider that hypothesis is true,
then we calculate the probability of evidence.
• P(A) is called the prior probability, probability of hypothesis before
considering the evidence
• P(B) is called marginal probability, pure probability of an evidence.
• In the equation (a), in general, we can write P (B) = P(A)*P(B|Ai), hence the
Bayes' rule can be written as:
• Where A1, A2, A3,........, An is a set of mutually exclusive and exhaustive
events.
(CentreforKnowledgeTransfer)
institute
Applying Bayes' rule:
• Bayes' rule allows us to compute the single term P(B|A) in terms of
P(A|B), P(B), and P(A).
• This is very useful in cases where we have a good probability of these
three terms and want to determine the fourth one.
• Suppose we want to perceive the effect of some unknown cause, and
want to compute that cause, then the Bayes' rule becomes:
(CentreforKnowledgeTransfer)
institute
Example #1
Question: what is the probability that a patient has diseases meningitis with a
stiff neck?
Given Data:
• A doctor is aware that disease meningitis causes a patient to have a stiff neck,
and it occurs 80% of the time.
• He is also aware of some more facts, which are given as follows:
• The Known probability that a patient has meningitis disease is 1/30,000.
• The Known probability that a patient has a stiff neck is 2%.
Let a be the proposition that patient has stiff neck and b be the proposition that
patient has meningitis. , so we can calculate the following as:
 P(a|b) = 0.8
 P(b) = 1/30000
 P(a)= .02
Hence, we can assume that 1 patient out of 750 patients has meningitis
disease with a stiff neck.
(CentreforKnowledgeTransfer)
institute
Example #2:
• Question: From a standard deck of playing cards, a single card is drawn. The probability
that the card is king is 4/52, then calculate posterior probability P(King|Face), which
means the drawn face card is a king card.
• Solution:
• P(king): probability that the card is King= 4/52= 1/13
• P(face): probability that a card is a face card= 3/13
• P(Face|King): probability of face card when we assume it is a king = 1
• Putting all values in equation (i) we will get:
(CentreforKnowledgeTransfer)
institute
• Imagine you are a financial analyst at an investment bank. According to your research of publicly-
traded companies, 60% of the companies that increased their share price by more than 5% in the
last three years replaced their CEOs during the period.
• At the same time, only 35% of the companies that did not increase their share price by more
than 5% in the same period replaced their CEOs. Knowing that the probability that the stock
prices grow by more than 5% is 4%, find the probability that the shares of a company that fires
its CEO will increase by more than 5%.
• Before finding the probabilities, you must first define the notation of the probabilities.
• P(A) – the probability that the stock price increases by 5%
• P(B) – the probability that the CEO is replaced
• P(A|B) – the probability of the stock price increases by 5% given that the CEO has been replaced
• P(B|A) – the probability of the CEO replacement given the stock price has increased by 5%.
• Using the Bayes’ theorem, we can find the required probability:
Example #3:
Thus, the probability that the shares of a company that replaces its CEO will grow by more
than 5% is 6.67%.
(CentreforKnowledgeTransfer)
institute
• Using the cancer diagnosis example, we can show that Bayes rule allows us to obtain a much
better estimate.
• Now, we will put some made-up numbers into the example so we can assess the difference that
Bayes rule made.
• Assume that the probability of having cancer is 0.05 — meaning that 5% of people have cancer.
• Now, assume that the probability of being a smoker is 0.10 — meaning that 10% of people are
smokers, and that 20% of people with cancer are smokers, so P(smoker|cancer) = 0.20.
• Initially, our probability for cancer is simply our prior, so 0.05.
• However, using new evidence, we can instead calculate P(cancer|smoke), which is equal to
(P(smoker|cancer) * P(cancer)) / P(smoker) = (0.20 * 0.05) / (0.10) = 0.10.
• By introducing new evidence, we therefore obtained a better probability estimation.
• Initially we had a probability of 0.05, but using the smoker evidence, we were able to get to a
more accurate probability that was double our prior.
• In the given example (even with our made-up numbers), this effect should be quite logical, since
we know that smoking causes cancer.
This therefore demonstrates how Bayes rule allows us to update our beliefs using relevant
information.
Example #4:
(CentreforKnowledgeTransfer)
institute
Applications of Bayes' theorem
• It is used to calculate the next step of the robot when the already
executed step is given.
• Bayes' theorem is helpful in weather forecasting.
• It can solve the Monty Hall problem.
(CentreforKnowledgeTransfer)
institute

More Related Content

What's hot

Conditional probability
Conditional probabilityConditional probability
Conditional probability
suncil0071
 
Point Estimation
Point EstimationPoint Estimation
Point Estimation
DataminingTools Inc
 
PROBABILITY AND IT'S TYPES WITH RULES
PROBABILITY AND IT'S TYPES WITH RULESPROBABILITY AND IT'S TYPES WITH RULES
PROBABILITY AND IT'S TYPES WITH RULESBhargavi Bhanu
 
Uniform Distribution
Uniform DistributionUniform Distribution
Uniform Distribution
mathscontent
 
Unit 1-probability
Unit 1-probabilityUnit 1-probability
Unit 1-probability
Rai University
 
Probability&Bayes theorem
Probability&Bayes theoremProbability&Bayes theorem
Probability&Bayes theorem
imran iqbal
 
Binomial distribution
Binomial distributionBinomial distribution
Binomial distribution
Sushmita R Gopinath
 
Probability Distributions
Probability DistributionsProbability Distributions
Probability Distributions
CIToolkit
 
Addition rule and multiplication rule
Addition rule and multiplication rule  Addition rule and multiplication rule
Addition rule and multiplication rule
Long Beach City College
 
Binomial distribution
Binomial distributionBinomial distribution
Binomial distribution
yatin bhardwaj
 
poisson distribution
poisson distributionpoisson distribution
poisson distribution
sangeeta saini
 
Testing of hypothesis - large sample test
Testing of hypothesis - large sample testTesting of hypothesis - large sample test
Testing of hypothesis - large sample test
Parag Shah
 
introduction to probability
introduction to probabilityintroduction to probability
introduction to probability
lovemucheca
 
Poisson distribution
Poisson distributionPoisson distribution
Poisson distribution
Anindya Jana
 
Testing of hypothesis
Testing of hypothesisTesting of hypothesis
Testing of hypothesisJags Jagdish
 
Properties of estimators (blue)
Properties of estimators (blue)Properties of estimators (blue)
Properties of estimators (blue)
Kshitiz Gupta
 
Maximum likelihood estimation
Maximum likelihood estimationMaximum likelihood estimation
Maximum likelihood estimation
zihad164
 
Simple linear regression
Simple linear regressionSimple linear regression
Simple linear regression
Avjinder (Avi) Kaler
 

What's hot (20)

Conditional probability
Conditional probabilityConditional probability
Conditional probability
 
Point Estimation
Point EstimationPoint Estimation
Point Estimation
 
PROBABILITY AND IT'S TYPES WITH RULES
PROBABILITY AND IT'S TYPES WITH RULESPROBABILITY AND IT'S TYPES WITH RULES
PROBABILITY AND IT'S TYPES WITH RULES
 
Uniform Distribution
Uniform DistributionUniform Distribution
Uniform Distribution
 
Unit 1-probability
Unit 1-probabilityUnit 1-probability
Unit 1-probability
 
Probability&Bayes theorem
Probability&Bayes theoremProbability&Bayes theorem
Probability&Bayes theorem
 
Binomial distribution
Binomial distributionBinomial distribution
Binomial distribution
 
Probability Distributions
Probability DistributionsProbability Distributions
Probability Distributions
 
Addition rule and multiplication rule
Addition rule and multiplication rule  Addition rule and multiplication rule
Addition rule and multiplication rule
 
Binomial distribution
Binomial distributionBinomial distribution
Binomial distribution
 
poisson distribution
poisson distributionpoisson distribution
poisson distribution
 
Correlation ppt...
Correlation ppt...Correlation ppt...
Correlation ppt...
 
Testing of hypothesis - large sample test
Testing of hypothesis - large sample testTesting of hypothesis - large sample test
Testing of hypothesis - large sample test
 
introduction to probability
introduction to probabilityintroduction to probability
introduction to probability
 
Probability concept and Probability distribution
Probability concept and Probability distributionProbability concept and Probability distribution
Probability concept and Probability distribution
 
Poisson distribution
Poisson distributionPoisson distribution
Poisson distribution
 
Testing of hypothesis
Testing of hypothesisTesting of hypothesis
Testing of hypothesis
 
Properties of estimators (blue)
Properties of estimators (blue)Properties of estimators (blue)
Properties of estimators (blue)
 
Maximum likelihood estimation
Maximum likelihood estimationMaximum likelihood estimation
Maximum likelihood estimation
 
Simple linear regression
Simple linear regressionSimple linear regression
Simple linear regression
 

Similar to Bayes' theorem

unit 3 -ML.pptx
unit 3 -ML.pptxunit 3 -ML.pptx
unit 3 -ML.pptx
Chitrachitrap
 
Bayesian Statistics.pdf
Bayesian Statistics.pdfBayesian Statistics.pdf
Bayesian Statistics.pdf
MuhammadAnas742878
 
Bayesian learning
Bayesian learningBayesian learning
Bayesian learning
Vignesh Saravanan
 
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Daniel Katz
 
2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx
ImpanaR2
 
Statistics in clinical and translational research common pitfalls
Statistics in clinical and translational research  common pitfallsStatistics in clinical and translational research  common pitfalls
Statistics in clinical and translational research common pitfalls
Pavlos Msaouel, MD, PhD
 
Artificial Intelligence Notes Unit 3
Artificial Intelligence Notes Unit 3Artificial Intelligence Notes Unit 3
Artificial Intelligence Notes Unit 3
DigiGurukul
 
Bayesian decision making in clinical research
Bayesian decision making in clinical researchBayesian decision making in clinical research
Bayesian decision making in clinical researchBhaswat Chakraborty
 
Bayes (1).pptx
Bayes (1).pptxBayes (1).pptx
Bayes (1).pptx
HarshitSingh334328
 
Burns And Bush Chapter 16
Burns And Bush Chapter 16Burns And Bush Chapter 16
Burns And Bush Chapter 16
Largest Catholic University
 
Bayesian statistics for biologists and ecologists
Bayesian statistics for biologists and ecologistsBayesian statistics for biologists and ecologists
Bayesian statistics for biologists and ecologists
Masahiro Ryo. Ph.D.
 
Lec13_Bayes.pptx
Lec13_Bayes.pptxLec13_Bayes.pptx
Lec13_Bayes.pptx
KhushiDuttVatsa
 
Chris Stuccio - Data science - Conversion Hotel 2015
Chris Stuccio - Data science - Conversion Hotel 2015Chris Stuccio - Data science - Conversion Hotel 2015
Chris Stuccio - Data science - Conversion Hotel 2015
Webanalisten .nl
 
presentation2-151215164213.pptx
presentation2-151215164213.pptxpresentation2-151215164213.pptx
presentation2-151215164213.pptx
RACHANAB18
 
Bayes theorem
Bayes theoremBayes theorem
Bayes theorem
Thuy An Dang
 
BayesTheorem.pdf
BayesTheorem.pdfBayesTheorem.pdf
BayesTheorem.pdf
ZiaulKRIM
 
HEART DISEASE PREDICTION USING NAIVE BAYES ALGORITHM
HEART DISEASE PREDICTION USING NAIVE BAYES ALGORITHMHEART DISEASE PREDICTION USING NAIVE BAYES ALGORITHM
HEART DISEASE PREDICTION USING NAIVE BAYES ALGORITHM
amiteshg
 
What should we expect from reproducibiliry
What should we expect from reproducibiliryWhat should we expect from reproducibiliry
What should we expect from reproducibiliry
Stephen Senn
 
Statistical tests
Statistical testsStatistical tests
Statistical tests
martyynyyte
 

Similar to Bayes' theorem (20)

unit 3 -ML.pptx
unit 3 -ML.pptxunit 3 -ML.pptx
unit 3 -ML.pptx
 
Bayesian Statistics.pdf
Bayesian Statistics.pdfBayesian Statistics.pdf
Bayesian Statistics.pdf
 
Bayesian learning
Bayesian learningBayesian learning
Bayesian learning
 
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
 
2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx
 
Statistics in clinical and translational research common pitfalls
Statistics in clinical and translational research  common pitfallsStatistics in clinical and translational research  common pitfalls
Statistics in clinical and translational research common pitfalls
 
Artificial Intelligence Notes Unit 3
Artificial Intelligence Notes Unit 3Artificial Intelligence Notes Unit 3
Artificial Intelligence Notes Unit 3
 
Bayesian decision making in clinical research
Bayesian decision making in clinical researchBayesian decision making in clinical research
Bayesian decision making in clinical research
 
Bayes (1).pptx
Bayes (1).pptxBayes (1).pptx
Bayes (1).pptx
 
Burns And Bush Chapter 16
Burns And Bush Chapter 16Burns And Bush Chapter 16
Burns And Bush Chapter 16
 
Bayesian statistics for biologists and ecologists
Bayesian statistics for biologists and ecologistsBayesian statistics for biologists and ecologists
Bayesian statistics for biologists and ecologists
 
Lec13_Bayes.pptx
Lec13_Bayes.pptxLec13_Bayes.pptx
Lec13_Bayes.pptx
 
Chris Stuccio - Data science - Conversion Hotel 2015
Chris Stuccio - Data science - Conversion Hotel 2015Chris Stuccio - Data science - Conversion Hotel 2015
Chris Stuccio - Data science - Conversion Hotel 2015
 
presentation2-151215164213.pptx
presentation2-151215164213.pptxpresentation2-151215164213.pptx
presentation2-151215164213.pptx
 
Bayes theorem
Bayes theoremBayes theorem
Bayes theorem
 
BayesTheorem.pdf
BayesTheorem.pdfBayesTheorem.pdf
BayesTheorem.pdf
 
Bayes
BayesBayes
Bayes
 
HEART DISEASE PREDICTION USING NAIVE BAYES ALGORITHM
HEART DISEASE PREDICTION USING NAIVE BAYES ALGORITHMHEART DISEASE PREDICTION USING NAIVE BAYES ALGORITHM
HEART DISEASE PREDICTION USING NAIVE BAYES ALGORITHM
 
What should we expect from reproducibiliry
What should we expect from reproducibiliryWhat should we expect from reproducibiliry
What should we expect from reproducibiliry
 
Statistical tests
Statistical testsStatistical tests
Statistical tests
 

More from Dr. C.V. Suresh Babu

Data analytics with R
Data analytics with RData analytics with R
Data analytics with R
Dr. C.V. Suresh Babu
 
Association rules
Association rulesAssociation rules
Association rules
Dr. C.V. Suresh Babu
 
Clustering
ClusteringClustering
Classification
ClassificationClassification
Classification
Dr. C.V. Suresh Babu
 
Blue property assumptions.
Blue property assumptions.Blue property assumptions.
Blue property assumptions.
Dr. C.V. Suresh Babu
 
Introduction to regression
Introduction to regressionIntroduction to regression
Introduction to regression
Dr. C.V. Suresh Babu
 
DART
DARTDART
Mycin
MycinMycin
Expert systems
Expert systemsExpert systems
Expert systems
Dr. C.V. Suresh Babu
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
Dr. C.V. Suresh Babu
 
Bayes network
Bayes networkBayes network
Bayes network
Dr. C.V. Suresh Babu
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agents
Dr. C.V. Suresh Babu
 
Rule based system
Rule based systemRule based system
Rule based system
Dr. C.V. Suresh Babu
 
Formal Logic in AI
Formal Logic in AIFormal Logic in AI
Formal Logic in AI
Dr. C.V. Suresh Babu
 
Production based system
Production based systemProduction based system
Production based system
Dr. C.V. Suresh Babu
 
Game playing in AI
Game playing in AIGame playing in AI
Game playing in AI
Dr. C.V. Suresh Babu
 
Diagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AIDiagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AI
Dr. C.V. Suresh Babu
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
Dr. C.V. Suresh Babu
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
Dr. C.V. Suresh Babu
 
A study on “the impact of data analytics in covid 19 health care system”
A study on “the impact of data analytics in covid 19 health care system”A study on “the impact of data analytics in covid 19 health care system”
A study on “the impact of data analytics in covid 19 health care system”
Dr. C.V. Suresh Babu
 

More from Dr. C.V. Suresh Babu (20)

Data analytics with R
Data analytics with RData analytics with R
Data analytics with R
 
Association rules
Association rulesAssociation rules
Association rules
 
Clustering
ClusteringClustering
Clustering
 
Classification
ClassificationClassification
Classification
 
Blue property assumptions.
Blue property assumptions.Blue property assumptions.
Blue property assumptions.
 
Introduction to regression
Introduction to regressionIntroduction to regression
Introduction to regression
 
DART
DARTDART
DART
 
Mycin
MycinMycin
Mycin
 
Expert systems
Expert systemsExpert systems
Expert systems
 
Dempster shafer theory
Dempster shafer theoryDempster shafer theory
Dempster shafer theory
 
Bayes network
Bayes networkBayes network
Bayes network
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agents
 
Rule based system
Rule based systemRule based system
Rule based system
 
Formal Logic in AI
Formal Logic in AIFormal Logic in AI
Formal Logic in AI
 
Production based system
Production based systemProduction based system
Production based system
 
Game playing in AI
Game playing in AIGame playing in AI
Game playing in AI
 
Diagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AIDiagnosis test of diabetics and hypertension by AI
Diagnosis test of diabetics and hypertension by AI
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
 
A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”A study on “impact of artificial intelligence in covid19 diagnosis”
A study on “impact of artificial intelligence in covid19 diagnosis”
 
A study on “the impact of data analytics in covid 19 health care system”
A study on “the impact of data analytics in covid 19 health care system”A study on “the impact of data analytics in covid 19 health care system”
A study on “the impact of data analytics in covid 19 health care system”
 

Recently uploaded

Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 

Recently uploaded (20)

Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 

Bayes' theorem

  • 1. Dr. C.V. Suresh Babu (CentreforKnowledgeTransfer) institute
  • 2. Introduction • Bayes' theorem is also known as Bayes' rule, Bayes' law, or Bayesian reasoning, which determines the probability of an event with uncertain knowledge. • In probability theory, it relates the conditional probability and marginal probabilities of two random events. • Bayes' theorem was named after the British mathematician Thomas Bayes. The Bayesian inference is an application of Bayes' theorem, which is fundamental to Bayesian statistics. (CentreforKnowledgeTransfer) institute
  • 3. What is Bayes Theorem? • Bayes Theorem is a method of calculating conditional probability. • The traditional method of calculating conditional probability (the probability that one event occurs given the occurrence of a different event) is to use the conditional probability formula, calculating the joint probability of event one and event two occurring at the same time, and then dividing it by the probability of event two occurring. • However, conditional probability can also be calculated in a slightly different fashion by using Bayes Theorem. (CentreforKnowledgeTransfer) institute
  • 4. • When calculating conditional probability with Bayes theorem, you use the following steps: • Determine the probability of condition B being true, assuming that condition A is true. • Determine the probability of event A being true. • Multiply the two probabilities together. • Divide by the probability of event B occurring. • This means that the formula for Bayes Theorem could be expressed like this: P(A|B) = P(B|A)*P(A) / P(B) • Calculating the conditional probability like this is especially useful when the reverse conditional probability can be easily calculated, or when calculating the joint probability would be too challenging. (CentreforKnowledgeTransfer) institute
  • 5. How? • It is a way to calculate the value of P(B|A) with the knowledge of P(A|B) • Bayes' theorem allows updating the probability prediction of an event by observing new information of the real world. • Example: If cancer corresponds to one's age then by using Bayes' theorem, we can determine the probability of cancer more accurately with the help of age. (CentreforKnowledgeTransfer) institute
  • 6. Bayes' theorem • Bayes' theorem can be derived using product rule and conditional probability of event A with known event B: • As from product rule we can write: • P(A ⋀ B)= P(A|B) P(B) or • imilarly, the probability of event B with known event A: • P(A ⋀ B)= P(B|A) P(A) • Equating right hand side of both the equations, we will get: • The above equation (a) is called as Bayes' rule or Bayes' theorem. This equation is basic of most modern AI systems for probabilistic inference. (CentreforKnowledgeTransfer) institute
  • 8. • It shows the simple relationship between joint and conditional probabilities. Here, • P(A|B) is known as posterior, which we need to calculate, and it will be read as Probability of hypothesis A when we have occurred an evidence B. • P(B|A) is called the likelihood, in which we consider that hypothesis is true, then we calculate the probability of evidence. • P(A) is called the prior probability, probability of hypothesis before considering the evidence • P(B) is called marginal probability, pure probability of an evidence. • In the equation (a), in general, we can write P (B) = P(A)*P(B|Ai), hence the Bayes' rule can be written as: • Where A1, A2, A3,........, An is a set of mutually exclusive and exhaustive events. (CentreforKnowledgeTransfer) institute
  • 9. Applying Bayes' rule: • Bayes' rule allows us to compute the single term P(B|A) in terms of P(A|B), P(B), and P(A). • This is very useful in cases where we have a good probability of these three terms and want to determine the fourth one. • Suppose we want to perceive the effect of some unknown cause, and want to compute that cause, then the Bayes' rule becomes: (CentreforKnowledgeTransfer) institute
  • 10. Example #1 Question: what is the probability that a patient has diseases meningitis with a stiff neck? Given Data: • A doctor is aware that disease meningitis causes a patient to have a stiff neck, and it occurs 80% of the time. • He is also aware of some more facts, which are given as follows: • The Known probability that a patient has meningitis disease is 1/30,000. • The Known probability that a patient has a stiff neck is 2%. Let a be the proposition that patient has stiff neck and b be the proposition that patient has meningitis. , so we can calculate the following as:  P(a|b) = 0.8  P(b) = 1/30000  P(a)= .02 Hence, we can assume that 1 patient out of 750 patients has meningitis disease with a stiff neck. (CentreforKnowledgeTransfer) institute
  • 11. Example #2: • Question: From a standard deck of playing cards, a single card is drawn. The probability that the card is king is 4/52, then calculate posterior probability P(King|Face), which means the drawn face card is a king card. • Solution: • P(king): probability that the card is King= 4/52= 1/13 • P(face): probability that a card is a face card= 3/13 • P(Face|King): probability of face card when we assume it is a king = 1 • Putting all values in equation (i) we will get: (CentreforKnowledgeTransfer) institute
  • 12. • Imagine you are a financial analyst at an investment bank. According to your research of publicly- traded companies, 60% of the companies that increased their share price by more than 5% in the last three years replaced their CEOs during the period. • At the same time, only 35% of the companies that did not increase their share price by more than 5% in the same period replaced their CEOs. Knowing that the probability that the stock prices grow by more than 5% is 4%, find the probability that the shares of a company that fires its CEO will increase by more than 5%. • Before finding the probabilities, you must first define the notation of the probabilities. • P(A) – the probability that the stock price increases by 5% • P(B) – the probability that the CEO is replaced • P(A|B) – the probability of the stock price increases by 5% given that the CEO has been replaced • P(B|A) – the probability of the CEO replacement given the stock price has increased by 5%. • Using the Bayes’ theorem, we can find the required probability: Example #3: Thus, the probability that the shares of a company that replaces its CEO will grow by more than 5% is 6.67%. (CentreforKnowledgeTransfer) institute
  • 13. • Using the cancer diagnosis example, we can show that Bayes rule allows us to obtain a much better estimate. • Now, we will put some made-up numbers into the example so we can assess the difference that Bayes rule made. • Assume that the probability of having cancer is 0.05 — meaning that 5% of people have cancer. • Now, assume that the probability of being a smoker is 0.10 — meaning that 10% of people are smokers, and that 20% of people with cancer are smokers, so P(smoker|cancer) = 0.20. • Initially, our probability for cancer is simply our prior, so 0.05. • However, using new evidence, we can instead calculate P(cancer|smoke), which is equal to (P(smoker|cancer) * P(cancer)) / P(smoker) = (0.20 * 0.05) / (0.10) = 0.10. • By introducing new evidence, we therefore obtained a better probability estimation. • Initially we had a probability of 0.05, but using the smoker evidence, we were able to get to a more accurate probability that was double our prior. • In the given example (even with our made-up numbers), this effect should be quite logical, since we know that smoking causes cancer. This therefore demonstrates how Bayes rule allows us to update our beliefs using relevant information. Example #4: (CentreforKnowledgeTransfer) institute
  • 14. Applications of Bayes' theorem • It is used to calculate the next step of the robot when the already executed step is given. • Bayes' theorem is helpful in weather forecasting. • It can solve the Monty Hall problem. (CentreforKnowledgeTransfer) institute