Skip to content

Labs · 9618 18.1 · reinforcement learning

Matchbox Learner: Reinforcement with Beads

A computer made of matchboxes and coloured beads learns the game of Nim. Wins add beads, losses take them away, and after enough games it plays perfectly. This is how Donald Michie's MENACE learned in 1961.

3 levelsFree bench

In the exam

9618/32 May/June 2024 · Question 11 · 3 marks

Explain what is meant by Reinforcement Learning in relation to Artificial Intelligence.

Points that gain marks

  • A machine learning method that learns from feedback: rewards and punishments.
  • An agent learns how to behave in an environment by doing actions and seeing their results.
  • A good action gets positive feedback (a reward); a bad action gets negative feedback (a punishment).
  • It learns by itself from the feedback, without labelled data or exact instructions.

In this lab: The matchboxes are the agent and the game is its environment. Its actions are the beads it draws; a win adds beads (reward) and a loss takes them away (punishment). Nobody tells it the rule 'leave a multiple of 4': it finds it from the feedback.

0478/13 October/November 2025 · Question 6 · 6 marks

A computer game uses AI to create the movements and actions of the computer-controlled characters. (a) Describe what is meant by AI. (b) Explain how the AI can be used to improve the movements and actions of the computer-controlled characters.

Points that gain marks

  • (a) Computers copying intelligent behaviour: a collection of data and rules for using that data.
  • (a) A computer that can learn, adapt, and reason or make decisions.
  • (b) It can use machine learning: it collects data about the player's actions and finds patterns …
  • (b) … so it can predict the player's next move and adapt its own moves.
  • (b) It stores successful and unsuccessful moves, and learns the best moves against a player.

In this lab: The matchboxes do the last point: a win adds beads to the moves that worked and a loss removes beads from the moves that failed, so the stored moves get better game after game.

More real experiments

All labs →

Log in or create account

IGCSE, A-Level & AP