- LPU MCA Semester 1
- CAB107
- Unit 5
CAB107 · Unit 5: Artificial intelligence techniques
Knowledge representation and intelligent agents
10 practice questions · in the ETE syllabus
Key points
- First-order logic adds predicates, variables and quantifiers
- Modus ponens needs P true; modus tollens needs Q false
- Q true plus P implies Q tells nothing about P
- Model-based agents keep internal state
Knowledge representation encodes facts and relations so a program can reason. Propositional logic has only true or false propositions combined with connectives. First-order logic adds predicates, variables and quantifiers such as for all and there exists, so it can express relations between objects, for example Parent(x, y).
Valid inference rules: modus ponens (from P implies Q and P, conclude Q) and modus tollens (from P implies Q and not Q, conclude not P). Given P implies Q and Q true, nothing about P follows, because Q could be true for other reasons; concluding P is the fallacy of affirming the consequent.
An intelligent agent perceives its environment through sensors and acts through actuators.
| Agent type | Chooses action using |
|---|---|
| Simple reflex | Current percept only, no memory |
| Model-based reflex | Percept plus internal state tracking unseen aspects of the world |
| Goal-based | Goals, by searching or planning towards them |
| Utility-based | A utility function to compare how good outcomes are |
| Learning | Feedback to improve its own performance |
A thermostat reacting only to the present temperature is a simple reflex agent. A robot that remembers which rooms it has already cleaned needs internal state.
Exam trap: do not mix up the agent types. Long-term profit maximisation describes a utility-based agent, and memory of the past marks a model-based agent.
Try two questions
A thermostat switches the heater on whenever the current temperature is below a set value and keeps no memory. Which agent type is it?
- A utility-based agent
- A learning agent
- A goal-based agent with search
- A simple reflex agent
Show the answer
D. A condition-action rule on the current percept defines a simple reflex agent.
Why not A: No trade-off between outcomes is evaluated.
Why not B: It does not improve its behaviour from experience.
Why not C: It does not plan towards a goal through search.
Given the rule P implies Q, and given that Q is true, which conclusion is valid?
- Nothing about P can be concluded, because Q could be true for other reasons
- P must be true by modus ponens, since the rule and Q are both known to hold
- P must be false by modus tollens, since the rule and Q are both known to hold
- P and Q must both be false, because an implication can only hold when both parts are false
Show the answer
A. Concluding P from Q is the fallacy of affirming the consequent.
Why not B: Modus ponens requires P to be true, not Q.
Why not C: Modus tollens requires Q to be false.
Why not D: Q is stated as true, so it cannot be false.