🤖 Intelligent Agents & Problem Solving
1013 words
5 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# 🤖 Intelligent Agents & Problem Solving ## 1. 🎯 Learning Objectives By the end of this topic, you will be able to: - Define the PEAS framework and apply it to any AI problem - Distinguish between configuration problems and planning problems - Classify problems by observability, determinism, episodicity, dynamics,...

🤖 Intelligent Agents & Problem Solving
1. 🎯 Learning Objectives
By the end of this topic, you will be able to:
- Define the PEAS framework and apply it to any AI problem
- Distinguish between configuration problems and planning problems
- Classify problems by observability, determinism, episodicity, dynamics, and continuity
- Describe the general problem-solving approach: goal formulation -> problem formulation -> search -> execution
- Explain the role of knowledge and reasoning in intelligent agents
2. 📋 Prerequisites
| Prerequisite | Course | Why It Matters |
|---|---|---|
| Agent concepts | BSCS3003 W1 | Builds on the definition of intelligent agents |
| State spaces | BSCS2002 | Graph-based problem representation |
3. 📖 Core Content
3.1 The PEAS Framework
Every intelligent agent can be described by its PEAS components:
- Performance measure: What metrics define success?
- Environment: What is the world the agent operates in?
- Actuators: What actions can the agent take?
- Sensors: What information can the agent perceive? Example: A Self-Driving Taxi
| Component | Description |
|---|---|
| Performance | Safety, speed, legality, comfort, profit |
| Environment | Roads, traffic, weather, pedestrians, other vehicles |
| Actuators | Steering wheel, accelerator, brake, signal, horn |
| Sensors | Cameras, LIDAR, radar, GPS, speedometer, microphones |
Example: An 8-Puzzle Solver
| Component | Description |
|---|---|
| Performance | Minimize moves to reach goal configuration |
| Environment | The 3x3 grid of numbered tiles |
| Actuators | Move blank tile Up/Down/Left/Right |
| Sensors | Current tile positions on the board |
3.2 Configuration vs. Planning Problems
This is a critical distinction tested heavily in exams:
| Aspect | Configuration Problem | Planning Problem |
|---|---|---|
| Goal | Find a state satisfying conditions | Find a path from start to goal |
| Solution | The goal state itself | Sequence of actions |
| Path matters? | No | Yes |
| Examples | N-Queens, Sudoku, SAT | 8-puzzle, Route-finding, Rubik's Cube |
| Search focus | State space exploration | Path space exploration |
Configuration Problem Example — N-Queens: Place N queens on an N×N board so that no two queens attack each other. Any valid arrangement is acceptable — we do not care how we got there.
Planning Problem Example — 8-Puzzle: Start from a scrambled configuration and reach the goal. The sequence of moves matters because we need to actually perform them.
3.3 Problem Classification
Environments and problems are classified along five dimensions:
- Observability: Fully observable (agent sees complete state) vs. partially observable (hidden information)
- Determinism: Deterministic (next state completely determined by action) vs. stochastic (probabilistic outcomes)
- Episodicity: Episodic (each action independent) vs. sequential (actions have long-term consequences)
- Dynamics: Static (world unchanged while agent thinks) vs. dynamic (world changes during deliberation)
- Continuity: Discrete (finite number of states/actions) vs. continuous (real-valued parameters) Examples:
| Problem | Observable | Deterministic | Episodic | Static | Discrete |
|---|---|---|---|---|---|
| 8-Puzzle | Full | Yes | Sequential | Static | Discrete |
| Chess | Full | Yes | Sequential | Semi-dynamic | Discrete |
| Self-driving | Partial | Stochastic | Sequential | Dynamic | Continuous |
| Sudoku | Full | Yes | Episodic | Static | Discrete |
3.4 The General Problem-Solving Approach
(Diagram)
Step 1: Goal Formulation Define the objective. What state do we want to reach? For an 8-puzzle, the goal is the tiles in order. For a TSP, the goal is a tour that visits all cities with minimum distance.
Step 2: Problem Formulation Define the state space, initial state, actions, transition model, and goal test:
- State space: Set of all reachable configurations
- Initial state: Starting configuration
- Actions: Available moves/operators
- Transition model: Result of applying an action to a state
- Goal test: Function that checks if a state satisfies the goal Step 3: Search The process of considering possible sequences of actions. This is what the rest of this course covers — different strategies for exploring the state space. Step 4: Execution Carry out the solution found by search.
3.5 Knowledge and Reasoning in Agents
An agent's effectiveness depends on how much it knows about its environment:
Model-based agents maintain an internal model of how the world works. They can reason about what would happen if they took various actions, even before trying them.
Goal-based agents have explicit goals and select actions that lead toward those goals. This is the foundation of search-based AI.
Utility-based agents not only try to achieve goals but try to maximize some measure of performance (utility). This allows them to make trade-offs between competing objectives.
(Diagram)
4. 📐 Key Formulas / Concepts
| Concept | Definition |
|---|---|
| PEAS | Performance, Environment, Actuators, Sensors |
| State space | Set of all reachable configurations from the initial state |
| Branching factor (b) | Average number of legal moves from any state |
| Solution depth (d) | Number of actions in the shortest solution |
| Configuration problem | Find a state satisfying constraints (N-Queens, Sudoku) |
| Planning problem | Find a path from start to goal (8-puzzle, route-finding) |
5. ⚠️ Common Pitfalls
Pitfall 1: Confusing Configuration and Planning
The mistake: Treating a problem as planning when only the goal state matters. How to catch it: Ask "Does the path to the solution matter?" If only the final arrangement matters, it is a configuration problem.
Pitfall 2: Ignoring Problem Characteristics
The mistake: Applying an algorithm designed for fully observable, deterministic problems to a partially observable, stochastic domain. Correct approach: Classify the problem first, then choose an appropriate search method.
Pitfall 3: Forgetting the Goal Formulation Step
The mistake: Jumping directly to search without clearly defining what success looks like. Correct approach: Always start with goal formulation — ambiguous goals lead to wasted search effort.
6. 📝 Practice Questions
Q1: Define the PEAS framework for an 8-puzzle solver.Answer: P = minimize moves to goal; E = 3x3 grid with numbered tiles; A = move blank Up/Down/Left/Right; S = current tile positions. Q2: Is Sudoku a configuration problem or a planning problem? Explain.Answer: Sudoku is a configuration problem. We only care about the final filled grid satisfying all constraints — not the sequence of numbers we write. Any valid solution is acceptable regardless of how we reach it. Q3: Classify the game of chess on the five dimensions.Answer: Fully observable (both players see the board), Deterministic (same move always produces same result), Sequential (each move affects future possibilities), Semi-dynamic (opponent moves while we think), Discrete (finite set of states). Q4: Explain the four steps of the general problem-solving approach.Answer: (1) Goal formulation — define the objective; (2) Problem formulation — define state space, actions, transitions; (3) Search — explore possibilities; (4) Execution — carry out the solution. Q5: What distinguishes a model-based agent from a simple reflex agent?Answer: A simple reflex agent responds to current percepts with condition-action rules. A model-based agent maintains an internal model of the world and can reason about action outcomes before acting. Join Discord PreviousHistory & Philosophy of AINextAI Philosophy