1. LPU MCA Semester 1
  2. CAB107
  3. 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 typeChooses action using
Simple reflexCurrent percept only, no memory
Model-based reflexPercept plus internal state tracking unseen aspects of the world
Goal-basedGoals, by searching or planning towards them
Utility-basedA utility function to compare how good outcomes are
LearningFeedback 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

Question 1 · Tier 3, Apply

A thermostat switches the heater on whenever the current temperature is below a set value and keeps no memory. Which agent type is it?

  1. A utility-based agent
  2. A learning agent
  3. A goal-based agent with search
  4. 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.

Question 2 · Tier 4, Analyse

Given the rule P implies Q, and given that Q is true, which conclusion is valid?

  1. Nothing about P can be concluded, because Q could be true for other reasons
  2. P must be true by modus ponens, since the rule and Q are both known to hold
  3. P must be false by modus tollens, since the rule and Q are both known to hold
  4. 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.