ArticleslgStudy

computer science

Expectiminimax

Expectiminimax is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Expectiminimax rather than just read about it. In short: The expectiminimax algorithm is a variation of the minimax algorithm, for use in artificial intelligence systems that play two-player zero-sum games, such as backgammon, in which the outcome depends on a combination of the player's skill and chance elements such as dice rolls. In addition to "min" and "max" nodes of the traditional minimax tree, this variant has "chance" ("move by nature") nodes, which take the expe…

Key takeaways

  • Expectiminimax belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Expectiminimax to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Expectiminimax from memory before moving on to harder problems.

Reference excerpt

The expectiminimax algorithm is a variation of the minimax algorithm, for use in artificial intelligence systems that play two-player zero-sum games, such as backgammon, in which the outcome depends on a combination of the player's skill and chance elements such as dice rolls. In addition to "min" and "max" nodes of the traditional minimax tree, this variant has "chance" ("move by nature") nodes, which take the expected value of a random event occurring. In game theory terms, an expectiminimax tree is the game tree of an extensive-form game of perfect, but incomplete information. In the traditional minimax method, the levels of the tree alternate from max to min until the depth limit of the tree has been reached. In an expectiminimax tree, the "chance" nodes are interleaved with the max and min nodes. Instead of taking the max or min of the utility values of their children, chance nodes take a weighted average, with the weight being the probability that child is reached. The interleaving depends on the game. Each "turn" of the game is evaluated as a "max" node (representing the AI player's turn), a "min" node (representing a potentially-optimal opponent's turn), or a "chance" node (representing a random effect or player). For example, consider a game in which each round consists of a single die throw, and then decisions made by first the AI player, and then another intelligent opponent. The order of nodes in this game would alternate between "chance", "max" and then "min".

Pseudocode The expectiminimax algorithm is a variant of the minimax algorithm and was firstly proposed by Donald Michie in 1966. Its pseudocode is given below.

function expectiminimax(node, depth) if node is a terminal node or depth = 0 return the heuristic value of node if the adversary is to play at node // Return value of minimum-valued child node let α := +∞ foreach child of node α := min(α, expectiminimax(child, depth-1)) else if we are to play at node // Return value of maximum-valued child node let α := -∞ foreach child of node α := max(α, expectiminimax(child, depth-1)) else if random event at node // Return weighted average of all child nodes' values let α := 0 foreach child of node α := α + (Probability[child] × expectiminimax(child, depth-1)) return α

Note that for random nodes, there must be a known probability of reaching each child. (For most games of chance, child nodes will be equally-weighted, which means the return value can simply be the average of all child values.)

Expectimax search Expectimax search is a variant described in Universal Artificial Intelligence: Sequential Decisions Based on Algorithmic Probability (2005) by Tom Everitt and Marcus Hutter.

Alpha-beta pruning Bruce Ballard was the first to develop a technique, called *-minimax, that enables alpha-beta pruning in expectiminimax trees. The problem with integrating alpha-beta pruning into the expectiminimax algorithm is that the scores of a chance node's children may exceed the alpha or beta bound of its parent, even if the weighted value of each child does not. However, it is possible to bound the scores of a chance node's children, and therefore bound the score of the CHANCE node. If a standard iterative search is about to score the ith child of a chance node with N equally likely children, that search has computed scores v1,v2,…,vi−1 for child nodes 1 through i−1. Assuming a lowest possible score L and a highest possible score U for each unsearched child, the bounds of the chance node's score is as follows: score≤1n((v1+…+vi−1)+vi+U×(n−i)) score≥1n((v1+…+vi−1)+vi+L×(n−i)) If an alpha and/or beta bound are given in scoring the chance node, these bounds can be used to cut off the search of the ith child. The above equations can be rearranged to find a new alpha & beta value that will cut off the search if it would cause the chance node to exceed its own alpha and beta bounds: αi=N×α−(v1+…+vi−1)+U×(n−i) βi=N×β−(v1+…+vi−1)+L×(n−i) The pseudocode for extending expectiminimax with fail-hard alpha-beta pruning in this manner is as follows:

function *-minimax(node, depth, α, β) if node is a terminal node or depth = 0 return the heuristic value of node if node is a max or min node return the minimax value of the node let N = numSuccessors(node) // Compute α, β for children let A = N * (α - U) + U let B = N * (β - L) + L let sum = 0 foreach child of node // Limit child α, β to a valid range let AX = max(A, L) let BX = min(B, U) // Search the child with new cutoff values let score = *-minimax(child, depth - 1, AX, BX) // Check for α, β cutoff conditions if score <= A return α if score >= B return β sum += score // Adjust α, β for the next child A += U - v B += L - v // No cutoff occurred, return score return sum / N

This technique is one of a family of variants of algorithms which can bound the search of a CHANCE node and its children based on collecting lower and upper bounds of the children during search. Other techniques which can offer performance benefits include probing each child with a heuristic to establish a min or max before performing a full search on each child, etc.

See also Minimax Alpha–beta pruning Negamax Expected value

References

Worked examples

Example 1 — a first encounter with Expectiminimax

Start with the simplest possible case. Write down what Expectiminimax claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Expectiminimax before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Expectiminimax ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Expectiminimax

In research
Expectiminimax appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Expectiminimax in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Expectiminimax is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorial game theory, Game artificial intelligence, Search algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Expectiminimax outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Expectiminimax” →

How to study Expectiminimax in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Expectiminimax means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Expectiminimax out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Expectiminimax in simple terms?

The expectiminimax algorithm is a variation of the minimax algorithm, for use in artificial intelligence systems that play two-player zero-sum games, such as backgammon, in which the outcome depends on a combination of the player's skill and chance elements such as dice rolls. In addition to "min"…

Why does Expectiminimax matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Expectiminimax?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Expectiminimax.

Tags

  • Combinatorial game theory
  • Game artificial intelligence
  • Search algorithms
  • Trees (data structures)

Keep exploring