1. Home
  2. Explore
  3. Computer Science
  4. Computers and Chess

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Computers and Chess

Game-Playing Programs, Search, and Intelligence

Chess as a test of machine intelligence

The history of computer chess illustrates that success at a task does not necessarily mean that a computer solves it in the same way a person does. In the early 1960s, philosopher Hubert Dreyfus argued that computers could not play chess. After losing to an early chess machine, he became the subject of a rebuttal titled “Dreyfus Can’t Play Chess Either.” The episode highlighted a distinction between whether a computer can play chess and whether it can play the way a human plays chess.

A later wager proposed that no computer would defeat the world chess champion within ten years. Although computers eventually did defeat the champion, the underlying debate remained: a computer could win by searching and calculating in ways unlike human thought. Deep Blue’s 1997 victory over the world champion demonstrated the power of this computational approach, but it did not establish that the system reasoned like a human chess master.

Games are useful for studying intelligence because they require a system to choose actions, anticipate an opponent’s responses, and adapt to changing situations. A game-playing program can therefore demonstrate a kind of intelligence, even if its methods differ substantially from human cognition.


Approaches to choosing a move

Human-like board analysis

A human-like program might describe a position using concepts such as:

  • Pawn structure

  • King safety

  • Whether castling is advisable

  • Strategic plans and tactical opportunities

It would combine these assessments to select a move. However, building a program that genuinely reasons with this kind of broad chess understanding is difficult. The approach depends on knowledge and judgment that are hard to specify formally.

If-then rules

A simpler approach is to inspect the board and choose a move according to rules such as:

If the queen’s pawn can move forward one square, then move it forward.

A rule-based program can generate the legal moves, rank them according to rules, and choose the highest-ranked option. However, a rule that selects a move based only on the current board does not examine the consequences of that move. This makes it difficult to build a strong chess player using simple rules alone.

Rule-based methods can still work reasonably well in less complex settings. For example, a checkers program can inspect available moves, rank them, and select the best according to its rules. The approach is less powerful when the game requires deep strategic planning.

Lookahead and evaluation

A stronger approach considers the consequences of possible moves. The program:

  1. Generates possible moves.

  2. Examines the resulting positions and possible responses.

  3. Estimates how favorable those positions are.

  4. Chooses a move based on the expected outcome.

This method requires a way to evaluate board positions, as well as a way to decide how far ahead to search.


Static evaluation

A static evaluation assigns a value to a board position without searching further into its future consequences. It may use features such as king safety, pawn structure, and material balance. Each feature contributes information about the position, and the program combines these features into an overall score.

A common form is a linear evaluation function:

g(f1,f2,…,fn)=c1f1+c2f2+⋯+cnfng(f_1, f_2, \ldots, f_n) = c_1f_1 + c_2f_2 + \cdots + c_nf_ng(f1​,f2​,…,fn​)=c1​f1​+c2​f2​+⋯+cn​fn​

Here, each fif_ifi​ is a feature of the position, and each cic_ici​ is a weight indicating the feature’s importance. The resulting score estimates the position’s value from the perspective of the player being evaluated.

The program does not necessarily need numerical scores. It only needs a way to compare positions and decide which it prefers. Numerical scoring is one practical way to make that comparison.

Static evaluation is most useful when applied to positions at the ends of a search. By itself, it does not reveal what will happen after a move; it estimates the quality of a position as it currently stands.


Search trees and the cost of brute force

A game tree represents possible sequences of moves. Each level represents another move in the sequence, and each node represents a resulting board position.

Two measures describe the size of a search tree:

  • Branching factor, bbb: the average number of choices available at each position.

  • Depth, ddd: the number of move levels searched.

With a constant branching factor, the number of leaf positions at depth ddd is:

bdb^dbd

A brute-force strategy would examine every possible sequence of moves, potentially through an entire game. This approach is infeasible for chess. A typical game may involve about 50 moves by each player, or roughly 100 individual moves, and the average branching factor is often estimated at around 14 or 15. The resulting tree is commonly estimated to contain about:

1012010^{120}10120

leaf positions.

The scale can be illustrated by comparing that number with a very generous hypothetical computer. Suppose every atom in the universe performed one evaluation every nanosecond throughout the universe’s history. Using approximate values:

  • Atoms in the universe: 108010^{80}1080

  • Nanoseconds in a year: about π×1016\pi \times 10^{16}π×1016

  • Years in the universe’s history: about 101010^{10}1010

That gives roughly 1010610^{106}10106 evaluations—still about 14 orders of magnitude short of 1012010^{120}10120. Thus, even immense computing resources cannot make exhaustive search of the full chess tree practical.


Minimax search

Because a chess opponent actively tries to prevent a favorable outcome, a program must account for the opponent’s choices. Minimax models this adversarial structure by assuming that each player chooses the move most favorable to their own goal.

The two roles are:

  • Maximizing player: seeks the highest possible score.

  • Minimizing player: seeks the lowest possible score, from the maximizer’s perspective.

Minimax works from the bottom of a searched tree upward:

  1. Assign static evaluations to the leaf positions.

  2. At each minimizing node, select the smallest value among the available children.

  3. At each maximizing node, select the largest value among the available children.

  4. Continue backing up values until the root position is reached.

  5. Choose the move at the root that leads to the backed-up value.

For example, suppose the maximizing player can choose between two branches. In the first branch, the minimizing player can force an outcome worth either 2 or 7, so the minimizer chooses 2. In the second branch, the minimizer can force an outcome worth either 1 or 8, so the minimizer chooses 1. The maximizer then chooses the first branch because 2 is better than 1.

The resulting outcome is a compromise produced by opposing goals. The maximizer does not necessarily reach the highest score at a leaf, because the opponent chooses responses that interfere with that goal.

Ordinary minimax requires examining all leaves at the chosen depth. Its cost therefore grows exponentially with depth, proportional to bdb^dbd.


Alpha-beta pruning

Alpha-beta pruning improves minimax by recognizing when parts of the search tree cannot affect the final decision. It is not an alternative to minimax and does not change minimax’s answer. It avoids unnecessary work while preserving the same result.

The algorithm tracks two bounds:

  • Alpha, α\alphaα: the best value the maximizing player can already guarantee.

  • Beta, β\betaβ: the best value the minimizing player can already guarantee.

A branch can be pruned when the search shows that the player considering it would never choose it.

For example:

  1. The maximizer has already found a move worth at least 2.

  2. In another branch, the minimizer can force the value down to 1 or less.

  3. The maximizer would never choose that branch, because the known alternative is better.

  4. The remaining positions in the inferior branch do not need to be evaluated.

In some cases, the algorithm can avoid not only static evaluations but also generating further moves in a branch. Such a cutoff can occur between nodes that are not immediately adjacent in the tree, sometimes called a deep cutoff.

The effectiveness of alpha-beta pruning depends partly on move ordering. If promising moves are examined early, the algorithm is more likely to find bounds that eliminate later branches.

Computational benefit

With ideal move ordering, alpha-beta can reduce the number of evaluations required at depth ddd to approximately:

2bd/22b^{d/2}2bd/2

The constant factor is less important than the change from a search whose exponent is ddd to one whose exponent is about d/2d/2d/2. This can allow a program to search roughly twice as deeply using a similar amount of work. In practical play, the savings depend on the tree and move ordering, but alpha-beta pruning remains highly valuable.


Progressive deepening and anytime search

A game program usually has a limited amount of time for each move. Because the size of the search tree depends on the position, the program may not know in advance how deeply it can search before its time runs out.

A fixed-depth search creates two risks:

  • The program may stop early, leaving computation unused.

  • It may run out of time before completing the search and have no reliable move ready.

Progressive deepening addresses both problems. The program searches repeatedly to increasing depths:

  1. Search to depth 1 and store the best move found.

  2. Search to depth 2 and update the move.

  3. Continue to greater depths while time remains.

  4. If time runs out, return the best move from the deepest completed search.

This makes the program an anytime algorithm: it can return a usable answer whenever it is interrupted, and the answer generally improves as more computation becomes available.

The extra cost of completing shallower searches is relatively small compared with the deepest search. For example, the number of positions at depth d−1d-1d−1 is about 1b\frac{1}{b}b1​ of the number at depth ddd. When bbb is around 10, a search at the preceding depth costs about 10% as much as the deepest one. Searching every shallower depth adds a geometric series of work, but the total is still on the order of the deepest search rather than multiplying the cost dramatically.

Progressive deepening can also improve alpha-beta pruning. The best moves found at shallower depths can be searched first at greater depths. Better move ordering makes cutoffs more likely, further reducing computation.


Uneven search

A search need not stop at the same depth along every branch. Some positions are relatively stable, while others are especially uncertain or dynamic. For example, if a capture may occur on the next move, a static evaluation at the current depth may give a misleading picture.

An uneven search extends selected branches farther when the position warrants additional analysis. The goal is not simply to search every line to a fixed depth, but to build a tree that provides greater confidence in the evaluations that matter most.

This strategy complements minimax, alpha-beta pruning, and progressive deepening:

  • Minimax determines how values are backed up through the tree.

  • Alpha-beta avoids examining branches that cannot affect the choice.

  • Progressive deepening ensures that a usable move is available under a time limit.

  • Uneven search allocates additional depth to positions that need it.


Deep Blue’s approach

Deep Blue combined several established search methods with substantial computing power and chess-specific additions. It was reported to perform about 200 million static evaluations per second and to search roughly 14 to 16 levels in many situations.

Its approach included:

  • Minimax, to account for an opponent who chooses strong responses.

  • Alpha-beta pruning, to avoid irrelevant portions of the tree.

  • Progressive deepening, to produce a move even when time is limited.

  • Parallel computing, to examine multiple parts of the search efficiently.

  • An opening book, containing prepared opening moves.

  • Specialized methods for endgames.

  • Uneven tree development, extending some lines farther than others when the position required it.

The central search principles were not unique to Deep Blue. Its strength came from combining them with fast hardware and additional chess-specific techniques, especially the ability to search selectively rather than treating every branch as equally informative.


Machine intelligence and human chess expertise

Deep Blue demonstrated a kind of intelligence based heavily on search and computation, but human chess masters rely on different strengths. Humans have limited computational capacity compared with a machine that can rapidly examine millions of positions. Rather than calculate every possibility, a master draws on extensive chess knowledge and recognizes familiar patterns.

This difference appears in experiments on chess-position memory. Masters can often memorize a displayed position very well when the pieces form a legitimate chess position. When the pieces are placed randomly, their memory performance falls sharply. The result suggests that expert memory depends on recognizing meaningful patterns and familiar structures, rather than simply remembering each piece independently.

This pattern recognition allows a human player to interpret a position as a collection of meaningful relationships and to draw on accumulated chess knowledge. Deep Blue’s search, by contrast, substituted large-scale computation for much of this kind of human expertise.

The comparison does not mean that machine search is unintelligent. It shows that intelligence can take different forms: a machine may succeed through powerful calculation, while a human expert succeeds through learned knowledge, pattern recognition, and selective reasoning.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent