AI ExamGuide
AI ExamGuide
GUIDE
Unit I: Intelligent Agents | Unit II: Problem Solving by Search
T.E. Computer Engineering | 2019 Pattern | Semester II (310253)
SPLIT: 📋 PYQ (Past Questions) + 🔥 WILL ASK (Never Asked Topics)
▌ INTRODUCTION
Artificial Intelligence is one of the most transformative fields in modern computer science. It aims to
create machines that can perceive their environment, reason about it, and take intelligent actions. An
Intelligent Agent is the fundamental building block of AI — any entity that perceives and acts is an
agent.
▌ DEFINITION
Artificial Intelligence: The branch of computer science concerned with building systems that can
perform tasks that normally require human intelligence — such as reasoning, learning, perception,
problem-solving, understanding language, and decision making. (Russell & Norvig: AI is the study of
rational agents.)
Intelligent Agent: Any entity that perceives its environment through sensors and acts upon it
through actuators. Mathematically, an agent is described by an agent function: f: Percept Sequence
→ Action
▌ AGENT DIAGRAM
┌───────────────────────────┐
│ AGENT │
│ │
ENVIRONMENT ───── │ Sensors ──▶ [?] ──▶ Actuators ───── ENVIRONMENT
(inputs) │ Agent Function │ (outputs)
│ Percepts ──▶ Actions │
└───────────────────────────┘
▌ CONCLUSION
Artificial Intelligence aims to build rational agents that act optimally in their environment. An intelligent
agent perceives through sensors and acts through actuators, mapping percept sequences to actions
via an agent function. AI applications span healthcare, finance, transportation, gaming, and
manufacturing — making it one of the most impactful technologies of the 21st century.
PYQ 2. Advantages of Artificial Intelligence
📋 PYQ — 2023 Q1b — 5 Marks
[ 5 Marks MARKS ]
▌ INTRODUCTION
Artificial Intelligence offers transformative advantages across industries by automating complex
tasks, reducing human error, and enabling capabilities beyond human limitations. AI systems can
work 24/7, process massive amounts of data instantly, and continuously improve through learning.
▌ KEY ADVANTAGES
▶ 1. Reduction in Human Error
• AI systems make decisions based on algorithms and data — not emotion or fatigue
• NASA uses AI to control spacecraft with near-zero error in calculations
• In medical diagnosis, AI achieves higher accuracy than humans in detecting cancer
▶ 2. Works 24x7 Without Breaks
• Unlike humans, AI does not need sleep, breaks, or vacations
• Customer service chatbots (like Siri, Alexa) respond instantly at any hour
• Banks use AI fraud detection systems that operate continuously
▶ 3. Handles Repetitive Tasks
• Automates boring, repetitive tasks — freeing humans for creative work
• Manufacturing robots perform same assembly operations thousands of times perfectly
• AI processes thousands of emails, documents, invoices in seconds
▶ 4. Faster Decision Making
• AI processes millions of data points and arrives at decisions in milliseconds
• High-frequency trading AI makes stock buy/sell decisions in microseconds
• Chess AI evaluates billions of moves per second to select the best
▶ 5. Handles Dangerous Situations
• AI robots used in bomb disposal, nuclear plant inspection, deep sea exploration
• Reduces risk to human life in hazardous environments
• Mars rovers (AI-controlled) explore environments impossible for humans
▶ 6. New Capabilities and Innovation
• Enables capabilities impossible for humans — reading billions of web pages
• AlphaFold AI solved the 50-year-old protein folding problem
• AI enables personalized medicine, climate modeling, autonomous vehicles
▌ ADVANTAGES SUMMARY TABLE
Advantage Real Example
No human error AI medical imaging — 99% accuracy in diagnosis
24x7 availability Bank fraud detection — never sleeps
Handles repetition Car assembly robots — same precision every time
Advantage Real Example
Fast decisions GPS route calculation — milliseconds
Handles danger Nuclear reactor monitoring — no human risk
Continuous learning Netflix recommendations improve with every watch
▌ CONCLUSION
The advantages of AI — reduced errors, 24/7 operation, handling repetition and danger, faster
decision making, and continuous improvement — make it an indispensable technology. AI
complements human intelligence rather than replacing it, enabling humans to focus on creativity,
empathy, and complex judgment while AI handles data-intensive, repetitive, and hazardous tasks.
PYQ 3. Learning Agent Architecture with Diagram
📋 PYQ — 2023 Q1c — 5 Marks
[ 5 Marks MARKS ]
▌ INTRODUCTION
Most agent designs assume the environment is fully known in advance, but real-world environments
are complex and unpredictable. A Learning Agent solves this problem by starting with limited
knowledge and improving its performance over time by learning from experience. It was proposed by
Alan Turing who suggested that instead of programming an adult mind, we should program a child's
mind and let it learn.
▌ DEFINITION
Learning Agent: An agent that can improve its own performance over time through experience. It
starts with basic knowledge and modifies its behavior based on feedback from its environment,
becoming more competent than its initial programming would allow.
▌ LEARNING AGENT DIAGRAM — DRAW THIS
┌──────────────────────────────────────────┐
│ LEARNING AGENT │
│ │
ENVIRONMENT ──────┤► SENSORS │
│ │ │
│ ▼ │
Performance ─────►│ CRITIC ──── feedback ──► LEARNING │
Standard │ ELEMENT │
│ │ │
│ │ changes │
│ ▼ │
│ PROBLEM ── goals ──► PERFORMANCE │
│ GENERATOR ELEMENT │
│ │ │
│ ▼ │
│ ACTUATORS ───────┤► ENVIRONMENT
└──────────────────────────────────────────┘
📌 Key insight: The Performance Standard is OUTSIDE the agent. The agent cannot lower its own
standards to claim it is performing well.
▌ CONCLUSION
A Learning Agent consists of four components: Performance Element (takes actions), Learning
Element (improves based on feedback), Critic (evaluates performance against standard), and
Problem Generator (suggests exploration). Unlike static agents, learning agents improve over time,
making them suitable for complex real-world environments where all knowledge cannot be pre-
programmed.
PYQ 4. Properties of Agent Task Environment (PEAS)
📋 PYQ — 2024 Q1a — 6 Marks
[ 6 Marks MARKS ]
▌ INTRODUCTION
Before designing an intelligent agent, the first step is to fully specify the Task Environment — the
problem for which the agent is the solution. The standard way to describe a task environment is using
the PEAS framework, followed by analyzing its properties. The nature of the task environment
directly determines the best agent design.
▌ PEAS FRAMEWORK
PEAS: Performance measure, Environment, Actuators, Sensors — the four components used to
fully describe any task environment
PEAS
Meaning Example (Self-Driving Taxi)
Component
P— What defines success for Safe trips, passenger comfort, minimal fuel, legal
Performance the agent driving, profit
E— The external world the agent Roads, traffic, pedestrians, weather, map, GPS
Environment operates in
A — Actuators The outputs/actions Steering, accelerator, brake, horn, indicators
available to the agent
S — Sensors The inputs the agent Cameras, GPS, speedometer, odometer, sonar,
receives microphone
▌ CONCLUSION
PEAS (Performance, Environment, Actuators, Sensors) provides a complete specification of any task
environment. The six properties — observability, number of agents, determinism, episodic/sequential,
static/dynamic, discrete/continuous — determine the complexity of the environment and directly
influence the appropriate agent design. Real-world environments like taxi driving are typically partially
observable, multi-agent, stochastic, sequential, dynamic, and continuous — making them the most
challenging to design agents for.
PYQ 5. Rationality and Rational Agent
📋 PYQ — 2024 Q2b — 5 Marks
[ 5 Marks MARKS ]
▌ INTRODUCTION
The central concept of AI as studied in this course is rational behavior. Rather than trying to mimic
human behavior exactly, we focus on building agents that do the right thing — agents that are
rational. Rationality is a precisely defined mathematical concept based on expected performance.
▌ DEFINITION
Rationality: For each possible percept sequence, a rational agent should select an action that is
expected to maximize its performance measure, given the evidence provided by the percept
sequence and whatever built-in knowledge the agent has.
Rational Agent: An agent that acts so as to maximize the expected value of its performance
measure, given its current percept sequence and built-in knowledge. Rationality ≠ Omniscience,
Clairvoyance, or Perfection.
▌ FOUR KEY FACTORS DETERMINING RATIONALITY
Factor Description
Performance Measure Defines what 'success' means — what the agent is trying to achieve
Prior Knowledge What the agent knows about the environment before it starts
Available Actions What actions the agent can perform
Percept Sequence All percepts the agent has received so far
▌ INTRODUCTION
Artificial Intelligence has a rich history spanning over 70 years, with dramatic cycles of optimism,
disillusionment, and revival. Understanding this history helps explain why modern AI uses the
approaches it does today — moving from rule-based logic to statistical learning to the current deep
learning revolution.
▌ HISTORY TIMELINE
Period Key Event Significance
1943 McCulloch & Pitts — first neural Showed neurons can compute logical functions
network model
1950 Alan Turing — 'Computing First formal test of machine intelligence
Machinery and Intelligence' —
Turing Test
1956 Dartmouth Conference — John Birth of AI as a formal field
McCarthy coins 'Artificial
Intelligence'
1956-1969 Early enthusiasm — Logic Theorist, First AI programs — proved theorems, played
General Problem Solver checkers
1966-1973 First AI Winter — funding cut, NLP and combinatorial explosion problems
limitations exposed found
1969-1979 Knowledge-based systems Expert systems — domain knowledge works
(MYCIN, DENDRAL) better
1980s Expert Systems boom — AI industry reaches $1 billion
commercial AI products
1987-1993 Second AI Winter — hardware Expert systems too expensive to maintain
costs, limitations
1990s Machine learning, neural networks Statistical approaches, data-driven learning
return
2012-Now Deep Learning revolution — Neural networks with massive data + GPU
ImageNet breakthrough compute
📌 Kroger Case Study (Syllabus): Kroger uses AI and robotics for inventory management, personalized
marketing, automated fulfillment centers with robots, and predictive restocking — preparing for the 4th
Industrial Revolution.
▌ RISKS AND BENEFITS — QUICK REFERENCE
Benefits Risks
Automation of dangerous/repetitive tasks Job displacement and unemployment
Faster, more accurate medical diagnosis Privacy violations from surveillance AI
Scientific breakthroughs (protein folding) Autonomous weapons and lethal AI
Personalized education and healthcare Algorithmic bias and discrimination
24/7 availability, no fatigue Deepfakes and misinformation
Energy efficiency in smart grids Concentration of power in tech companies
▌ CONCLUSION
AI has evolved over 70+ years from symbolic logic to machine learning to deep learning. Key
milestones include the Turing Test (1950), the Dartmouth Conference (1956), Expert Systems
(1980s), and the Deep Learning revolution (2012-present). AI now transforms healthcare, transport,
finance, manufacturing, and communication — while also raising important ethical concerns about
jobs, privacy, bias, and safety that must be addressed proactively.
━━━━━━ UNIT I: WILL ASK ━━━━━━
WILL ASK 1. Types / Structure of Agents
🔥 WILL ASK — Explicitly in syllabus — NEVER asked standalone — HIGHEST probability
[ 5 Marks MARKS ]
▌ CONCLUSION
The five agent types form a hierarchy of increasing capability: simple reflex agents react to current
percepts, model-based agents maintain world state, goal-based agents plan to achieve goals, utility-
based agents maximize expected happiness, and learning agents improve through experience. The
choice of agent type depends on the complexity of the task environment.
UNIT II — PROBLEM SOLVING BY SEARCH
━━━━━━ SECTION 1: PYQ ━━━━━━
PYQ 7. Problem Solving Agent + Simple Problem Solving
📋 PYQ — 2023 Q4a (7 marks) + 2024 Q3b (4 marks)
[ 4–7 Marks MARKS ]
▌ INTRODUCTION
A problem-solving agent is a goal-based agent that uses search to find a sequence of actions that
leads to a desired goal state. It works by formulating the problem, searching through possible action
sequences, and executing the solution. This is the foundation of all search-based AI.
▌ DEFINITION
Problem-Solving Agent: A goal-based agent that decides what to do by finding a sequence of
actions that lead from the current state to a goal state, using search algorithms.
▌ STEPS IN SIMPLE PROBLEM SOLVING
Step 1: GOAL FORMULATION
Define what states are acceptable as the goal
Example: Goal = 'Be in Bucharest'
Step 3: SEARCH
Find a sequence of actions that leads from initial state to goal
Agent considers various possible action sequences
Step 4: EXECUTE
Carry out the recommended actions, one at a time
▌ CONCLUSION
A problem-solving agent formulates its task as a search problem with five components: initial state,
actions, transition model, goal test, and path cost. It then searches through the state space to find a
sequence of actions (a solution path) from the initial state to a goal state. Classic examples include
route finding (Romania map) and the 8-puzzle, which illustrate how real problems are abstracted into
tractable search problems.
PYQ 8. Search Strategies + Evaluation of Search
📋 PYQ — 2023 Q2a (Evaluation) + 2023 Q2b (Strategies) — 5+5 Marks
[ 5 Marks each MARKS ]
▌ INTRODUCTION
A search strategy determines the order in which nodes in the search tree are expanded. Different
strategies have vastly different performance characteristics. A good search strategy finds a solution
without exploring unnecessary states. All strategies are evaluated on four criteria.
▌ EVALUATION CRITERIA — 4 PARAMETERS
Criterion Definition Best Value
Completeness Does the algorithm always find a Yes (complete)
solution if one exists?
Optimality Does the algorithm find the LOWEST Yes (optimal)
COST solution?
Time Complexity How long does it take? (nodes O(b^d) or less
generated/expanded)
Space Complexity How much memory does it need? O(b*d) or less
(nodes stored)
Level 0: A
Level 1: B C
Level 2: D E F G
Order: A → B → C → D → E → F → G
Property BFS
Complete YES (if b is finite)
Optimal YES (if step costs are equal)
Time O(b^d)
Space O(b^d) — stores all nodes at depth d
Level 0: A
Level 1: B C
Level 2: D E F G
Order: A → B → D → E → C → F → G
Property DFS
Complete NO (fails in infinite-depth spaces or loops)
Optimal NO (may find suboptimal solution)
Time O(b^m) — worst case
Space O(b*m) — linear space — major advantage
▌ INTRODUCTION
In many search problems, the state space is astronomically large and uninformed strategies cannot
find solutions in reasonable time. A heuristic function allows the search algorithm to use problem-
specific knowledge to focus on the most promising paths — dramatically reducing search effort.
▌ DEFINITION
Heuristic Function h(n): A function that estimates the cost of the cheapest path from a given node
n to the goal state. It provides a 'hint' about which states are worth exploring. h(n) = 0 if n is the goal
state.
▌ ADMISSIBILITY — CRITICAL PROPERTY
Admissible Heuristic: A heuristic that NEVER overestimates the actual cost to reach the goal. i.e.,
h(n) ≤ h*(n) for all nodes n, where h*(n) is the true cost.
An admissible heuristic is OPTIMISTIC — it assumes the path will be at least
as good as it estimates
▶ h2 — Manhattan Distance
• Sum of distances (horizontal + vertical) each tile must move to reach goal
• Admissible — each tile needs at minimum Manhattan distance moves
• h2 DOMINATES h1 — always greater or equal — more informed
Tile 5 is at (2,1), should be at (1,1): distance = |2-1| + |1-1| = 1
Tile 8 is at (2,2), should be at (2,0): distance = |2-2| + |2-0| = 2
h2 = 1 + 2 = 3 (larger than h1=2 → more informative → fewer nodes expanded)
▌ HEURISTIC DOMINANCE
If h2(n) ≥ h1(n) for all nodes n, and both are admissible, then h2 DOMINATES h1. Using h2 results in
fewer nodes being expanded. Always prefer the larger (more informed) admissible heuristic.
Comparing h1 vs h2 on 8-puzzle:
Average nodes expanded with h1 = ~13,000 at depth 14
Average nodes expanded with h2 = ~400 at depth 14
→ h2 is ~32x more efficient than h1
Property Definition
Admissible h(n) ≤ h*(n) — never overestimates — guarantees optimal solution with A*
Consistent/ h(n) ≤ c(n,a,n') + h(n') — triangle inequality — guarantees A* optimality with
Monotone graph search
Dominant h2(n) ≥ h1(n) for all n — h2 is more informed — expands fewer nodes
▌ CONCLUSION
A heuristic function h(n) estimates the cost from node n to the goal, enabling informed search
algorithms to prioritize promising paths. An admissible heuristic never overestimates, guaranteeing
that A* finds the optimal solution. For the 8-puzzle, Manhattan distance (h2) dominates misplaced
tiles (h1) because it is always greater or equal and more accurately estimates remaining cost —
resulting in dramatically fewer node expansions.
PYQ 10. Blind Search vs Heuristic Search
📋 PYQ — 2023 Q3b (5 marks) + 2024 Q4b (4 marks) — BOTH YEARS
[ 4–5 Marks MARKS ]
▌ INTRODUCTION
Search strategies fall into two fundamental categories based on whether they use additional
knowledge about the problem. Blind (uninformed) search uses only the problem definition, while
heuristic (informed) search uses additional domain knowledge to guide the search toward promising
areas of the state space.
▌ COMPARISON TABLE — MAIN ANSWER
Aspect Blind/Uninformed Search Heuristic/Informed Search
Knowledge used Problem definition only Problem + heuristic function h(n)
Direction Systematic — explores all directions Guided — focuses on promising paths
Efficiency Low — expands many irrelevant High — expands fewer nodes
nodes
Heuristic Not used h(n) estimates cost to goal
Time complexity Higher — O(b^d) or worse Lower — depends on heuristic quality
Space complexity Higher Lower
Optimality BFS/UCS optimal; DFS not A* optimal with admissible heuristic
Completeness BFS complete; DFS may not be A* complete with admissible h(n)
Examples BFS, DFS, UCS, IDDFS Greedy Best-First, A*
Use case When no domain knowledge When problem-specific knowledge
available exists
⚡ A* appeared in BOTH 2023 and 2024. It WILL appear again. Master the numerical example.
▌ INTRODUCTION
A* (pronounced A-star) is the most widely used informed search algorithm in AI. It combines the
completeness and optimality of Uniform Cost Search with the efficiency of Greedy Best-First Search.
A* is used in GPS navigation, game AI, robotics path planning, and countless other applications.
▌ DEFINITION
A* Algorithm: An informed search algorithm that evaluates nodes using f(n) = g(n) + h(n), where
g(n) is the actual cost from start to node n, and h(n) is the heuristic estimate from n to goal. It
expands nodes in order of increasing f-value.
▌ THE KEY FORMULA — WRITE THIS FIRST
f(n) = g(n) + h(n)
where:
f(n) = total estimated cost of cheapest solution through n
g(n) = actual cost of path from START to current node n
h(n) = heuristic estimate of cost from n to GOAL
▌ A* ALGORITHM STEPS
1. Initialize: Add start node to OPEN list
f(start) = g(start) + h(start) = 0 + h(start)
2. Loop:
a. Pick node n with MINIMUM f(n) from OPEN list
b. If n is GOAL → return solution path
c. Move n to CLOSED list
d. For each neighbor n' of n:
- Calculate g(n') = g(n) + cost(n, n')
- Calculate f(n') = g(n') + h(n')
- If n' not in OPEN or CLOSED: add to OPEN
- If n' in OPEN with higher f: update it
▌ PROPERTIES OF A*
Property Value Condition
Complete YES If branching factor b is finite
Optimal YES If h(n) is admissible (never overestimates)
Time Complexity O(b^d) Depends on heuristic quality
Space Complexity O(b^d) Keeps all nodes in memory
▌ CONCLUSION
A* evaluates each node using f(n) = g(n) + h(n) — combining actual path cost with heuristic estimate.
It expands the node with minimum f-value first, ensuring that the first goal node expanded is on the
optimal path. With an admissible heuristic (one that never overestimates), A* is both complete and
optimal. In the Romania example, A* finds the optimal path Arad→Sibiu→Rimnicu
Vilcea→Pitesti→Bucharest with total cost 418 km, correctly preferring it over the shorter-appearing
path through Fagaras (450 km).
PYQ 12. Hill Climbing Search + Disadvantages
📋 PYQ — 2023 Q3a (10 marks) + 2024 Q4a (7 marks) — BOTH YEARS
[ 7–10 Marks MARKS ]
⚡ Hill Climbing appeared in BOTH years with high marks. Master the 8-Queens example and all 3
problems.
▌ INTRODUCTION
Hill Climbing is a local search algorithm that continuously moves toward improving states without
maintaining a search tree. Like climbing a hill in fog — always step upward — until you reach the top.
It is memory-efficient and fast, but suffers from getting stuck at local optima.
▌ DEFINITION
Hill Climbing: A local search algorithm that starts from an initial state and iteratively moves to the
neighboring state with the highest value (or lowest cost), stopping when no neighbor is better than
the current state.
▌ HILL CLIMBING ALGORITHM
function HILL-CLIMBING(problem):
current = initial_state
loop:
neighbor = highest_valued_successor(current)
if [Link] <= [Link]:
return current // local maximum found
current = neighbor
Hill Climbing evaluates all moves (move each queen within its column)
Best move reduces h from 17 to 12
Apply that move → h = 12
Continue: 12 → 10 → 7 → 5 → 3 → 1 → ...
Solution: h=0 (no attacking pairs) — hill climbing may not reach it
▌ INTRODUCTION
Classical search algorithms find paths to goals, but many problems only care about the solution
STATE, not the path to reach it. Local search operates on a single 'current state' and improves it
iteratively — like tuning a radio dial to find the clearest signal rather than planning a route to reach
the transmitter.
▌ DEFINITION
Local Search: A search algorithm that operates on a single current state (rather than maintaining a
frontier of unexplored paths) and moves to neighboring states to improve the solution. It does NOT
retain the path.
▌ OBJECTIVE FUNCTION LANDSCAPE
Objective
Function
Value ← Global Maximum (GOAL)
│ ╭────╮
│ ╭──╮ │ │
│ │ │ │ ╰─────╮
│ │ ↑ local │ │
│ │ max │ │
└──────────────────────── State Space
▌ CONCLUSION
Local search algorithms are ideal for optimization problems where only the final state matters and the
state space is too large for systematic exploration. Unlike tree search, they use constant memory by
maintaining only the current state. The main challenge is escaping local maxima — hill climbing gets
stuck while simulated annealing and genetic algorithms use probabilistic techniques to overcome this
limitation.
PYQ 14. DFS vs Best-First Search
📋 PYQ — 2024 Q4c — 4 Marks
[ 4 Marks MARKS ]
▌ VISUAL COMPARISON
DFS (follows deepest path): Best-First (follows best h(n)):
A A
/ \ / \
B C h: B=5, C=3 B C
/ \ \ D=6, E=2 B=5 C=3
D E F F=4, G=1
▌ CONCLUSION
DFS is an uninformed strategy that explores the deepest path first using a stack, using linear memory
but risking infinite loops and suboptimal solutions. Best-First Search uses a heuristic h(n) to prioritize
the most promising nodes, making it more directed and efficient in practice. However, Greedy Best-
First is not optimal — it can be led astray by a misleading heuristic. A* improves on Best-First by
combining h(n) with actual cost g(n) to guarantee optimality.
━━━━━━ UNIT II: WILL ASK ━━━━━━
WILL ASK 2. State Space Representation + Simulated Annealing
🔥 WILL ASK — State Space never explained alone — Simulated Annealing never appeared — Both
high probability
[ 4–5 Marks MARKS ]
Actions (operators):
1. Fill X: (x,y) → (4,y)
2. Fill Y: (x,y) → (x,3)
3. Empty X: (x,y) → (0,y)
4. Empty Y: (x,y) → (x,0)
5. Pour X→Y: (x,y) → (x-d, y+d) where d = min(x, 3-y)
6. Pour Y→X: (x,y) → (x+d, y-d) where d = min(y, 4-x)
Solution Path:
(0,0)→Fill X→(4,0)→Pour X into Y→(1,3)→Empty Y→(1,0)
→Pour X into Y→(0,1)→Fill X→(4,1)→Pour X into Y→(2,3)→GOAL!
▌ ALGORITHM
function SIMULATED-ANNEALING(problem, schedule):
current = initial_state
for t = 1 to ∞:
T = schedule(t) // temperature decreases over time
if T = 0: return current
next = random_successor(current)
ΔE = [Link] - [Link]
if ΔE > 0: // next is better
current = next // always accept improvement
else: // next is worse
current = next with probability e^(ΔE/T) // sometimes accept
▌ CONCLUSION
State space representation formalizes any search problem as a graph of states connected by actions
— the Water Jug problem is a classic example. Simulated Annealing extends hill climbing by
occasionally accepting moves to worse states based on temperature T, allowing escape from local
maxima. As temperature decreases (cooling schedule), the algorithm converges to a good global
solution — trading thorough exploration early for refinement later.
QUICK REVISION CHEAT SHEET — AI EXAM