Session 1 - Adversarial Search, and Why 25 Moves Are Really 6

A graduate AI session built around the exact gap the student reported: a lecture asserting that the 25 opening moves of 5-by-5 Isolation reduce to 6 without naming the machinery behind it. Part 1 supplies that machinery in full - the eight symmetries of the square, orbits, the reason cells on a mirror line have small orbits on an odd-sized board, and Burnside's lemma as an independent check on the count of six. The rest builds the standard adversarial search ladder on top: minimax by hand, why depth limits and evaluation functions are forced, the horizon effect, alpha-beta pruning traced through the same tree, and iterative deepening. The closing part is a reading method for spotting the difference between a missing name and a missing minute.

Subject: Artificial Intelligence · 60 slides · applied lesson

Open the interactive version of this deck · Homework for this lesson

What this lesson covers

The lesson, slide by slide

1. Adversarial Search and Game Playing

Title

Artificial Intelligence - Session 1

Why 25 moves are really 6, and everything that follows from being able to say so

2. What This Session Is For

Objectives

You described the problem precisely: the lecture introduces a concept at a granularity too coarse to commit to memory, and you then spend hours rebuilding it yourself. The Isolation symmetry reduction was your example, and you had already reconstructed the right answer alone.

What was missing was not the reasoning. It was knowing that this is a named piece of mathematics with a theorem that checks your answer, so the next time you can reach for the tool rather than rebuild it.

Russell and Norvig, Artificial Intelligence: A Modern Approach, Ch. 5 (Adversarial Search) Ch. 5 — The textbook chapter this material comes from.

3. Part 1 - Why 25 Moves Are Really 6

Section

Your example, done properly

4. The Setup

Concept

Isolation is played on a grid. Each player has one piece, moves it, and the square just vacated is removed from the board forever. A player who cannot move loses.

Consider the very first move on an empty 5-by-5 board. There are 25 empty squares, so there appear to be 25 distinct opening moves to search.

The claim in your lecture was that only 6 of them are genuinely different. That claim is correct, and it is worth being precise about what genuinely different means, because that phrase is doing all the work.

5. What Would Make Two Openings the Same?

Socratic

Before any machinery, pin down the claim. This is the question the lecture skipped.

Discussion prompt

In what sense could placing your piece in the top-left corner and placing it in the bottom-right corner be the same move?

Hint: Imagine rotating the whole board, including everything that will happen afterwards.

Answer:

They are not the same square. What is the same is the entire game that follows. Rotate the board by 180 degrees and one opening becomes the other, and every subsequent position, every legal move and the final result all map across too.

So the two openings have identical game trees, differing only in how the squares are labelled. Searching both is doing the same work twice with the coordinates relabelled.

That is the criterion: two moves are equivalent when some symmetry of the board maps one game onto the other. Everything in this part is a way of counting how many genuinely different games are left.

6. The Symmetries of a Square

Concept

A square can be picked up and put back down in exactly eight ways that leave it looking the same. That collection has a name and it is the object we are counting with.

D4 — The group of the eight symmetries of a square. Applying two of them in a row always gives a third one from the same list, which is what makes it a group.

The count of eight is the first number you need, and it is not negotiable. Any answer that does not use it is not counting correctly.

7. All Eight, Drawn on the Board

Picture it

Notice where the four lines fall on a 5-by-5 grid specifically.

Figure (svg): A five by five grid with four dashed symmetry lines drawn on it, two through the middle row and column and two along the diagonals, alongside a list of the eight symmetries.

On an odd-sized board every symmetry line runs through cells rather than between them.

That last observation is the direct answer to what confused you. On a 4-by-4 board the mirror lines fall between cells and no cell sits on one. On a 5-by-5 board, cells do sit on the lines, and those cells behave differently.

8. Orbits: the Right Word for Genuinely Different

Concept

Take one square and apply all eight symmetries to it. You get a set of squares, and every square in that set is equivalent to every other. That set is the object being counted.

Orbit — The set of all positions a given position can be moved to by some symmetry. Every square lies in exactly one orbit, and two squares are equivalent precisely when they share one.

So the question is no longer how many squares there are. It is how many orbits there are, and the answer to that is the number of genuinely different opening moves.

The trap is assuming every orbit has eight members because there are eight symmetries. Most do not, and understanding why is the whole point of the next slide.

9. How Big Is the Centre's Orbit?

Prediction

Apply all eight symmetries to the centre square of the 5-by-5 board and collect the results.

Predict first

How many distinct squares are in the orbit of the centre?

  • 8, one for each symmetry
  • 4
  • 2
  • 1

Correct: 1

Why: Every rotation about the centre leaves the centre where it is, and every reflection line passes through it, so all eight symmetries send the centre to itself. The orbit contains one square. This is the direct counterexample to the assumption that orbits have eight members, and it is only possible because the board is odd-sized and therefore has a centre cell at all.

10. Building All Six Orbits by Hand

Worked example

Work through the board from the outside in, taking one representative square at a time and applying the eight symmetries.

Start with a corner, say the top-left.

Why: The four rotations send it to the four corners, and the reflections land on corners already found, so the orbit is exactly the four corners.

