Перейти к содержанию

Labs · AI search · game trees

Think Ahead: Minimax and Alpha-Beta

How does a computer play games? It looks at every move, every answer and every next move, then works back up the game tree. Fill in the tree yourself, choose the best move, and find the branches it never needs to look at.

5 levelsFree bench

In the exam

9618/12 May/June 2021 · Question 2(b) · 3 marks

A computer game lets the user play a board game (such as chess) against the computer. Describe how the computer would use Artificial Intelligence (AI) to play the board game.

Points that gain marks

  • The rules of the game and past moves are stored.
  • It looks ahead at the possible moves and chooses the move most likely to win.
  • It can be trained by playing many games.
  • It learns from its mistakes: it stores whether each choice led to a good or bad result and changes its future choices.

In this lab: Minimax is the looking ahead: the computer scores every possible game to the end and picks the move that is best even if the other player plays well. The matchbox lab shows the other point: learning from good and bad results.

More real experiments

All labs →

Войти или создать аккаунт

IGCSE, A-Level & AP