Search, Game Playing and Rational Agents
State-Space Representation and Heuristic Search
| Property | Uninformed (blind) | Informed (heuristic) |
|---|---|---|
| What it uses to decide which node to expand | Only the problem's structure (BFS: shallowest first; DFS: deepest first; uniform-cost: cheapest path-cost first) | An estimate h(n) of the remaining cost to the goal, in addition to the structure |
| Typical algorithm | BFS, DFS, uniform-cost search | Greedy best-first search (uses h(n) alone); A* (uses f(n) = g(n) + h(n), actual cost so far plus estimated cost remaining) |
Game Playing: Min-Max and Alpha-Beta Pruning
Min-max models a two-player, zero-sum, perfect-information game as a tree of alternating moves: the MAX player picks the move leading to the child with the HIGHEST value, the MIN player picks the move leading to the child with the LOWEST value, and values propagate up from leaf (terminal-state) evaluations — this correctly models an adversarial opponent who always plays to minimise MAX's outcome, in contrast to an algorithm that merely assumed the opponent's moves at random. Alpha-beta pruning computes the EXACT SAME min-max value while skipping large parts of the tree that provably cannot affect the final decision: alpha is the best value MAX can guarantee so far along the current path, beta the best value MIN can guarantee — once a node's value is found to be worse than what the opponent could already force elsewhere (beta ≤ alpha), the rest of that node's children are pruned WITHOUT EXPLORING THEM, since no matter what they evaluate to, a rational opponent would never let the game reach that node in the first place.
A Worked Alpha-Beta Example and When Search Alone Is Not Enough
- Tracing alpha-beta by hand: process children left to right; at a MAX node, update alpha to the best child value found so far; at a MIN node, update beta similarly; the moment a MIN node's current beta drops to or below its ANCESTOR MAX node's alpha, stop exploring that MIN node's remaining children (a beta cutoff) — and symmetrically, a MAX node's alpha rising to or above its ancestor MIN node's beta triggers an alpha cutoff.
- Chess is a real game where the state space is so vast that even perfect search machinery is not enough on its own — depth-limited search combined with a hand-crafted or learned EVALUATION FUNCTION (estimating a non-terminal position's value without exhaustively searching to the game's actual end) is what real chess engines use, which is exactly the practical bridge between this classical search chapter and the neural-network-based evaluation approaches modern engines also draw on, covered in this unit's own artificial-neural-network chapter.
Key takeaways
- The Turing test is a behavioural criterion for intelligence; the rational agent framing (maximise a performance measure given percepts and knowledge) is broader and is what modern AI actually organises around.
- A* with an admissible heuristic (never overestimating) is guaranteed to find the optimal solution.
- Min-max propagates alternating best/worst values up a game tree; alpha-beta prunes provably-irrelevant branches, returning the exact same answer faster.
- Alpha-beta pruning changes running time, never the final decision — good move ordering roughly doubles the depth searchable in the same time.
- Real games like chess combine depth-limited search with an evaluation function, since the true state space is too vast to search exhaustively.
Practice questions (8)
Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.
The rational agent framing, compared to the Turing test, is a broader criterion because:
Show answer
Answer: A — It applies to any agent maximising a performance measure, whether or not human-like conversation is relevant
A thermostat or a self-driving car can be a rational agent without ever needing to hold a human-like conversation, which is exactly why this criterion applies far more broadly than the Turing test's conversational framing.A heuristic h(n) that is 'admissible' means:
Show answer
Answer: A — It never overestimates the true remaining cost to the goal
Admissibility (h(n) ≤ true remaining cost, always) is exactly the condition needed for A* to be guaranteed optimal, since it prevents the search from ever being falsely optimistic about a worse path.In min-max search, the MIN player chooses the move leading to:
Show answer
Answer: A — The child with the lowest value
MIN is modelled as the adversary who always plays to minimise MAX's eventual outcome, so MIN always picks whichever move leads to the lowest value among its children.Alpha-beta pruning, compared to plain min-max, is best described as:
Show answer
Answer: A — Returning exactly the same move, faster, by skipping provably irrelevant branches
Alpha-beta's pruned branches are provably irrelevant to the final decision given the same evaluation function and depth, so it always returns exactly what plain min-max would, just computed faster.Real chess engines cannot search the full game tree to the actual end of the game chiefly because:
Show answer
Answer: A — The state space is far too vast for exhaustive search, so a depth-limited search plus an evaluation function is used instead
Chess's branching factor and game length make exhaustive search computationally infeasible, so engines search only a bounded depth and estimate non-terminal positions' value with an evaluation function instead of searching all the way to a real game-ending state.Which of the following are true of uninformed (blind) search compared to informed (heuristic) search? (More than one option may be correct.)
Show answer
Answer: A — Uninformed search uses only the problem's structure, not an estimate of remaining cost; B — Breadth-first search is a standard uninformed search algorithm; D — Informed search can use a heuristic to guide which node to expand next
A* is the standard example of INFORMED search, using f(n) = g(n) + h(n); BFS is the standard uninformed example, using only the tree's shallowest-first structure with no cost estimate at all.In A* search, name the function f(n) = g(n) + h(n), where g(n) is the actual cost so far and h(n) is the estimated remaining cost.
Numerical answer — type the value.
Show answer
Answer: evaluation function
f(n) is A's evaluation function, combining the known cost so far with an estimate of what remains — when h is admissible, this combination is exactly what guarantees A finds the optimal path.A greedy best-first search, compared to A*, decides which node to expand next using:
Show answer
Answer: A — The heuristic estimate h(n) alone, ignoring the actual cost incurred so far
Greedy best-first search expands the node that looks closest to the goal by h(n) alone, which can lead it astray down a path with a low estimate but a high actual cost — exactly the shortfall A*'s f(n) = g(n) + h(n) is designed to fix.