Take the middle square of the top edge.

Why: Rotations carry it to the middle of each edge. Reflections map it to edge midpoints already in the set. Orbit size four.

Take an edge square that is not a midpoint, one step in from a corner.

Why: This one is not on any symmetry line, so nothing fixes it and all eight symmetries give different squares. Orbit size eight, and this is the only orbit of full size.

Move inside and take the square diagonally in from a corner.

Why: It lies on a diagonal, so the diagonal reflection through it leaves it alone. The orbit is the four such inner-diagonal squares.

Take the square directly above the centre.

Why: It lies on the vertical mirror line, so that reflection fixes it. Orbit size four, giving the four squares adjacent to the centre along the axes.

Finally take the centre itself.

Why: Fixed by everything, orbit size one, as predicted on the last slide.

\[ 4 + 4 + 8 + 4 + 4 + 1 = 25 \qquad \text{across } 6 \text{ orbits} \]

Figure (svg): The five by five board with every cell tinted by which of the six orbits it belongs to, each cell labelled with its orbit size, and a colour key listing the six orbits and their sizes.

Six colours, 25 cells. The number written in each cell is the size of the orbit it belongs to.

Verify: add the orbit sizes and check they account for every square.

Why: Four corners, four edge midpoints, eight edge off-centre, four inner diagonal, four inner axis, and one centre. That totals 25, which is every square on the board, counted exactly once. Six orbits, so six genuinely different opening moves.

11. Not Every Orbit Has Eight Members

Trap

The trap

There are eight symmetries and 25 squares, so each orbit should have eight squares in it, and the number of orbits should be 25 divided by 8.

\[ \frac{25}{8} = 3.125 \quad \text{distinct moves} \]

The answer is not a whole number, which is strange, but presumably it rounds to 3.

The fix

The arithmetic is fine and the assumption behind it is false. An orbit only has eight members if no symmetry leaves that square where it is.

A square sitting on a mirror line is unmoved by the reflection through that line, so two different symmetries send it to the same place and its orbit is smaller. The centre, fixed by all eight, has an orbit of one.

This is exactly the observation you made yourself and could not place: squares on a quadrant line behave differently, and they do so because the board has odd side length, which is what puts cells on the lines at all.

The non-integer answer was the signal. When a count that must be a whole number is not, an assumption is wrong rather than the arithmetic. The correct statement is the orbit-stabiliser relationship: orbit size times the number of symmetries fixing the square always equals eight. Corners have orbit 4 and 2 fixing them; the centre has orbit 1 and 8 fixing it.

12. The Theorem That Checks Your Answer

Concept

There is a counting theorem for exactly this, and knowing its name is the difference between rebuilding the argument for an hour and checking it in two minutes.

\[ \text{number of orbits} = \frac{1}{|G|} \sum_{g \in G} |\text{Fix}(g)| \]

In words: average the number of squares each symmetry leaves fixed, over all eight symmetries. That average is the number of orbits.

It is called Burnside's lemma, or the orbit-counting theorem. It is worth learning because it turns an error-prone enumeration into an arithmetic check you can do without drawing anything.

Burnside's lemma (the orbit-counting theorem) — counting distinct configurations under a symmetry group orbit-counting theorem — The general statement.

13. Verifying the Six with Burnside

Worked example

Count the squares each of the eight symmetries leaves exactly where it was, then average.

The identity fixes everything.

Why: Doing nothing leaves all 25 squares in place, so it contributes 25. The identity always contributes the full board, which is why it must be included.

Each of the three non-trivial rotations fixes only the centre.

Why: A rotation about the centre moves every other square, so each contributes 1, for 3 in total.

Each of the four reflections fixes the squares lying on its own line.

Why: Every mirror line on a 5-by-5 board passes through exactly 5 cells, whether it is an edge line or a diagonal. So each reflection contributes 5, for 20 in total.

\[ 25 + (1 + 1 + 1) + (5 + 5 + 5 + 5) = 48 \]

Divide by the number of symmetries.

Why: Eight symmetries, so divide the total of 48 by 8.

\[ \frac{48}{8} = 6 \]

Figure (svg): A table listing all eight symmetries of the square against the number of cells each one leaves fixed on a five by five board, totalling forty-eight, with the division by eight giving six orbits.

The whole Burnside computation on one page, with no board drawing required.

Verify: compare with the orbits enumerated by hand.

Why: The hand enumeration produced six orbits of sizes 1, 4, 4, 4, 4 and 8. Burnside produces 6 without ever listing them. Two completely independent methods, the same answer, which is as much confidence as you can get on a combinatorial count.

14. Do It for a 4-by-4 Board

Fill the middle

Same theorem, even side length, so no cell lies on any mirror line. There are 16 cells and still 8 symmetries.

Fill in the blanks

\frac3___ = ___

Why: On an even board the rotations fix nothing, because there is no centre cell. The two edge mirror lines fall between rows and columns so they fix nothing either, while the two diagonals still pass through 4 cells each. The total is 24, and dividing by 8 gives 3 orbits: corners, edges, and inner cells. Fewer orbits than the odd board, which is exactly the effect of the mirror lines no longer landing on cells.

