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

unit 3

This document outlines the syllabus and key concepts of a course on Artificial Intelligence, focusing on knowledge representation and reasoning methods. It covers various logical systems such as propositional and predicate logic, as well as knowledge representation techniques like semantic networks and frames. Additionally, it discusses uncertain knowledge and reasoning methods, including Bayesian probability and belief networks.

Uploaded by

vidyut1234569
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

unit 3

This document outlines the syllabus and key concepts of a course on Artificial Intelligence, focusing on knowledge representation and reasoning methods. It covers various logical systems such as propositional and predicate logic, as well as knowledge representation techniques like semantic networks and frames. Additionally, it discusses uncertain knowledge and reasoning methods, including Bayesian probability and belief networks.

Uploaded by

vidyut1234569
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

ARTIFICIAL INTELLIGENCE

18CSE305J
UNIT-3

Presented By
Dr.Pritee Parwekar
Associate Professor
Dept. of CSE
SRMIST Delhi NCR
Syllabus
► Knowledge and reasoning-Approaches ► Knowledge representation using frames
and issues of knowledge reasoning
► Inferences
► Knowledge base agents-Logic Basics ► Uncertain Knowledge and reasoning-
Methods
► Logic-Propositional logic-syntax ► Bayesian probability and belief network
,semantics and inferences
► Probabilistic reasoning
► Propositional logic- Reasoning patterns
► Probabilistic reasoning over time
► Forward and backward reasoning
► Predicate logic – Syntax and semantics,
instance and is relationship ► Other uncertain techniques-Data mining

► Knowledge representation using rules


► Fuzzy logic
► Knowledge representation using ► Dempster -shafer theory
semantic nets
Knowledge and reasoning-Approaches
and issues of knowledge reasoning
► In AI, knowledge is typically represented in a structured format that allows machines
to store, organize, and manipulate information.
► Reasoning in AI involves the application of logical principles, inference rules, and
algorithms to derive new knowledge or make decisions based on existing knowledge.
Different types of reasoning
► deductive reasoning (e.g., theorem proving),
► inductive reasoning (e.g., machine learning algorithms),
► abductive reasoning (e.g., hypothesis generation).
Knowledge Representation & Reasoning

How the knowledge is given to machines methods for that are :

► Logic : Predictive Logic(quantifier, a logical constant which is interpreted as


"given any", "for all", or "for any”) , Propositional Logic(T/F)
► Rules: If then else
► Semantic Net : Graph for mapping or traveling
► Frame: OOSE (objects & attributes),DBMS
► Script: Entire script for understanding and decision making
Knowledge base agents-Logic Basics
Knowledge base agents are a fundamental concept in artificial intelligence
(AI) and are often built using logic-based representations. Let's delve into
the basics of logic and its application in knowledge base agents:

► Logic: Logic is a formal system used to represent and manipulate


knowledge, infer conclusions, and make decisions. In the context of AI,
logic provides a rigorous framework for reasoning about propositions,
relationships, and rules. The two main branches of logic used in AI are
propositional logic and predicate logic.
Knowledge base agents-Propositional Logic
Propositional Logic: Propositional logic deals with propositions, which are
statements that can be either true or false. In propositional logic, variables represent
propositions, and logical connectives (such as AND, OR, NOT, IMPLIES) are used
to form compound propositions. Propositional logic allows reasoning about the truth
values of propositions based on logical operations.

Example:Syntax,Semantic
Propositional Logic
► Propositions: p, q
► Logical Connectives: AND (^) conjuction, OR (v)disjunction, NOT
(~), IMPLIES (->)if-then,<-> iff, Negation (Negative)
► Compound Propositions:
► p ^ q (p AND q)
► ~p (NOT p)
► p -> q (p IMPLIES q)
Propositional Logic
Qu.1.Let p and q be the following propositions:
p : Fail grade can be given.
q : Student scores more than 50% marks.

Consider the statement: "Fail grade cannot be given when student scores more
than 50%marks."

Which one of the following is the CORRECT representation of the above statement in
propositional logic?

1. q→¬p
2. q→p
3. p→q
4. ¬p → q
Knowledge base agents-Predicate Logic

Predicate Logic (First-Order Logic): Predicate logic extends


propositional logic by introducing variables, predicates,
quantifiers, and functions. Predicates represent properties or
relations between objects, while quantifiers (such as ∀ for "for
all" and ∃ for "there exists") specify the scope of variables.
Predicate logic allows for more expressive representation and
reasoning about objects and their relationships.
Predicate Logic
Example:
► Predicates: P(x), Q(x, y)
► Quantifiers: ∀x (for all x), ∃y (there exists y)
► Atomic Sentences:
► P(x) (x has property P)
► Q(x, y) (there is a relationship Q between x and y)
► Quantified Sentences:
► ∀x P(x) (all x have property P)
► ∃y Q(x, y) (there exists y such that x has a relationship Q with y)
Example
Qu.2. We have-
The given sentence is- “If it rains, then I will stay at home.”
This sentence is of the form- “If p then q”.

► So, the symbolic form is p → q


where-
► p : It rains
► q : I will stay at home
Word & Replacement
Example
Qu.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).
Example

Qu.4.
"∃x IsHungry(x)" asserts that there is at least one object that is hungry.
► Universal Quantifier (∀): Denoted as ∀, it indicates that the statement
within the quantifier is true for all objects in the domain.
For example, "∀x IsHuman(x) → IsMortal(x)" asserts that all humans are
mortal.
Instances and the "is" Relationship
► Instances and the "is" Relationship:
► In predicate logic, an instance refers to a specific assignment of values to variables that
makes a logical formula true.
► For example, consider the predicate P(x) which represents the property "x is a prime
number." The instance P(2) would be true, as 2 is a prime number. Similarly, P(3) would
also be true, but P(4) would be false.
► The "is" relationship is often expressed using predicates in predicate logic. For instance,
the predicate "Equals(x, y)" could represent the relationship "x is equal to y." Instances
of this predicate might include Equals(2, 2) and Equals(3, 3), which would both evaluate
to true.
► Predicate logic provides a rich and expressive language for representing and reasoning about
relationships between objects and properties. It forms the basis for many formal systems
used in various fields, including mathematics, computer science, and philosophy.
Logic-Propositional logic-syntax
,semantics and inferences
Syntax of Propositional Logic:
► Propositions: In propositional logic, propositions are statements that can be either
true or false. Propositions are represented by propositional symbols, often denoted
by uppercase letters (e.g., P, Q, R).
► Connectives: Propositional logic includes several logical connectives that allow
the construction of compound propositions:
► Conjunction (∧): Represents the logical "AND" operation. It is true only
when both propositions it connects are true.
► Disjunction (∨): Represents the logical "OR" operation. It is true if at least
one of the propositions it connects is true.
Logic-Propositional logic-syntax
,semantics and inferences
► Negation (¬): Represents the logical "NOT" operation. It negates the truth
value of the proposition it precedes.
► Implication (→): Represents the logical "IF...THEN" operation. It is true
unless the antecedent (the proposition before the arrow) is true and the
consequent (the proposition after the arrow) is false.
► Biconditional (↔): Represents the logical "IF AND ONLY IF" operation. It
is true if both propositions have the same truth value.
► Parentheses: Parentheses are used to indicate the grouping of propositions and to
specify the order of operations.
Logic-Propositional logic-syntax ,semantics
and inferences
Semantics of Propositional Logic:
► Truth Assignments: A truth assignment is an assignment of truth values (true or
false) to propositional symbols.
► Truth Tables: Truth tables are used to define the semantics of propositional logic.
They list all possible combinations of truth values for the propositional symbols and
indicate the resulting truth value of the compound propositions under each
assignment.
► Validity: A propositional formula is valid if it evaluates to true under every possible
truth assignment. In other words, it is impossible for the formula to be false under any
interpretation.
Logic-Propositional logic-syntax ,semantics
and inferences
Inferences in Propositional Logic:
► Modus Ponens: Modus Ponens is a valid inference rule that states if we have a
conditional proposition "P → Q" (if P then Q) and we know that P is true, then we
can infer that Q is true.
► Modus Tollens: Modus Tollens is another valid inference rule that states if we have a
conditional proposition "P → Q" (if P then Q) and we know that Q is false, then we
can infer that P is false.
► Resolution: Resolution is a rule of inference used in propositional logic. It involves
applying the resolution principle to resolve clauses (disjunctions of literals) in logical
formulas to infer new clauses.
Predicate logic – Syntax and semantics,
instance and is relationship
► Predicate logic, also known as first-order logic, is a formal system for
representing and reasoning about relationships between objects and
properties.
► Let's break down the key components of predicate logic, including its
syntax and semantics, as well as the concepts of instances and the "is"
relationship:
Syntax of Predicate Logic:
► Terms: Terms are basic elements in predicate logic that represent objects or individuals in
the domain of discourse. Terms can be constants, variables, or functions applied to terms.
For example, in the expression "f(x, y)", "x" and "y" are variables, and "f" is a function
symbol.
► Predicates: Predicates are expressions that represent properties or relations between
objects. Predicates take terms as arguments and can be either atomic (e.g., P(x)) or
compound (e.g., Q(x) ∧ R(y)). Atomic predicates are often denoted by uppercase letters.
► Quantifiers: Quantifiers are used to express the scope of variables in logical statements.
The two main quantifiers in predicate logic are the universal quantifier (∀), which
indicates "for all," and the existential quantifier (∃), which indicates "there exists."
► Connectives: Predicate logic includes logical connectives such as AND (∧), OR (∨),
NOT (¬), IMPLIES (→), and IF AND ONLY IF (↔), which are used to form compound
logical expressions.
Semantics of Predicate Logic:
► Interpretations: An interpretation assigns meanings to the terms, predicates, and
functions in a logical expression. It specifies a domain of discourse (the set of objects
under consideration) and provides interpretations for the constants, functions, and
predicates.
► Satisfaction: A logical formula is said to be satisfied (true) under an interpretation if,
when its variables are replaced by elements from the domain of discourse, the formula
evaluates to true.
► Validity: A logical formula is valid if it is true under all possible interpretations. In
other words, a formula is valid if it holds true regardless of the specific interpretation
chosen.
Knowledge representation using Rules
Knowledge representation using rules

► It is the method used to organize and formalize the knowledge in the knowledge base. It
is in the form of IF-THEN-ELSE rules.
► The classic methods of representing knowledge use either rules or logic. Table displays
the knowledge for the zoo animals problem in two formats–using rules on the left as
implemented within the Knowledge Representation NetLogo model, and using first
orderlogic on the right.
► Rules are often used in rule-based expert systems, and are either specified explicitly by
a knowledge engineer (usually through a process called ‘knowledge acquisition’ from a
human expert), or they are derived from data using a machine learning or data mining
algorithm. Rules use a logic-based form for reasoning. Logic is the use of symbolic and
mathematical techniques for deductive reasoning
Knowledge representation using semantic
nets
► Asemantic network is a graphic notation for representing knowledge in
patterns of interconnected nodes. Semantic networks became popular in
artificial intelligence and natural language processing only because it
represents knowledge or supports reasoning. These act as another
alternative for predicate logic in a form of knowledge representation.
► The structural idea is that knowledge can be stored in the form of graphs,
with nodes representing objects in the world, and arcs representing
relationships between those objects.
Knowledge representation using semantic
nets
Knowledge representation using frames
► Every frame provides a number of slots which are designated as slot values.
This is the way the frame network is created. Instead of simply processing
links among frames, every relationship is indicated by away from a value
being put into any slot.
► The frame is just like a record construction and related to the fields and
values which are generally slots as well as slot fillers. Generally speaking,
the frame is a set of fillers and slots which are identified as stereotypical
objects. An individual frame isn’t much beneficial. The frame technique has
a set of frames that can be joined together. The attribute value of one of the
frames may become another frame.
Knowledge representation using frames
Difference between semantic net &
Frame
Semantic networks are a natural representation of knowledge. Semantic
networks convey meaning in a transparent manner. These networks are simple
and easily understandable.

A frame is a record like structure which consists of a collection of attributes


and its values to describe an entity in the world.
Inferences
► Use of efficient procedures and rules by the Inference Engine is essential in
deducting a correct, flawless solution.
► In case of knowledge-based ES(expert System), the Inference Engine
acquires and manipulates the knowledge from the knowledge base to arrive
at a particular solution.
► In case of rule based ES, it −
1. Applies rules repeatedly to the facts, which are obtained from earlier rule
application.
2. Adds new knowledge into the knowledge base if required.
3. Resolves rules conflict when multiple rules are applicable to a particular
case.
Uncertain Knowledge and reasoning-
Methods
► To represent uncertain knowledge, where we are not sure about the
predicates, we need uncertain reasoning or probabilistic reasoning
► Causes of uncertainty:
▪ Information occurred from unreliable sources.
▪ Experimental Errors
▪ Equipment fault
▪ Temperature variation
▪ Climate change.
Bayesian probability and belief network
Bayesian probability and belief network
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.
It is a way to calculate the value of P(B|A) with the knowledge of
P(A|B).
Bayesian probability and belief network
► Bayes' theorem allows updating the probability prediction of an event by
observing new information of the real world.
► Graphical model to represent the probability.
• 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
Bayesian probability and belief network
► To represent the probabilistic relationships between different classes.
► To avoid dependences between value of attributes by joint
conditional probability distribution.
► In Naive Bayes Classifier, attributes are conditionally independent
► BN are also known as Bayesian Networks, Belief Networks, and
Probabilistic Networks. A BN is defined is defined by two parts, a
► directed acyclic graph (DAG) as a data structure and
► a set of conditional probability tables (CPT).
► Nodes Variables
► Links Dependency
Probabilistic reasoning
► Probabilistic reasoning is a way of knowledge representation where we apply the
concept of probability to indicate the uncertainty in knowledge. In probabilistic
reasoning, we combine probability theory with logic to handle the uncertainty.
► We use probability in probabilistic reasoning
► 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.“
► In probabilistic reasoning, there are two ways to solve problems with uncertain
knowledge:
• Bayes' rule
• Bayesian Statistics
Probabilistic reasoning
► Probability can be defined as a chance that an uncertain event will
occur. It is the numerical measure of the likelihood that an event will
occur. The value of probability always remains between 0 and 1 that
represent ideal uncertainties.
• 0 ≤ P(A) ≤ 1, where P(A) is the probability of an event A.
• P(A) = 0, indicates total uncertainty in an event A.
• P(A) =1, indicates total certainty in an event A.
• We can find the probability of an uncertain event by using the below
formula.
P(¬A) = probability of a not happening event.
• P(¬A) + P(A) = 1.
Probabilistic reasoning over time

► Probabilistic reasoning over time in AI refers to the


process of modeling and reasoning about uncertain events
or states that evolve over time using probabilistic methods.
► This approach is particularly useful for predicting future
outcomes, tracking changes in dynamic systems, and
making decisions in uncertain environments.
Forward reasoning
► It is a strategy of an expert system to answer the question, “What can happen
next?” Here, the Inference Engine follows the chain of conditions and derivations
and finally deduces the outcome. It considers all the facts and rules, and sorts them
before concluding to a solution. This strategy is followed for working on
conclusion, result, or effect. For example, prediction of share market status as an
effect of changes in interest rates.
Backward reasoning
► With this strategy, an expert system finds out the answer to the question, “Why
this happened?” On the basis of what has already happened, the Inference Engine
tries to find out which conditions could have happened in the past for this result.
This strategy is followed for finding out cause or reason. For example, diagnosis
of blood cancer in humans.
Bayesian probability and belief network
► A BN is a graph with the following properties
► Nodes: Set of random variables.
Directed Links:
► The real meaning of a link from node X to node Y is that X has a direct influence
on Y.
► Each node has a CPT that quantifies the effects that the parent have on the node.
The Graph has no directed cycles.
Probability : DAG
Bayesian Network
Bayesian Probability & Belief Network
Bayesian Network
Solve the simple question find the
P(W^S^R)
Find the probability that the grass is wet
when it sprinkler and rain

► Using the formula of conditional probability we can


convert it as P(A ^ B) = P(A|B) * P(B)
► P(W^S^R) =P(W∣S,R)^P(S|R)^P(R)
► Wet-Grass depends on Sprinkler and Rain (incoming arrow)
► Sprinkler depends on Rain(incoming arrow)

► P(W^S^R) =0.99 * 0.01 * 0.2


Find the following

► Find the probability that the grass is wet when it sprinkler and
but no rain
► Find the probability that the grass is wet in absence of
sprinkler and in absence of rain.
► P(W^S^~R)
► P(W^~S^~R)
Solve the question find P(S,D,A,¬B,¬E)
Solve the question
Solve the questions

► Questions 1:
Calculate the probability that in spite of the exam level being difficult, the student
having a low IQ level and a low Aptitude Score, manages to pass the exam and secure
admission to the university.

► Questions 2:
In another case, calculate the probability that the student has a High IQ level and
Aptitude Score, the exam being easy yet fails to pass and does not secure admission to
the university.
Solve the question
Other uncertain techniques-Data mining
► Data mining in AI involves the process of discovering patterns, trends, and
insights from large datasets. It encompasses various techniques for analyzing data
to extract valuable information and make predictions or decisions. Here are some
other uncertain techniques commonly used in data mining:
1. Clustering
2. Association Rule Mining
3. Anomaly Detection
4. Regression Analysis
5. Probabilistic Graphical Models
Fuzzy logic
► Fuzzy logic is a mathematical framework for dealing with uncertainty and
imprecision in data. Unlike classical binary logic, which assigns values of true or
false, fuzzy logic allows for gradual truth values between 0 and 1, representing
degrees of membership in a fuzzy set. Fuzzy logic is used in various data mining
tasks, such as fuzzy clustering, fuzzy classification, and fuzzy rule-based systems,
to handle uncertainty and vagueness in data.
Dempster -shafer theory
► Dempster-Shafer Theory, also known as the theory of belief functions or evidence
theory, is a mathematical framework used in artificial intelligence and decision
theory to reason under uncertainty. It was developed by Glenn Shafer and Arthur
P. Dempster in the 1970s. This theory generalizes and extends classical probability
theory to handle situations where there is incomplete or ambiguous evidence.
► Dempster-Shafer Theory has applications in various fields, including pattern
recognition, data fusion, diagnostic systems, decision support systems, and expert
systems. It provides a flexible and powerful framework for reasoning under
uncertainty, where classical probability theory may be inadequate due to
incomplete or conflicting evidence.
Thank you

You might also like