0% found this document useful (0 votes)
147 views18 pages

Ai 4

An agent is defined as anything that perceives its environment and acts upon it, with examples including humans, thermostats, and self-driving cars. Knowledge-based agents maintain internal knowledge and can reason and act intelligently, while knowledge engineering is the process of building such systems. The document also discusses various logical representations and inference rules in propositional and first-order logic.

Uploaded by

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

Ai 4

An agent is defined as anything that perceives its environment and acts upon it, with examples including humans, thermostats, and self-driving cars. Knowledge-based agents maintain internal knowledge and can reason and act intelligently, while knowledge engineering is the process of building such systems. The document also discusses various logical representations and inference rules in propositional and first-order logic.

Uploaded by

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

Unit -4

Q1) What is an Agent. Name any 5 agents around you


Explain Knowledge based agent with Wumpus World. List
and explain in short the various steps of knowledge
engineering process [9] –1

An agent is anything that perceives its environment through


sensors and acts upon that environment using actuators.

5 Examples of Agents Around You

1. Human being – uses eyes (sensors), hands/legs (actuators)


2. Thermostat – senses temperature and adjusts heating/cooling
3. Self-driving car – uses cameras, LIDAR, GPS to sense, and
motors to act
4. Robot vacuum cleaner – senses dirt and objects, moves to
clean
5. Virtual assistant (like Siri/Alexa) – hears your commands,
responds with actions

o Knowledge-based agents are those agents who have the capability


of maintaining an internal state of knowledge, reason over
that knowledge, update their knowledge after observations
and take actions. These agents can represent the world with
some formal representation and act intelligently.
o Knowledge-based agents are composed of two main parts:
o Knowledge-base and
o Inference system.

Knowledge Engineering is the process of building a knowledge-based


system.
Q2) Consider the following axioms:If a triangle is equilateral
then it is isosceles. If a triangle is isosceles, then its two sides
AB and AC are equal. If AB and AC are equal, then angle B
and C are equal.ABC is an equilateral triangle. Represent
these facts in predicate logic. Explain Inference in
Propositional Logic [9] --1

Q3) Write the following sentences in FOL(using types of


quantifiers) [9]
i) All birds fly
ii) Some boys play cricket
iii) A first cousin is a child of a parent’s sibling
iv) You can fool all the people some of the time and some of
the people all the time, but you cannot fool all the people all
the time

Q4) What is Knowledge Representation using


propositional Logic? Compare propositional and
predicate Logic. [9]

Knowledge Representation (KR) using Propositional Logic


means encoding facts, rules, and knowledge about the world
using simple true/false statements (called propositions).

Propositional Logic (also known as sentential logic) is a


formal system in which Statements are treated as atomic
units (propositions) and each statement is either true or false.

We can build complex knowledge using logical connectives.


Advantages of Using Propositional Logic in KR:
 Simple and easy to understand.

 Allows logical inference using formal rules (Modus

Ponens, etc.).
 Useful for small, well-defined problems.

❌ Limitations:
 No support for variables (can’t say "all", "some", "this

person").
 Not expressive enough for complex knowledge (like

 Doesn’t support quantification (like ∀x, ∃x).


relationships or object properties).

Example from AI:

Expert system rule:


 IF "the engine won't start" AND "the battery is dead",

THEN "replace battery".

Using propositional logic:


 Let:
o E = Engine won’t start
o B = Battery is dead

o R = Replace battery

(E ∧ B) → R
 Then the rule is:

Q5) Explain Wumpus world environment giving its PEAS


description. [9]
Q6) Explain different inference rules in FOL with suitable
example. [8]

Q7) Write an propositional logic for the statement, [10]


i) "All birds fly"
ii) "Every man respect his parents"

i) "All birds fly"


Let's represent the statement "All birds fly" using propositional logic.
We can use the following symbols:
 Let "B(x)" represent "x is a bird"
 Let "F(x)" represent "x can fly"
Using these symbols, we can express the statement "All birds fly" as:
 ∀x (B(x) → F(x))
This can be read as "For all x, if x is a bird, then x can fly."
ii) "Every man respects his parents"
Similarly, for the statement "Every man respects his parents," we can
use the following symbols:
 Let "M(x)" represent "x is a man"
 Let "R(x)" represent "x respects his parents"
Using these symbols, we can express the statement "Every man
respects his parents" as:
 ∀x (M(x) → R(x))
This can be read as "For all x, if x is a man, then x respects his
parents."
Extra examples : (for reference)
Q8) Differentiate between propositional logic and First
order logic. [7] –1

Q9) Write the following sentences in FOL (any 2) (using


types of quantifiers).
[9]
i) Every number is either negative or has a square root .
ii) Every connected and circuit-free graph is a tree .
iii) Some people are either religious or pious
iv) There is a barber who shaves all men in the town who do
not shave themselves.

Q10) What is Resolution? Solve the following statement by


using resolution algorithm. Draw suitable resolution graph.
[9]
i) Rajesh like all kind of food.
ii) Apple and vegetables are food.
iii) Anything anyone eats and is not killed is food.
iv) Ajay eats peanuts and still alive.
Prove that Rajesh like bananas.

Q11) List the inference rules used in prepositional logic?


Explain them in detail with suitable example. [9]

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.
Example:

 P: It is Monday
Q: It is raining
Statement: It is Monday and it is raining → P ∧ Q


 🔍 Conclusion: It is Monday → P
 P ∨ Q: It is hot or I will swim

 ¬P ∨ R: It is not hot or I will read

 🔍 Conclusion: I will swim or I will read → Q ∨ R

Q12) Explain syntax and semantics of First Order Logic in


detail. [8]

Q13) Detail the algorithm for deciding entailment in


prepositional logic. [8]

(KB) logically entails a sentence α (written as KB ⊨ α)


In propositional logic, entailment means , A knowledge base

if and only if α is true in all models where KB is true.

🔄 Steps of the Algorithm:

1. List all propositional symbols that appear in KB ∪ α


2. Generate all possible truth assignments (models) for
those symbols
→ If there are n symbols, there are 2ⁿ possible
combinations.
3. For each truth assignment (model):
o Evaluate the truth value of KB under that model

o If KB is true, check whether α is also true


KB ⊨ α (entailment holds)
4. If in every model where KB is true, α is also true → then

Else → entailment does not hold

🧪 Example:
KB:
1. P → Q
2. P

Does KB ⊨ Q?
Query (α): Q

Step 1: Symbols = {P, Q}

KB = (P → Q) ∧
Step 2: Generate all models (2 symbols → 4 models)
Model P Q P → Q α=Q
P
M1 T T T T T
M2 T F F F F
M3 F T T F T
M4 F F T F F

Step 3: Filter only models where KB is true


Only Model 1 (P=T, Q=T) makes KB true

Step 4: Is α true in that model?


Yes, Q = T → ✅ Entailment holds

 This method is exponential in time: O(2ⁿ), where n =


number of symbols
 Still, it's the most general method for checking
entailment in propositional logic
Q14) Explain knowledge representation structure and
compare them. [9]

Knowledge Representation (KR) is the method used to


represent information about the world in a form that a
computer system can utilize to solve complex tasks such as
diagnosing a medical condition, having a dialogue, or
planning a route.

You might also like