2 Agent Environments And Problem Formulation

Artificial Intelligence · Unit 2

Agent Environments and Problem Formulation

Exam-focused notes for Agent Environments and Problem Formulation (Artificial Intelligence, BIT252): what the TU syllabus asks and how it has actually been tested, with 3 solved past questions from this unit.

Agent Environments and Problem Formulation in short

Before an agent can search for a solution, we must describe its world and its problem clearly. This chapter covers the kinds of environments, how to write a problem as a state space, and how heuristics guide the search.

Agent Environments and Problem Formulation: notes

Environment types and properties

The environment is everything outside the agent that it senses and acts upon. Environments differ in these properties:

PropertyOne kindOther kind
ObservabilityFully observable: sensors show the whole state (chess)Partially observable: only part is visible (poker, taxi driving)
AgentsSingle agent: crosswordMulti-agent: chess (competitive), taxi traffic (cooperative)
DeterminismDeterministic: next state fully fixed by current state and actionStochastic: some randomness (dice, traffic)
EpisodesEpisodic: each decision is independent (image classifier)Sequential: current action affects later ones (chess)
ChangeStatic: world waits while the agent thinksDynamic: world changes meanwhile (taxi driving)
ValuesDiscrete: finite states and actions (chess)Continuous: values like speed and position (driving)
KnowledgeKnown: rules of the world are knownUnknown: the agent must learn the rules

The hardest case is partially observable, stochastic, sequential, dynamic, continuous, and multi-agent. Taxi driving is such a task.

Deterministic and non-deterministic environments

In a deterministic environment, the next state is completely decided by the current state and the agent's action. The same action in the same state always gives the same result. Chess and the 8-puzzle are deterministic.

In a non-deterministic environment, the same action in the same state can lead to different results. Part of the outcome is uncertain. Driving a car, playing poker, and throwing a dice are examples.

If the uncertainty is described by probabilities, the environment is called stochastic. If it only lists possible outcomes without probabilities, it is non-deterministic.

An agent in a deterministic world can plan a fixed sequence of actions. In a non-deterministic world, it needs a contingency plan: "if this happens, do that".

What this unit covers

  • Environment types and properties
  • Deterministic and non-deterministic environments
  • State space representation
  • Goal formulation and problem definition
  • Heuristic functions and evaluation metrics

State space representation

2082 · 10 marks

How problems is formulated in state space representation?Create a state space representation with start and goal state.Configure the states with appropriate heuristics and actual cost.Show search path using Greedy Best First Search.[2+2+6]

This is a conceptual/constructive question. No numeric matrices, burst times, or reference strings are supplied. The student is required to: - Define state space problem formulation [2] - Construct a state space with start/goal, heuristics, actual costs [2] - Trace Greedy Best First Search [6] Si...

Open this answer on its own page →

2080 · 5 marks

Define game. Give a state space representation of any problem you know. [5]

Show solved answer

Game and State Space Representation

Definition of Game (2 marks)

A game in the context of Artificial Intelligence is a type of search problem that involves two or more competing agents (players) who take turns making moves, each trying to achieve their own goal (usually to win) while the opponent tries to prevent it.

Key characteristics of a game:

  • There are two players (usually called MAX and MIN)
  • Players take turns alternately
  • The game has a terminal state (win, lose, or draw)
  • Each player tries to maximize their own utility and minimize the opponent's utility
  • The outcome depends on the actions of both players

Examples: Chess, Tic-Tac-Toe, Checkers, Go


State Space Representation (3 marks)

A state space is a way of representing a problem as a set of states, operators (actions), an initial state, and a goal state. It forms a graph where nodes represent states and edges represent transitions.

Components of State Space Representation:

ComponentDescription
StatesAll possible configurations of the problem
Initial StateThe starting configuration
Operators/ActionsRules that move from one state to another
Goal StateThe desired final configuration

Example: 8-Puzzle Problem

The 8-Puzzle consists of a 3x3 grid with 8 numbered tiles and one blank space. The goal is to reach a target arrangement by sliding tiles.

Initial State:

2 | 8 | 3
---------
1 | 6 | 4
---------
7 |   | 5

Goal State:

1 | 2 | 3
---------
8 |   | 4
---------
7 | 6 | 5

State Space Representation:

  • State: The arrangement of all 8 tiles and the blank in the 3x3 grid
  • Initial State: The given starting arrangement
  • Operators: Move blank UP, DOWN, LEFT, or RIGHT
  • Goal State: The target arrangement of tiles
  • Path Cost: Each move costs 1 (total number of moves)

Partial State Space Tree:

        [2,8,3,1,6,4,7,_,5]   <- Initial State
              |
    __________|__________
    |                   |
Move LEFT           Move UP
    |                   |
[2,8,3,1,6,4,7,5,_] [2,8,3,1,_,4,7,6,5]
                         |
                    Move LEFT / RIGHT ...
                         |
                   ... (Goal State)

Total number of possible states = 9! / 2 = 181,440 reachable states

This state space is searched using algorithms like BFS, DFS, A*, or Hill Climbing to find the path from the initial state to the goal state.

Open this answer on its own page →

Deterministic and non-deterministic environments

2079 · 5 marks

Define deterministic and non-deterministic environment. Differentiate between BFS and DFS. [2+3]

--- An environment is deterministic if the next state of the environment is completely determined by the current state and the action performed by the agent. There is no uncertainty or randomness involved. - Example: Chess, solving a maze (the outcome of each move is predictable) An environment i...

Open this answer on its own page →