BIT252 ยท 2080 ยท 5 marks
Define game. Give a state space representation of any problem you know.
Define game. Give a state space representation of any problem you know. [5]
Quick answer
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.
Game and State Space Representation
Definition of Game (2 marks)
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:
| Component | Description |
|---|---|
| States | All possible configurations of the problem |
| Initial State | The starting configuration |
| Operators/Actions | Rules that move from one state to another |
| Goal State | The 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.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.