Noughts and Crosses AI demo for Science Fair events

A hands-on demo for use at a small STEM event – letting kids train a simple AI system by playing a few games of noughts and crosses.

I prepared an activity for a STEM event in London this week. The idea was to make something for a Science Fair sort of event – where children will be walking past a stand, and might stop for a minute or two to try out an activity.

The objective was to come up with a hands-on demo that would enable a volunteer to talk to the children about machine learning.

As I’ve written it, I thought I’d share it here in case anyone else might find it useful for another event.

Noughts and Crosses

It’s based on the noughts-and-crosses activity that I’ve used before. Kids play noughts-and-crosses against a simple artificial intelligence system. The computer uses a machine learning model to decide where to make it’s moves. And that machine learning model will be trained throughout the event using the moves from every game so far.

Download the instructions here

Nought and Crosses - event plan

A child who comes to the stand to play a Noughts and Crosses game at the start of the event will probably win. The computer will be making decisions essentially at random.

As the event goes on, and the more the game is played, the better trained the computer will be.

A child who tries the game towards the end of the event should see a difference – and the computer should stand a reasonable chance of winning or at least forcing a draw against them.

Download the instructions here

Trial and Error

A nice element of using this at a STEM event is that it’s a chance to tell some history, too. This activity is a virtual simulation based on a project by Donald Michie in 1963. It means the event can also talk about the UK’s long history in AI research.

Developing the activity…

I used Machine Learning for Kids as the platform to base the activity on. Children will be playing Noughts and Crosses in Scratch, but using a Scratch game that has been set up for them already. This approach meant I could get all of this ready in a couple of evenings, as I didn’t have to write any code and could base it on an existing classroom activity that I already had.

Until now, everything I’ve done with that tool has been based on the model used by groups like Code Club. That is, assuming that children will be sat at a computer (either by themselves, or in pairs) for about an hour, to work on a single project. That’s a very different environment to a stand at an event, where kids will be standing and try something for only a minute.

Although Scratch might not be the first choice to develop a demo app, I think it does at least send an additional underlying message to kids who try it out that AI is becoming accessible.

And I think a benefit of using Noughts and Crosses as the basis for the demo has the benefit of being a game that kids already know how to play – so that won’t be a barrier to kids trying it out, and the volunteers at the event won’t have to waste time explaining the rules of the game.

But whether it makes a compelling activity or really enables the sort of conversations about AI that I hope it will… I don’t know yet. Unlike the class worksheets that I write, that I get to try out on local school classes before publishing, this one is a bit less tested as an approach/concept. Fingers crossed it works!


Update: Andy pointed me at this video of an event last year where they had a Noughts and Crosses AI stand based on MENACE, but getting people to play against a physical system built of matchboxes. That is awesome!

Tags: , ,

2 Responses to “Noughts and Crosses AI demo for Science Fair events”

  1. Stefan Gachter says:

    Dear Dale,
    Thanks a lot for sharing your work! I appreciate your engagement and lessons. I would like to learn more about the machine learning algorithms you are using behind the scene. Could you elaborate on the algorithms? In particular the one for Tic-Tac-Toe?
    Kind regards, Stefan

  2. dale says:

    Hi Stefan. It’s just a decision tree built using scikit –