5 - CSE3013 - Uncertainity and Knowledge Engineering
5 - CSE3013 - Uncertainity and Knowledge Engineering
Dr. Pradeep K V
Assistant Professor (Sr.)
School of Computer Science and Engineering
VIT - Chennai
What is Uncertainty?
It is a state of
Doubt about the future or
About what is the right thing to do.
Examples :
A doctor does not know exactly what is going on inside a patient.
A teacher does not know exactly what a student understands,
A robot does not know what is in a room it left a few minutes ago.
A period of Politician
The way of life in the coastal region.
But consider a situation where we are not sure about whether A is true or not
then we cannot express this statement, this situation is called uncertainty.
Causes of uncertainty :
Information occurred from unreliable sources.
Experimental Errors or Equipment fault
Temperature variation or Climate change.
Dr. Pradeep K V
Assistant Professor (Sr.)
School of Computer Science and Engineering
VIT - Chennai
In the real world, there are lots of scenarios, where the certainty of something is
not confirmed, such as :
"It will rain today"
"Behavior of someone for some situations"
"A match between two teams or two players."
These are probable sentences for which we can assume that it will happen but
not sure about it, so here we use probabilistic reasoning.
In PR, There are two ways to solve problems with uncertain knowledge:
Bayes’ rule
Bayesian Statistics
Probability?
It is a chance that an uncertain event will occur.
It is measured numerically (0 or 1) of the likelihood that an event will occur.
We can find the probability of an uncertain event by using the below formula.
Number _of _Desired_Outcomes
Probability _of _Occurance =
Total_Number _of _Outcomes
Let’s suppose, we want to calculate the event ’A’ when event ’B’ has already
occurred, "the probability of A under the conditions of B", it can be written as:
P(A ∧ B)
P(A|B) =
P(B)
If the probability of ’A’ is given and we need to find the probability of B, then
it will be given as:
P(A ∧ B)
P(B|A) =
P(A)
It can be explained by using the below Venn diagram, where B is occurred event, so
sample space will be reduced to set B, and now we can only calculate event A when
event B is already occurred by dividing the probability of P(A ∧ B) by P(B).
Example : In a class, there are 70% of the students who like English and 40% of the
students who likes English and mathematics, and then what is the percent of students
those who like English also like mathematics?
Solution : Let, A is an event that a student likes Mathematics and B is an event that
a student likes English.
P(A ∧ B) 0.4
P(A|B) = = = 57%
P(B) 0.7
Hence, 57% are the students who like English also like Mathematics.
Dr. Pradeep K V CSE3013 - "Artificial Intelligence" 9/ 42
Bayes’ theorem
Bayes’ theorem can be derived using product rule and conditional probability of
event A with known event B:
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 (1), in general, we can write P(B) = P(A) ∗ P(B|Ai ), hence
the Bayes’ rule can be written as:
P(Ai ∗ P(B|Ai ))
P(Ai |B) = Pk (4)
i=1
P(Ai ) ∗ P(B|Ai )
Where A1 , A2 , A3 , ........, An is a set of mutually exclusive and exhaustive events.
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
1
P(a|b) ∗ P(b) 0.8 ∗ ( 30000 )
P(b|a) = = = 0.001333333
P(a) 0.02
Hence, we can assume that 1 patient out of 750 patients has meningitis disease
with a stiff neck.
Dr. Pradeep K V CSE3013 - "Artificial Intelligence" 14/ 42
Example-2
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(face|king) ∗ p(king)
P(king|face) = (1)
P(face)
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.
Example
Harry installed a new burglar alarm at his home to detect burglary. The alarm reliably
responds at detecting a burglary but also responds for minor earthquakes. Harry has
two neighbors David and Sophia, who have taken a responsibility to inform Harry at
work when they hear the alarm. David always calls Harry when he hears the alarm, but
sometimes he got confused with the phone ringing and calls at that time too. On the
other hand, Sophia likes to listen to high music, so sometimes she misses to hear the
alarm. Here we would like to compute the probability of Burglary Alarm.
Problem: Calculate the probability that alarm has sounded, but there is neither a
burglary, nor an earthquake occurred, and David and Sophia both called the Harry.
Solution:
The network structure is showing that burglary and earthquake is the
parent node of the alarm and directly affecting the probability of alarm’s
going off, but David and Sophia’s calls depend on alarm probability.
Burglary (B)
Earthquake(E)
Alarm(A)
David Calls(D)
Sophia calls(S)
Let’s take the observed probability for the Burglary and earthquake component:
B E P(A=True) P(A=False)
True True 0.94 0.06
True False 0.95 0.04
False True 0.31 0.69
False False 0.001 0.999
Table: CPT for David Calls Depends on ’A’ Table: CPT for Sophia Calls Depends on ’A’
From the formula of joint distribution, we can write the problem statement in
the form of probability distribution:
Hence, a Bayesian network can answer any query about the domain by using
Joint distribution.