Skip to content

Instantly share code, notes, and snippets.

@deebs67
Last active June 11, 2023 20:43
Show Gist options
  • Save deebs67/8fbcf8b127a63e70d4a3f8590c97701d to your computer and use it in GitHub Desktop.
Save deebs67/8fbcf8b127a63e70d4a3f8590c97701d to your computer and use it in GitHub Desktop.
Matchbox Machine-Learning

Matchbox Machine-Learning

On this page are provided some links to the Reinforcement Learning (RL) form of 'Artificial Intelligence' (AI) using 'Matchbox' machines, as originally pioneered by Donald Michie in 1960, later publicised by Martin Gardner, and (more recently) further popularised as a 'STEM' topic by others such as Matt Scroggs, Matt Parker and Oliver Child. For more information about RL in general, including tutorials and potential real-world applications, see the following Gist:
https://gist.github.com/deebs67/936ffcacbf299ac20a6edfd44dbb832c

MENACE: the 'Machine-Educable Noughts And Crosses Engine'

Here is Matt Parker presenting a Manchester Science Festival demo of 'MENACE', the 'Matchbox Machine' which plays noughts-and-crosses (a.k.a. Tic-Tac-Toe), as invented by Donald Michie (video, ~14 mins):
https://www.youtube.com/watch?v=R9c-_neaxeU
Fab quote - "I'm so proud ... this must be what procreating feels like!"
N.B. Matt also introduced this topic as part of the RI Christmas Lecture 2019 (with Hannah Fry)

Here's the original article (by Oliver Child) which inspired Matt Parker to make the video:
https://chalkdustmagazine.com/features/menace-machine-educable-noughts-crosses-engine/#more-3326

Here's a nice short talk (~14 mins) on MENACE and related topics by Matt Scroggs:
https://www.youtube.com/watch?v=hK25eXRaBdc
...and Matt Scroggs also writes about MENACE on his blog:
https://www.mscroggs.co.uk/blog/19
...including with a link to his Javascript implementation which you can play with/ against:
https://www.mscroggs.co.uk/menace/

Matchbox-machines to play simpler games, such as Nim

Here's an earlier article on MENACE ('A matchbox game learning-machine' by Martin Gardner. Scientific American, March 1962.):
http://cs.williams.edu/~freund/cs136-073/GardnerHexapawn.pdf
...and later version with addendum here:
https://bobson.ludost.net/copycrime/mgardner/gardner04.pdf#page=88

which proposes a simpler game to play, called 'Hexapawn', involving only 24 matchboxes. Another possibility for something even simpler is a 'pickup sticks'-type game called 'Nim'. The player who picks up the last stick (or stone) from a set of separate piles loses. Here is a short (~10 mins) video demo by Matt Scroggs applying the same machine-learning matchbox technique to Nim (fast-forward to about 4hrs 4 mins in):
https://www.youtube.com/watch?t=14556&v=Uuqrh5sdK8g&feature=youtu.be

Here's a slide presentation on MERLIN the 'Matchbox Engine for Reinforcement Learning in Nim' in the 2021 Bishop's Stortford school science fair (scroll down to 'Stand 26.3'), which had been inspired by many of the other links on this page:
https://www.bsettsa.co.uk/ks3-exhibition/418.html

The Wikipedia entry on Nim:
https://en.wikipedia.org/wiki/Nim

Here is a Nim-playing computer from the dim-and-distant past called 'Nimrod':
https://en.wikipedia.org/wiki/Nimrod_(computer)

And the 'Nimatron' machine came even earlier:
https://en.wikipedia.org/wiki/Nimatron

Here's Matt Parker again (on the ‘Dr. Nim’ machine):
https://www.youtube.com/watch?v=9KABcmczPdg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment