0% found this document useful (0 votes)
105 views

AI Unit-2

Aiml

Uploaded by

snehitha4dammai
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

AI Unit-2

Aiml

Uploaded by

snehitha4dammai
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 82

MALLA REDDY UNIVERSITY

MR22-1CS0105: ARTIFICIAL INTELLIGENCE

III YEAR B.TECH. CSE I - SEM

(MR22-1CS0105)

UNIT-II
KNOWLEDGE REPRESENTATION AND REASONING:
LOGICAL SYSTEMS KNOWLEDGE BASED SYSTEMS,
PROPOSITIONAL LOGIC CONSTRAINTS, PREDICATE
LOGIC FIRST ORDER LOGIC, INFERENCE IN FIRST ORDER
LOGIC.

UNCERTAINTY AND KNOWLEDGE REASONING:


OVERVIEW DEFINITION OF UNCERTAINTY, BAYES RULE
INFERENCE, BELIEF NETWORK, UTILITY BASED SYSTEM,
DECISION NETWORK.
Knowledge Representation:
 Knowledge representation is a subject in cognitive science as well as in artificial
intelligence and knowledge modeling.

 In cognitive science it is concerned with how people store and process


information.

 In artificial intelligence (AI) and knowledge modeling (KM) it is a way to store


knowledge so that programs can process it and use it, for example to support
computer-aided design or to emulate human intelligence.

 AI researchers have borrowed representation theories from cognitive science.


Knowledge Representation Issues
 The aim is to show how logic can be used to form representations of the
world and how a process of inference can be used to derive new
representations about the world and how these can be used by an intelligent
agent to deduce what to do.

We require:

 A formal language to represent knowledge in a computer tractable form.

 Reasoning - Processes to manipulate this knowledge to deduce non-obvious


facts.
 Knowledge: Knowledge is awareness or familiarity gained by experiences of facts, data, and
situations. Following are the types of knowledge in artificial intelligence:
Types of knowledge
 Following are the various types of knowledge:
1. Declarative Knowledge:
• Declarative knowledge is to know about something.
• It includes concepts, facts, and objects.

2. Procedural Knowledge
• It is also known as imperative knowledge.
• Procedural knowledge is a type of knowledge which is responsible for knowing how to do
something.
• It includes rules, strategies, procedures, agendas, etc.
• Procedural knowledge depends on the task on which it can be applied.
3. Meta-knowledge:
• Knowledge about the other types of knowledge is called Meta-
knowledge.
4. Heuristic knowledge:
• Heuristic knowledge is representing knowledge of some experts
in a filed or subject.
5. Structural knowledge:
• Structural knowledge is basic knowledge to problem-solving.
• It describes relationships between various concepts such as kind
of, part of, and grouping of something.
 There are mainly four ways of knowledge representation which are given as follows

1. Logical Representation

2. Semantic Network Representation

3. Frame Representation

4. Production Rules
Why logic?
 The challenge is to design a language which allows one to represent all the
necessary knowledge.

 Logic makes statements about the world which are true (or false) if the
state of affairs it represents is the case (or not the case).
 Compared to natural languages (expressive but context sensitive) and
programming languages (good for concrete data structures but not
expressive) logic combines the advantages of natural languages and formal
languages.
Logical Representation

 Logical representation is a language with some concrete rules which deals with propositions and
has no ambiguity in representation.
 Logical representation means drawing a conclusion based on various conditions.
 This representation lays down some important communication rules.
 It consists of precisely defined syntax and semantics which supports the sound inference.
 Each sentence can be translated into logics using syntax and semantics.
Syntax:
• Syntaxes are the rules which decide how we can construct legal sentences in the logic.
• It determines which symbol we can use in knowledge representation.
• How to write those symbols.
Semantics:
• Semantics are the rules by which we can interpret the sentence in the logic.
• Semantic also involves assigning a meaning to each sentence.

Logical representation can be categorized into mainly two logics:


1. Propositional Logics
2. Predicate logics
Propositional logic (PL)
 Propositional logic (PL) is the simplest form of logic where all the statements are made by
propositions.
 A proposition is a declarative statement which is either true or false.
 It is a technique of knowledge representation in logical and mathematical form.
Example:
a) It is Sunday.
b) The Sun rises from West (False proposition)
c) 3+3= 7(False proposition)
d) 5 is a prime number.
Following are some basic facts about propositional logic:
 Propositional logic is also called Boolean logic as it works on 0 and 1.
 In propositional logic, we use symbolic variables to represent the logic, such A, B, C, P, Q, R, etc.
 Propositions can be either true or false, but it cannot be both.
 Propositional logic consists of an object, relations or function, and logical connectives.
 Connectives can be said as a logical operator which connects two sentences.
 A proposition formula which is always true is called tautology, and it is also called a valid
sentence.
 A proposition formula which is always false is called Contradiction.
 Statements which are questions, commands, or opinions are not propositions such as "Where is
Rohini", "How are you", "What is your name", are not propositions.
Syntax of propositional logic:
 The syntax of propositional logic defines the allowable sentences for the knowledge
representation. There are two types of Propositions:
 Atomic Propositions
 Compound propositions

 Atomic Proposition: Atomic propositions are the simple propositions. It consists of a single
proposition symbol. These are the sentences which must be either true or false.
Example:
a) 2+2 is 4, it is an atomic proposition as it is a true fact.
b) "The Sun is cold" is also a proposition as it is a false fact.
 Compound proposition: Compound propositions are constructed by combining simpler or
atomic propositions, using parenthesis and logical connectives.
Example:
a) "It is raining today, and street is wet."
b) "Ankit is a doctor, and his clinic is in Mumbai."
 Logical Connectives:
 Logical connectives are used to connect two simpler propositions or representing a sentence
logically. We can create compound propositions with the help of logical connectives.
 There are mainly five connectives, which are given as follows:
 Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal or
negative literal.
 Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a
conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking. → P∧ Q.

 Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called


disjunction, where P and Q are the propositions.
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.

 Implication: A sentence such as P → Q, is called an implication. Implications are


also known as if-then rules. It can be represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
 Biconditional: A sentence such as P⇔ Q is a Biconditional sentence, example
If I am breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.

Precedence of connectives:
 Parenthesis, Negation, Conjunction(AND), Disjunction(OR), Implication,
Biconditional
Rules of Inference

Inference:
 In artificial intelligence, we need intelligent computers which can create new logic from old logic
or by evidence, so generating the conclusions from evidence and facts is termed as Inference.
Inference rules:
 Inference rules are the templates for generating valid arguments. Inference rules are applied to
derive proofs in artificial intelligence, and the proof is a sequence of the conclusion that leads to
the desired goal.
 In inference rules, the implication among all the connectives plays an important role. Following
are some terminologies related to inference rules:
 Implication: It is one of the logical connectives which can be represented as P → Q. It is a
Boolean expression.
 Converse: The converse of implication, which means the right-hand side proposition goes to the
left-hand side and vice-versa. It can be written as Q → P.
 Contrapositive: The negation of converse is termed as contrapositive, and it can be represented
as ¬ Q → ¬ P.
 Inverse: The negation of implication is called inverse. It can be represented as ¬ P → ¬ Q.
Types of Inference rules:
1. Modus Ponens:
 The Modus Ponens rule is one of the most important rules of inference, and it states that if P and
P → Q is true, then we can infer that Q will be true. It can be represented as:

Example:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be true.
2.Modus Tollens:
 The Modus Tollens rule state that if P→ Q is true and ¬ Q is true, then ¬ P will also true. It can
be represented as:

Example
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P
3. Hypothetical Syllogism:
 The Hypothetical Syllogism rule state that if P→R is true whenever P→Q is true, and Q→R is
true. It can be represented as the following notation:
 Example:
Statement-1: If you have my home key then you can unlock my home. P→Q
Statement-2: If you can unlock my home then you can take my money. Q→R
Conclusion: If you have my home key then you can take my money. P→R
4. Disjunctive Syllogism:
 The Disjunctive syllogism rule state that if P∨Q is true, and ¬P is true, then Q will be true. It can