15. What Does This Buy You?

Real world

Symmetry reduction is not a mathematical decoration. It is a performance technique.

Discussion prompt

If the opening has 6 distinct moves rather than 25, what does that do to the cost of searching the first ply, and where else does the same trick apply?

Hint: Think about what happens to everything hanging below each of those moves.

Answer:

Searching 6 opening moves instead of 25 cuts the work by roughly a factor of four, and the saving is not just at the top: every subtree below a discarded move is discarded with it.

The same idea reappears throughout the course. Transposition tables exploit the fact that different move orders reach identical positions. Canonical forms in constraint satisfaction discard symmetric variable assignments. It is one idea with several names.

The general shape is worth carrying: whenever your state space has a symmetry, search one representative per orbit and multiply the result back if you need counts.

16. The Symmetry-Reduction Recipe

Pattern

Whenever a lecture waves at collapsing equivalent states, this is the procedure it is waving at.

  1. Name the symmetry group and its size. For a square board that is D4 with 8 elements.
  2. Pick one representative from each visibly different family of positions and apply every symmetry to it.
  3. Watch for positions fixed by some symmetry, which give small orbits. On odd boards these are the cells on the mirror lines.
  4. Check the orbit sizes sum to the total number of positions. If they do not, an orbit is missing or duplicated.
  5. Cross-check the orbit count with Burnside's lemma, which needs no enumeration at all.

Steps four and five are the ones that save the hours. They are how you find out you are wrong before you have built a search on top of a wrong count.

17. Symmetry Reduction, Checked

Check

Solve it on paper before you click.

Check your understanding

On a 3-by-3 board, how many genuinely distinct opening squares are there under the eight symmetries of the square?

  • A. 9
  • B. 3 (correct)
  • C. 4
  • D. 2

Answer: B

Why: The nine cells fall into three orbits: the four corners, the four edge midpoints, and the single centre. Burnside confirms it: the identity fixes 9, each of the three rotations fixes only the centre for 3 more, and each of the four reflections fixes the 3 cells on its line for 12 more, giving 24, and 24 divided by 8 is 3.

Why A tempts people
Nine is the raw cell count with no reduction applied at all, which is the number symmetry reduction exists to shrink.
Why C tempts people
Four would be right if the centre split into two families or if a corner and an edge cell were somehow distinguishable, but neither happens on a square board.
Why D tempts people
Two comes from merging corners with edge midpoints. They are genuinely different: no rotation or reflection ever carries a corner to an edge midpoint.

18. Each Symmetry, and What It Leaves Alone

Matching

This is the table Burnside's lemma consumes. Building it is the only real work in the theorem.

Match the pairs

  • y1. the identity
  • y2. rotation by 90 degrees
  • y3. reflection through the middle row
  • y4. reflection through a diagonal
  • f1. fixes all 25 cells
  • f2. fixes only the centre cell
  • f3. fixes the 5 cells of the middle row
  • f4. fixes the 5 cells along that diagonal

Why: The identity moves nothing, so it fixes everything, and forgetting to include it is the most common Burnside error. A rotation about the centre moves every cell except the centre itself. A reflection fixes exactly the cells lying on its own mirror line, and on a 5-by-5 board every mirror line runs through 5 cells, diagonals included.

19. A Plausible Wrong Count

Error analysis

A student's Burnside attempt. The method is right and the answer is wrong.

Annotate

On: \( \frac{(1 + 1 + 1) + (5 + 5 + 5 + 5)}{8} = \frac{23}{8} \)

  • The rotations are counted correctly at 1 fixed cell each, and the reflections correctly at 5 each.
  • The identity has been left out. It is a symmetry, it belongs in the sum, and it contributes the full 25.
  • The missing 25 is why the total came to 23 instead of 48, and why the division gave a fraction.
  • The non-integer answer is the alarm. Burnside always returns a whole number, so a fraction means a symmetry was miscounted or omitted rather than that the situation is unusual.

Include the identity every single time. It contributes the largest term in the sum and it is the easiest one to forget precisely because it does nothing.

20. The Game Itself, Briefly

Concept

Worth stating so the search in the next part has something concrete underneath it.

Because the board shrinks monotonically, the game cannot repeat positions or run forever. That guarantee is what makes the game tree finite and therefore searchable in principle, even though it remains far too large to search exhaustively.

21. Part 2 - Minimax

Section

The algorithm the reduction was speeding up

22. Two Players, Opposite Goals, One Number

Concept

Adversarial search assumes two players who alternate moves and want opposite things. One is trying to maximise a score and the other to minimise the same score, which is why a single number can describe the whole position.

Ply — One move by one player. A full round of both players is two plies, and mixing up plies with rounds is the most common depth-reporting error there is.

The game tree alternates between layers. On a MAX layer it is our turn and we choose the best available child. On a MIN layer it is the opponent's turn and they choose the worst child from our point of view.

Values are computed at the leaves and flow upward, each layer taking a maximum or a minimum. The value that reaches the root is the value of the position assuming both sides play optimally.

23. A Game Tree With Values Backed Up

Picture it

Three opponent replies to each of our three moves. Read it bottom to top.

Figure (svg): A game tree with a MAX root, three MIN nodes beneath it, and nine leaf values, showing the minimum taken at each MIN node and the maximum taken at the root to give a value of three.

Leaves are evaluated positions. MIN layers take the smallest child, the MAX root takes the largest.

The root value is 3, and the move to play is the one leading to the MIN node that produced 3. Minimax returns both a value and the move that achieves it.

24. Running Minimax by Hand

Worked example

The same tree, computed explicitly, because doing it once by hand is worth more than reading the pseudocode three times.

Evaluate the leaves. There is nothing to compute here, they are given.

Why: In a real search these come from either a terminal outcome or an evaluation function, which is the subject of Part 3.

Take the minimum at each MIN node.

Why: The opponent chooses among the children, and by assumption chooses whichever is worst for us, which is the smallest number.

\[ \min(3, 12, 8) = 3, \qquad \min(2, 4, 6) = 2, \qquad \min(14, 5, 2) = 2 \]

Take the maximum at the MAX root.

Why: We choose among the three MIN values, and we want the largest, because that is the best outcome available once the opponent has replied as well as they can.

\[ \max(3, 2, 2) = 3 \]

Figure (svg): The nine-leaf game tree with the three minimum values marked at the MIN layer and the maximum of those marked at the root as three.

The three MIN values are 3, 2 and 2. The root takes the largest of those.

Verify: sanity-check against the largest leaf on the board.

Why: The largest leaf anywhere is 14, and the root value is 3, far below it. That is correct rather than suspicious: 14 sits under a MIN node whose smallest child is 2, so the opponent would simply never let us reach it. A root value equal to the best leaf would be the actual warning sign, because it would mean the opponent was being ignored.

25. Why Not Just Take the Best Leaf?

Anomaly

The tree contains a 14. Minimax returns 3.

Predict first

Why does the algorithm ignore a leaf worth more than four times the value it reports?

  • Because 14 is too deep in the tree to reach
  • Because the opponent chooses which of our moves' consequences we get, and would never pick 14
  • Because minimax always returns the middle value
  • Because 14 must be an evaluation error

Correct: Because the opponent chooses which of our moves' consequences we get, and would never pick 14

Why: The 14 sits under a MIN node alongside a 5 and a 2. If we play the move leading there, the opponent picks from those three and takes the 2. We never get to choose the 14, because it is not our choice to make. This is the entire content of the min layer: outcomes we would love are worthless if somebody else picks.

26. The Assumption Underneath

Explain it to yourself

Minimax rests on one assumption about the opponent, and it is worth stating out loud.

Discussion prompt

What exactly does minimax assume about how the opponent plays, and what happens if that assumption is wrong?

Hint: What does taking the minimum at every MIN node imply about their skill?

Answer:

It assumes the opponent plays optimally: at every turn they find and take the move that is worst for us. It never assumes they will blunder.

If they play worse than optimally, the actual result is at least as good as minimax predicted. The value is a guaranteed floor rather than a prediction, which is a genuinely useful property.

The cost is that minimax will not set traps. A move that wins outright against a weak opponent but loses against a perfect one is rejected, because the algorithm only considers the perfect reply. That is why engines facing weak opponents sometimes use different criteria.

27. Why the Tree Cannot Be Searched to the End

Concept

Minimax as described searches to terminal positions. For anything but a toy game, that is not remotely possible, and the reason is pure arithmetic.

\[ \text{nodes at depth } d \approx b^{\,d} \]

With a branching factor of 8, each additional ply multiplies the work by 8. Ten plies is over a billion positions, and games run far longer than ten plies.

So every practical game player does two things: it stops early, and it guesses the value of the positions where it stopped. Those two compromises are the subject of the next part.

28. The Growth Is the Whole Problem

Picture it

Branching factor 8, one bar per ply. Note the scale rather than the shape.

Figure (svg): A bar chart showing node counts at increasing search depths with a branching factor of eight: 8, 64, 512, 4096 and 32768.

Five plies is already over thirty thousand positions, and five plies is shallow.

This picture is why symmetry reduction from Part 1 mattered, and why alpha-beta in Part 4 matters more. Every technique in this deck is an attack on this graph.

29. Three Minimax Claims Are False

Two truths and a lie

Four statements about what minimax does. One survives.

Eliminate the wrong options

Rule out the three that misstate the algorithm, and keep the one that is correct.

  • m1. Minimax returns the value the position has if both sides play optimally.
  • m2. Minimax finds the move most likely to win against a typical opponent.
  • m3. Minimax takes the maximum at every layer, since we always want the best.
  • m4. Minimax needs an evaluation function to work.

Survives elimination: m1

Why: The first is the definition. The value returned is what the position is worth under optimal play by both sides, which makes it a guaranteed floor rather than a prediction of what will happen against a particular opponent.

30. Order These by Search Cost

Ranking

Branching factor 8 throughout. Cheapest first.

Put in order

  1. 4 plies with perfectly ordered alpha-beta
  2. 2 plies of full minimax
  3. 4 plies of full minimax
  4. 6 plies of full minimax

Why: Perfectly ordered alpha-beta at depth 4 costs about 8 to the power 2, which is 64, making it the cheapest of the four and equal in cost to plain minimax at depth 2 while seeing twice as far. Plain minimax costs 64, then 4096, then 262144. The ordering of the first two is the entire argument for alpha-beta: it buys depth 4 at the price of depth 2.

31. Before Reading On

Warm-up

Predict, then check yourself against the next few slides.

Discussion prompt

Pure minimax searches all the way to the end of the game. Isolation on a 5-by-5 board is small. Could you search it exhaustively?

Hint: How many squares are removed per move, and how long can the game run?

Answer:

Each move removes one square, so a game lasts at most about 25 plies. With a branching factor of roughly 8 early on, a full tree is somewhere near 8 to the power 25, which is astronomically large.

The branching factor does fall as the board shrinks, so the true count is far below that bound, and 5-by-5 Isolation has in fact been solved. But the estimate makes the point: even a tiny board explodes, and the standard board sizes used in the course certainly cannot be searched exhaustively.

That is why every remaining technique in this deck exists. All of them attack the same exponent from different directions.

32. Part 3 - Cutting Off and Guessing

Section

What to do when you cannot reach the end

33. The Evaluation Function

Concept

If the search stops before the game ends, the positions where it stopped are not wins or losses, so something has to estimate how good they are.

Evaluation function — A cheap estimate of how favourable a non-terminal position is, standing in for the true minimax value that would be too expensive to compute.

A good evaluation function correlates with the true value, is fast enough to run millions of times, and returns larger numbers for positions better for the maximising player.

It does not need to be accurate in an absolute sense. It only needs to rank positions correctly, because the search only ever compares.

34. The Standard Isolation Evaluation

Notation

This is the baseline heuristic for Isolation and it is worth understanding rather than memorising.

Annotate

On: \( \text{eval}(s) = \#\text{my legal moves} - \#\text{opponent legal moves} \)

  • Mobility is the resource in Isolation. Losing means having no moves, so having more moves than the opponent is the natural thing to measure.
  • Subtracting rather than only counting our own moves makes the number adversarial: a position is good if we have options and the opponent does not.
  • It is cheap. Generating legal move counts for both players is far less work than searching further, which is exactly what an evaluation function must be.
  • It is also crude. It ignores whether our moves lead anywhere and whether the board is about to split into two separate regions, which is often what actually decides the game.

Improving this function is the usual assignment. The improvements that work tend to weight the opponent's mobility more heavily, or add board-partition detection late in the game.

35. Judging Evaluation Functions

Comparison

Fill the missing cells. All three are legal; they are not equally useful.

Comparison matrix

CandidateCheap to computeCorrelates with winning
always return 0yesno, ranks nothing
my moves minus opponent movesyesreasonably
run a full minimax to the endno, that is the thing we cannot affordperfectly

The middle row is the whole design problem: evaluation functions live on a trade-off between accuracy and cost, and the best one is not the most accurate but the most accurate you can afford to run at the depth you want.

36. The Horizon Effect

Trap

The trap

The search looks four plies ahead and the evaluation at that depth is strongly favourable, so the move is good.

Reasoning: deeper search is better and four plies is a reasonable depth, so the estimate is reliable.

The fix

A fixed cutoff cannot see disasters that lie one ply beyond it. A position can look excellent at depth four and be lost at depth five, and the search has no way to know.

Worse, the search can learn to hide bad news. Faced with an unavoidable loss just past the horizon, it will happily play pointless delaying moves that push the loss beyond the cutoff, because from inside the horizon the position then looks fine.

This is the horizon effect, and it is a structural consequence of stopping at a fixed depth rather than a bug in any particular evaluation function.

The standard mitigations are to search further along volatile lines rather than stopping mid-exchange, and to use iterative deepening so the depth is set by the clock rather than fixed in advance.

37. What If the Evaluation Function Is Perfect?

Edge cases

Push it to the edge to see what the search is really contributing.

Discussion prompt

Suppose you had an evaluation function that returned the exact true minimax value of any position. How deep would you then need to search?

Hint: What would you learn from looking at the children?

Answer:

One ply. Evaluate each of your legal moves with the perfect function and take the best. No deeper search would tell you anything you did not already know.

That reframes what search is for: it is compensating for the evaluation function being imperfect. Every ply of search is buying a bit more accuracy from a cheap approximation.

It also explains the engineering trade-off. A slightly better evaluation function that halves your search speed may be a net loss, because you traded a ply of depth for a small gain in accuracy, and the ply may have been worth more.

38. Which Features Belong in an Evaluation Function?

Sorting

For Isolation specifically. The test is whether it is both cheap and informative.

Sort into buckets

Sort each candidate feature by whether it earns its place.

Useful and affordable
number of legal moves available to me; number of legal moves available to the opponent; whether the board has split into two separate regions; my distance from the centre of the board
Useless or unaffordable
the true minimax value of the position; how many squares have been removed so far
keep
Each of these is cheap to compute and carries real information about who is winning. Mobility on both sides is the core signal, board partition often decides the endgame outright, and central position tends to preserve future mobility.
drop
The true minimax value is exactly the thing that is too expensive to compute, which is why an evaluation function exists at all. Squares removed is the same for both players at any point in the game, so it cannot distinguish a winning position from a losing one.

The removed-squares item is the instructive one. It is cheap and it is real information about the game, and it is still useless, because it does not differ between the two players.

39. Can a Better Evaluation Function Make You Weaker?

Counterexample

Two engines, identical search code, same time per move.

\[ \text{A: fast, crude eval} \qquad \text{B: accurate eval, 4 times slower} \]

Discussion prompt

B judges positions better. Can A still be the stronger player, and how?

Hint: What does being four times slower cost, measured in plies?

Answer:

Yes, easily. At branching factor 8, a four-times slowdown costs a little over two thirds of a ply of depth once you account for alpha-beta, and in practice engines report losing roughly a ply for a slowdown of that size.

A ply of extra depth is usually worth more than a modest improvement in evaluation accuracy, because the extra ply resolves tactics concretely while the better evaluation only guesses better.

This is why evaluation functions in real engines are written to be brutally cheap. The right question is never is this feature informative, it is is this feature worth the depth it costs, and that is an empirical question you settle by playing the two versions against each other.

40. Part 4 - Alpha-Beta Pruning

Section

Getting the same answer for far less work

41. The Observation Behind Pruning

Concept

Alpha-beta is not an approximation. It returns exactly the same value as minimax, and it does so by declining to examine branches that provably cannot affect the result.

Alpha — The best value the maximising player is already guaranteed somewhere higher in the tree.

Beta — The best value the minimising player is already guaranteed somewhere higher in the tree.

The rule: while exploring a MIN node, if it is already worth no more than alpha, stop. The maximising player has a better option elsewhere and will never choose this branch, however the unexplored children turn out.

42. Pruning the Tree From Part 2

Worked example

The same tree, left to right, tracking what is already guaranteed.

Explore the first MIN node fully.

Why: Its children are 3, 12 and 8, so its value is 3. There was nothing known before it, so nothing could have been pruned here.

\[ \alpha = 3 \quad \text{after the first branch} \]

Move to the second MIN node and look at its first child, which is 2.

Why: This node takes a minimum, so its final value is at most 2. It can only go down from here as more children are examined.

Compare with alpha and stop.

Why: The maximising player already has 3 in hand. This branch can deliver at most 2, so it will never be chosen, and its remaining children cannot change that. They are not evaluated at all.

\[ 2 \le \alpha = 3 \;\Longrightarrow\; \text{prune the remaining children} \]

Explore the third MIN node.

Why: Its children are 14, 5 and 2, giving 2. That is also below alpha, but the cutoff only triggers once a child has been seen that proves it, and here the deciding child is the last one anyway.

Verify: confirm the root value is unchanged.

Why: The root is the maximum of 3, at-most-2 and 2, which is 3, exactly what full minimax returned. Two leaves were never evaluated and the answer is identical, which is the guarantee alpha-beta makes.

Figure (svg): The same game tree with the second and third children of the middle MIN node crossed out and marked as never evaluated, while the root value remains three.

Two leaves skipped on a nine-leaf tree. On a real tree the saving compounds at every level.

43. Does Order Matter?

Prediction

Suppose the children of the second MIN node had been ordered 6, 4, 2 instead of 2, 4, 6.

Predict first

What happens to the pruning?

  • The same two leaves are pruned
  • Nothing is pruned there, because no early child falls at or below alpha
  • All three are pruned
  • The root value changes

Correct: Nothing is pruned there, because no early child falls at or below alpha

Why: With 6 first the node is at most 6, which is still above alpha of 3, so the search must continue. After 4 it is at most 4, still above 3, so it continues again. Only after the final 2 does the value drop to 3 or below, and by then everything has been examined. The root value is unchanged at 3, because alpha-beta never changes the answer, only the amount of work.

44. Move Ordering Is Worth a Doubling of Depth

Concept

The previous slide shows the whole story: alpha-beta's savings depend entirely on examining good moves first, because a strong early value raises alpha and makes later cutoffs possible.

\[ \text{worst case } O(b^{\,d}), \qquad \text{best case } O\!\left(b^{\,d/2}\right) \]

In the best case the exponent halves, which means that in the same time budget you can search roughly twice as deep. Doubling depth is an enormous gain in playing strength.

You cannot know the best order in advance, which is the obvious objection. The standard answer is to search shallowly first and use what you learn to order the deeper search, which is what iterative deepening does.

45. Iterative Deepening

Concept

Rather than choosing a depth in advance, search to depth one, then depth two, then depth three, until the clock runs out, and play the best move from the deepest completed search.

The last point is the one that surprises people. With a branching factor of 8, everything shallower than the final level adds only about a seventh again on top of it, so re-searching is close to free.

46. Is Re-Searching Wasteful?

Estimation

Branching factor 8. You search depth 1, then 2, then 3, then 4, keeping every pass.

Predict first

Roughly how much extra work is that compared with searching depth 4 directly?

  • About four times as much
  • About twice as much
  • Roughly a seventh extra
  • About the same as depth 3 alone

Correct: Roughly a seventh extra

Why: The nodes form a geometric series dominated by its last term. Depths 1 through 3 total 8 plus 64 plus 512, which is 584, against 4096 at depth 4 alone, so the earlier passes add about fourteen percent. That overhead is much smaller than the pruning improvement the move ordering buys, which is why iterative deepening is standard rather than a compromise.

47. Alpha-Beta, Precisely

Check

Solve it on paper before you click.

Check your understanding

Which statement about alpha-beta pruning is correct?

  • A. It finds a slightly worse move than minimax but much faster
  • B. It returns the same value as minimax while examining fewer nodes (correct)
  • C. It only works when the evaluation function is perfect
  • D. It reduces the branching factor of the game

Answer: B

Why: Alpha-beta is exact. It skips only branches that provably cannot change the root value, so its result is identical to full minimax while touching fewer nodes. How many fewer depends on move ordering, which ranges from no saving at all to halving the effective exponent.

Why A tempts people
This describes an approximation. Alpha-beta makes no accuracy trade at all, which is precisely what makes it so widely used.
Why C tempts people
The evaluation function is irrelevant to the pruning argument, which depends only on comparisons between values already computed.
Why D tempts people
The branching factor is a property of the game and does not change. What changes is how many of those branches get examined.

48. Watch Alpha Climb

Invariant

Step through the tree from Part 2 left to right, tracking the best value the maximiser has secured so far.

Step through it

At which step does alpha first become large enough to prune something?

  1. Before anything is examined the maximiser has secured nothing, so alpha starts at minus infinity and no cutoff is possible.
  2. The first branch resolves to 3, so the maximiser now has 3 guaranteed. Alpha becomes 3.
  3. The second branch's first child is 2. Since that branch takes a minimum it can only end at 2 or lower, which is already no better than the 3 in hand.
  4. So the rest of that branch cannot change the root and is skipped. Alpha is unchanged, because nothing better was found.

Alpha only ever rises and beta only ever falls. That monotonicity is what makes the cutoff argument sound, and it is worth checking in any trace you produce.

49. Complete the Cutoff Condition

Faded example

Fill in the comparison and the consequence.

Fill in the blanks

\textis less than or equal to \;stop and return, skipping the remaining children\; \alpha, \text___ ___

Why: A MIN node's value can only fall as more children are examined, so once it is already no better than what the maximiser has secured elsewhere, no remaining child can rescue it. The maximiser will never choose this branch, so the rest of it is irrelevant to the root value and can be skipped entirely.

50. Transposition Tables, and Why They Are Part 1 Again

Concept

One more standard technique, included here because it is the same idea as the symmetry reduction wearing different clothes.

Transposition — Two different sequences of moves that arrive at exactly the same position. The subtree below them is identical, so searching both is duplicated work.

A transposition table stores positions already searched along with their values, so the second arrival is a lookup rather than a search. In games where move order is flexible this can save a large fraction of the tree.

Notice the shape: identify states that are genuinely the same, keep one representative, and reuse the result. That is precisely what orbits did for the opening moves, applied to a different equivalence.

51. What Each Technique Buys and Costs

Trade off

Fill the missing cells. These stack, and each one attacks the exponent differently.

Comparison matrix

TechniqueWhat it savesWhat it costs
symmetry reductionduplicate subtrees at the rootcode to canonicalise positions
alpha-betabranches that cannot change the answernothing, the answer is exact
transposition tablere-searching repeated positionsmemory, plus hashing every position
depth limit plus evaluationthe entire tail of the gameaccuracy, and the horizon effect

Only the last row trades away correctness. The first three are pure savings, which is why they are applied first and unconditionally.

52. Part 5 - The System You Asked For

Section

How to stop losing hours to a glossed-over paragraph

53. What Actually Went Wrong With the Lecture

Concept

It is worth naming the failure precisely, because the fix follows from the diagnosis rather than from studying harder.

The lecture asserted a result, that 25 becomes 6, without naming the structure that produces it. You could see the result was true, could not see why, and reconstructed the argument yourself over several hours.

The reconstruction was correct and the time was mostly wasted, because the missing piece was a name. Once you know the words orbit and Burnside's lemma, the same result is a two-minute check.

So the skill to build is not more reconstruction. It is recognising the moment a source has asserted a result without naming its machinery, and going and finding the name.

54. Which Gaps Are Worth Chasing?

Discrimination

Not every unexplained step deserves an hour. Sorting them is the time-management skill.

Sort into buckets

Sort each kind of gap by what it deserves.

Chase it - a name is missing
a result asserted with no named technique behind it; a term used as though previously defined, that was not; a claim that some cases are equivalent, with no criterion given
Note and move on
an algebraic step you could redo yourself in two minutes; a numerical constant specific to one example; a notation choice that differs from the textbook's
chase
Each of these hides a named concept you will meet again. The symmetry reduction was of exactly this kind, and so is any unexplained claim that two things are the same, because equivalence always rests on a criterion somebody has named.
skip
These are local to one example. Redoing the algebra teaches you nothing new, and a constant or a notation choice will not reappear as a concept. Write the question in the margin and keep reading.

55. Reading a Lecture Section Without Losing an Evening

Pattern

A pass structure that suits how you said you learn, which is by writing things out and drawing them.

  1. First pass, no notes. Read or watch the whole section for shape only. Do not stop at anything.
  2. Second pass, mark only. Underline every asserted result and every claim that two things are equivalent. Do not chase any of them yet.
  3. Third pass, sort. For each mark, decide missing name or missing minute. The names go on a short list; the minutes get done immediately.
  4. Fourth pass, one name at a time, on the smallest example you can build. A 3-by-3 board, a three-leaf tree, a two-variable problem.
  5. Fifth pass, write it in your own words with the picture beside it, and add the check that proves you are right.

The fourth step is where the leverage is. You solved the 5-by-5 case, which is hard. The 3-by-3 case has the same structure, is small enough to enumerate completely, and would have taken minutes.

56. Diagnose Another Student's Time Sink

Explain it

A classmate spent four hours on a constraint satisfaction lecture and still cannot state the main result.

Discussion prompt

They tell you the lecture said many assignments are equivalent so we only consider one of each. What should they go and look up, and what small example should they build?

Hint: You have already met this exact shape once in this deck.

Answer:

It is the same pattern as the Isolation reduction: a claim of equivalence with no criterion given. The name to look up is symmetry breaking in constraint satisfaction, and underneath it is the same idea of orbits under a group action.

The small example: a map-colouring problem with three regions and three colours. Every colouring can be recoloured by permuting the colour names, so the assignments come in orbits of size six under the six permutations, and you can enumerate the whole thing on one page.

Four hours became one lookup and one small drawing. The transferable move is noticing that any lecture saying we only consider one of each is asserting an equivalence and owes you a criterion.

57. Budgeting the Week

Estimation

You are working full time and taking one 3-credit course. Assume roughly nine hours a week of study is realistic.

Predict first

Given the five-pass reading method, where should the largest single block of that time go?

  • The first pass, reading everything slowly and carefully
  • The fourth pass, working the marked names on small examples
  • The second pass, marking assertions
  • Rewatching the lecture until it makes sense

Correct: The fourth pass, working the marked names on small examples

Why: Passes one through three are fast by design and exist only to produce a short, sorted list. The fourth pass is where understanding is actually built, and it is the one that replaces the hours you were losing to unguided reconstruction. Rewatching is the worst use of the time, because the gloss that lost you the first time is still there on the second viewing.

58. Your Page for This Week

Connect it up

One page, built the way you said you learn best, on paper.

Draw it

Draw the 5-by-5 board and colour the six orbits. Beside it write the eight symmetries and, for each, how many cells it fixes, then the Burnside sum and the division by eight. Underneath, draw the nine-leaf minimax tree with its backed-up values, and mark the two leaves alpha-beta prunes. In the margin write the three questions this session did not answer for you. Bring the page and the questions to the next session.

The margin questions are the agenda for next time. They are the highest-value thing you can bring, because they are the gaps you found rather than the ones I guessed at.

59. One Question Before You Close

Exit ticket

The transferable idea, rather than the specific count.

Predict first

A lecture says two configurations are equivalent and we only search one of them. What is the lecture obliged to have told you, and what should you go and find if it did not?

  • The number of configurations, which you can count yourself
  • The criterion for equivalence, which means naming the symmetry group acting on the states
  • The running time of the algorithm
  • Nothing further, since equivalence is self-evident from the pictures

Correct: The criterion for equivalence, which means naming the symmetry group acting on the states

Why: Equivalence is never self-evident. It is always relative to some set of transformations you are allowed to apply, and until that set is named, you cannot count the classes or check your count. Once the group is named, the orbits are well defined and Burnside's lemma gives you an independent verification. That is the whole lesson of Part 1, and it generalises well past game playing.

60. What You Can Do Now

Recap

Six things, and one habit.

when a source saysthe name to go and find
these configurations are equivalentgroup action, orbits, Burnside's lemma
we search only one of eachsymmetry breaking, canonical forms
we stop early and estimateevaluation function, horizon effect
this branch cannot matteralpha-beta pruning
we search deeper as time allowsiterative deepening

The habit: when a lecture asserts a result without naming the machinery, that is a missing name rather than a missing minute. Find the name before rebuilding the argument, and build your example small enough to enumerate completely.

Georgia Tech CS 6601, Artificial Intelligence — Game Playing and the Isolation assignment Game Playing — The assignment this material supports.

Sources

  1. Russell and Norvig, Artificial Intelligence: A Modern Approach, Ch. 5 (Adversarial Search)
  2. Burnside's lemma (the orbit-counting theorem) — counting distinct configurations under a symmetry group
  3. Georgia Tech CS 6601, Artificial Intelligence — Game Playing and the Isolation assignment
  4. Every board count, orbit size, minimax value and pruning claim in this deck derived by hand and cross-checked. — Verified 2026-08-28.

Want this taught 1-on-1? Alexander tutors Artificial Intelligence — $55/session, free consultation.

Book on Wyzant · Text (657) 465-8108