be represented as:

 Example:
Statement-1: Today is Sunday or Monday. ==>P∨Q
Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q
5. Addition:
 The Addition rule is one the common inference rule, and it states that If P is true, then P ∨Q will
be true.

6. Simplification:
 The simplification rule state that if P∧ Q is true, then Q or P will also be true. It can be
represented as:a
7. Resolution:
 The Resolution rule state that if P∨Q and ¬ P∧R is true, then Q ∨R will also be true. It can be
represented as

First-Order logic:
 First-order logic is another way of knowledge representation in artificial intelligence. It is an
extension to propositional logic.
 First-order logic is also known as Predicate logic or First-order predicate logic.
 First-order logic is a powerful language that develops information about the objects in a more
easy way and can also express the relationship between those objects.
• First-order logic (like natural language) does not only assume that the world contains facts like
propositional logic but also assumes the following things in the world:
• Objects: A, B, people, numbers, colors, wars, theories, squares, pits, wumpus, ......
• Relations: It can be unary relation such as: red, round, is adjacent, or n-any relation such as: the
sister of, brother of, has color, comes between
• Function: Father of, best friend, third inning of, end of, ......

 As a natural language, first-order logic also has two main parts:


 Syntax
 Semantics
Syntax of First-Order logic:
 The syntax of FOL determines which collection of symbols is a logical
expression in first-order logic. The basic syntactic elements of first-order logic
are symbols. We write statements in short-hand notation in FOL.
Basic Elements of First-order logic:
 Following are the basic elements of FOL syntax:
Atomic sentences:
 Atomic sentences are the most basic sentences of first-order logic. These
sentences are formed from a predicate symbol followed by a parenthesis with a
sequence of terms.
 We can represent atomic sentences as Predicate (term1, term2, ......, term n).
 Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay).
Chinky is a cat: => cat (Chinky).
Complex Sentences:
 Complex sentences are made by combining atomic sentences using
connectives.
 First-order logic statements can be divided into two parts:
 Subject: Subject is the main part of the statement.
 Predicate: A predicate can be defined as a relation, which binds two atoms
together in a statement.
 Consider the statement: "x is an integer.", it consists of two parts, the first part x is the subject
of the statement and second part "is an integer," is known as a predicate.

 All Boys like cricket


predicate like(boys,cricket) parameters

 Some boys like cricket


like(boys,cricket)
Quantifiers in First-order logic:
 A quantifier is a language element which generates quantification, and quantification specifies the
quantity of specimen in the universe of discourse.
 These are the symbols that permit to determine or identify the range and scope of the variable in
the logical expression. There are two types of quantifier:

 Universal Quantifier, (for all, everyone, everything)


 Existential quantifier, (for some, at least one).
Universal Quantifier:
 Universal quantifier is a symbol of logical representation, which specifies that the statement
within its range is true for everything or every instance of a particular thing.
 The Universal quantifier is represented by a symbol ∀, which resembles an inverted A.
 If x is a variable, then ∀x is read as:
 For all x
 For each x
 For every x
Example:
 All man drink coffee.
Existential Quantifier:
• Existential quantifiers are the type of quantifiers, which express that the statement
within its scope is true for at least one instance of something.
• It is denoted by the logical operator ∃, which resembles as inverted E. When it is used
with a predicate variable then it is called as an existential quantifier.
 If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as:
 There exists a 'x.'
 For some 'x.'
 For at least one 'x.'
Properties of Quantifiers:
 In universal quantifier, ∀x∀y is similar to ∀y∀x.
 In Existential quantifier, ∃x∃y is similar to ∃y∃x.
 ∃x∀y is not similar to ∀y∃x.
Some Examples of FOL using quantifier:
1. All birds fly.
In this question the predicate is "fly(bird)."
And since there are all birds who fly so it will be represented as follows.
∀x bird(x) →fly(x).
2. Every man respects his parent.
In this question, the predicate is "respect(x, y)," where x=man, and y= parent.
Since there is every man so will use ∀, and it will be represented as follows:
∀x man(x) → respects (x, parent).
3. Some boys play cricket.
In this question, the predicate is "play(x, y)," where x= boys, and y= game. Since there are some
boys so we will use ∃, and it will be represented as:
∃x boys(x) → play(x, cricket).
 4. Not all students like both Mathematics and Science.
In this question, the predicate is "like(x, y)," where x= student, and y= subject.
Since there are not all students, so we will use ∀ with negation, so following
representation for this:
¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].
 5. Only one student failed in Mathematics.
In this question, the predicate is "failed(x, y)," where x= student, and y=
subject.
Since there is only one student who failed in Mathematics, so we will use
following representation for this:
∃(x) [ student(x) → failed (x, Mathematics) ∧∀ (y) [¬(x==y) ∧
student(y) → ¬failed (x, Mathematics)].
 PL
 It uses prepositions in which complete sentence is denoted by symbol.
 Pl Cannot represent individual entities Eg: meera is short.
 It cannot express generalization, specialization or pattern.
ex : triangles have 3 sides.
 FOL
 Fol uses predicates which involve constants, variables, functions relations
 Fol can represent individual properties {short(meera)}
 It can express generalization, specialization or pattern.
 Ex: no_of_sides(triangle,3)
 We use the rules to derive the soundness of the argument in Example.
 Again let the following propositions stand for these statements about the world:
 P: Randi writes books.
 Q: Randi helps other people to write books.
 R: Randi earns her living as an editor

The following derivation determines Randi’s occupation:


 Let the following propositions stand for these statements about the world:

 P: Robbery was the reason for the murder.


 Q: Something was taken.
 R: Politics was the reason for the murder.
 S: A woman was the reason for the murder.
 T: The murderer left immediately.
 U: The murderer left tracks all over the room.

 The following derivation determines the reason for the murder


A set of inference rules is called a deduction system .
1. Lucy* is a professor
2. All professors are people.
3. John is the dean.
4. Deans are professors.
5. All professors consider the dean a friend or don’t know him.
6. Everyone is a friend of someone.
7. People only criticize people that are not their friends.
8. Lucy criticized John .
Inference in First-Order Logic

 Inference in First-Order Logic is used to deduce new facts or sentences from


existing sentences. Before understanding the FOL inference rule, let's understand
some basic terminologies used in FOL.
Substitution:
 Substitution is a fundamental operation performed on terms and formulas. It occurs
in all inference systems in first-order logic. The substitution is complex in the
presence of quantifiers in FOL. If we write F[a/x], so it refers to substitute a
constant "a" in place of variable "x".
Equality
 Equality:First-Order logic does not only use predicate and terms for making
atomic sentences but also uses another way, which is equality in FOL. For this, we
can use equality symbols which specify that the two terms refer to the same object.
 Example: Brother (John) = Smith.
 Asin the above example, the object referred by the Brother (John) is
similar to the object referred by Smith. The equality symbol can also
be used with negation to represent that two terms are not the same
objects.
 Example: ¬ (x=y) which is equivalent to x ≠y.
FOL inference rules for quantifier:
 As propositional logic we also have inference rules in first-order logic, so following are some
basic inference rules in FOL:
• Universal Generalization
• Universal Instantiation
• Existential Instantiation
• Existential introduction

Universal Generalization:
• Universal generalization is a valid inference rule which states that if premise P(c) is true for any
arbitrary element c in the universe of discourse, then we can have a conclusion as ∀ x P(x).
Example: Let's represent, P(c): "A byte contains 8 bits", so for ∀ x P(x) "All bytes
contain 8 bits.", it will also be true.

Universal Instantiation:
• Universal instantiation is also called as universal elimination or UI is a valid
inference rule. It can be applied multiple times to add new sentences.
• The new KB is logically equivalent to the previous KB.
• As per UI, we can infer any sentence obtained by substituting a ground term for
the variable.

Example:1.
IF "Every person like ice-cream"=> ∀x P(x) so we can infer that
"John likes ice-cream" => P(c)
Example: 2.
 Let's take a famous example,
 "All kings who are greedy are Evil." So let our knowledge base contains this detail as in the form
of FOL:
 ∀x king(x) ∧ greedy (x) → Evil (x),
 So from this information, we can infer any of the following statements using Universal
Instantiation:
• King(John) ∧ Greedy (John) → Evil (John),
• King(Richard) ∧ Greedy (Richard) → Evil (Richard),
• King(Father(John)) ∧ Greedy (Father(John)) → Evil (Father(John)),
Existential Instantiation:
• Existential instantiation is also called as Existential Elimination, It can be
applied only once to replace the existential sentence.
• The new KB is not logically equivalent to old KB, but it will be satisfiable if
old KB was satisfiable.

Example:
 From the given sentence: ∃x Crown(x) ∧ OnHead(x, John),
 So we can infer: Crown(K) ∧ OnHead( K, John), as long as K does not
appear in the knowledge base.
• The above used K is a constant symbol, which is called Skolem constant.
• The Existential instantiation is a special case of Skolemization process.
Existential Introduction
• An existential introduction is also known as an existential generalization, which is a valid
inference rule in first-order logic.
• This rule states that if there is some element c in the universe of discourse which has a property P,
then we can infer that there exists something in the universe which has the property P.

 Example:
 Let's say that,
"Priyanka got good marks in English."
"Therefore, someone got good marks in English."
Well Formed Formulas
 Not all strings can represent propositions of the predicate logic.
 Those which produce a proposition when their symbols are interpreted must follow the rules
given below, and they are called wffs(well-formed formulas) of the first order predicate logic.

Rules for constructing Wffs

 A predicate name followed by a list of variables such as P(x, y), where P is a predicate name,
and x and y are variables, is called an atomic formula.
 Wffs are constructed using the following rules:
1. True and False are wffs.
2. Each propositional constant (i.e. specific proposition), and each propositional variable (i.e. a
variable representing propositions) are wffs.
3. Each atomic formula (i.e. a specific predicate with variables) is a wff.
Resolution
 Resolution is a theorem proving technique that proceeds by building refutation proofs, i.e., proofs
by contradictions.
 Resolution is used, if there are various statements are given, and we need to prove a conclusion
of those statements.
 Resolution is a single inference rule which can efficiently operate on the conjunctive normal
form or clausal form.
 Conjunctive Normal Form: A sentence represented as a conjunction of clauses is said to
be conjunctive normal form or CNF.
 Example:
a) Ravi likes all kind of food.
b) Apple and chicken are food.
c) Anything anyone eats and is not killed is food.
d) Ajay eats peanuts and still alive.

Prove: Ravi likes peanuts.

write in FOL form


 likes(Ravi, Peanuts) => ¬ likes(Ravi, Peanuts)
 Steps to solve Resolution
1. Negate the statement to be proved.
2. Convert given facts into FOL
3. Convert FOL into CNF
4. Draw resolution graph

Convert the facts into FOL


5. ∀x: food(x) -> likes(Ravi,x)
6. i) food(apple)
ii) food(chicken)
3. ∀x∀y: eats(x,y) ∧ ¬killed(x) -> food(y)

4. eats(ajay,peanuts) ∧ alive(ajay)
5. ∀x: ¬killed(x) -> alive(x)
added predicates
6. ∀x: alive(x) -> ¬killed(x)

 Convert FOL into CNF


1. Eliminate ‘->’ & ‘<->’

a->b : ¬a V b
a<->b : a->b ∧ b->a
2. Move ¬ inward
 ¬(∀xp) = ∃x¬p
 ¬(∃xp) = ∀x¬p
 ¬(aVb) = ¬a ∧ ¬b
 ¬(a ∧ b) = ¬a V ¬b
 ¬( ¬a ) = a
3. Rename Variable.
4. Replace Existential Quantifier by skolem constant
∃x Rich(x) = Rich(G1)

5. Drop Universal Quantifier


1. ¬ food(x) V likes(Ravi,x) [ a->b = ¬a V b]

3. ¬ [eats(x,y) ∧ ¬killed(x)] V food(y)

¬ eats(x,y) V killed(x) V food(y)

4. eats(ajay,peanuts) ∧ alive(ajay) (Divide in resolution graph)

5. ¬ ¬killed(x) V alive(x) : killed(x) V alive(x)


6. ¬ alive(x) -> ¬ ¬ killed(x) : ¬ alive(x) V ¬ killed(x)
(I)

(II)

(III)

(v)
Uncertain Knowledge and Reasoning
 Inreal life, it is not always possible to determine the state of the environment as it might not be
clear. Due to partially observable or non-deterministic environments, agents may need to handle
uncertainty and deal with:
 Uncertain data: Data that is missing, unreliable, inconsistent or noisy
 Uncertain knowledge: When the available knowledge has multiple causes leading to multiple
effects or incomplete knowledge of causality in the domain
 Uncertain knowledge representation: The representations which provides a restricted model of
the real system, or has limited expressiveness
 Inference: In case of incomplete or default reasoning methods, conclusions drawn might not be
completely accurate. Let’s understand this better with the help of an example.

 IF primary infection is bacteriacea


 AND site of infection is sterile
 AND entry point is gastrointestinal tract
 THEN organism is bacteriod (0.7)

 In such uncertain situations, the agent does not guarantee a solution but acts on its own
assumptions and probabilities and gives some degree of belief that it will reach the required
solution.
 Such uncertain situations can be dealt with using
 Probability theory
 Truth Maintenance systems
 Fuzzy logic.
Probability
 Probability is the degree of likeliness that an event will occur.
 It provides a certain degree of belief in case of uncertain situations.
 It is defined over a set of events U and assigns value P(e) i.e. probability of occurrence of event e
in the range [0,1].
 Here each sentence is labeled with a real number in the range of 0 to 1, 0 means the sentence is
false and 1 means it is true.
 Conditional Probability or Posterior Probability is the probability of event A given that B has
already occurred.

 P(A|B) = (P(B|A) * P(A)) / P(B)

 For example, P(It will rain tomorrow| It is raining today) represents conditional probability of it
raining tomorrow as it is raining today.

 P(A|B) + P(NOT(A)|B) = 1

 Joint probability is the probability of 2 independent events happening simultaneously like rolling
two dice or tossing two coins together.
Bayes Theorem
 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.

 It is a way to calculate the value of P(B|A) with the knowledge of P(A|B).


2R 3R
3B 4B

A B

1. What is the probability of red ball given that bag A is chosen


 P(R/A) = 2/5 { Bag A is Chosen}

2. What is the probability that redball is drawn from bag A.


{ Here we need to select Red ball and Bag A – Two Conditions}
P(A ∧ R) = P(A). P(R/A)
3. What is the probability of red ball

P(R) = P(A ∧ R) + P(B ∧ R)

P(A ∧ R) : Probability of getting a red ball from bag A


P(B ∧ R) : Probability of getting a red ball from bag B
Bayes Theorem: { Reverse Probability}
 Given that red ball is drawn what is the probability that the ball is from bag A.

 P(A/R) = P(A ∧ R) /((P(A ∧ R) + P(B ∧ R) )

P(A ∧ R) : from Bag A


((P(A ∧ R) + P(B ∧ R) ) :Total probability of Red Ball.

=> P(A).P(R/A) / P(R)


 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.


 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.

Bayesian Belief Network

• Directed Acyclic Graph

• Conditional Probability Table


 Directed Acyclic Graph (DAG)
 Convenient for representing probabilistic relation between multiple events.

 Nodes
 Uncertainity (Dog bark/Rain)
Rain
 Ditrected Edges

cat hide/Dog Bark


Dog
Bark

Cat Hide
 Directed Arrow represents conditional probability

 Dog bark/Rain: Dog will batk if it rains

 Cat hide/dog bark: Cat will hide if dog barks

 Conditional Probability Table:

 P(Dog/Rain): Probability of considered node with respect to its parent node.


 P(X/P)
R ~R
B 9/48 18/48
~B 3/48 18/48
Earthqua
Burglary ke

Alarm

P1 Calls P2 Calls

You might also like