• Volunteer
  • Teach
  • Programs
    • Chats with Change Makers
    • Engineers Week
    • IMAX Films
    • Introduce a Girl to Engineering
    • World Engineering Day
    • Future City
  • Engineering Activities
  • Engineering Careers
  • Support Us
  • Store
  • Search
  • Join
Donate
Join
  • Volunteer
  • Teach
  • Programs
    • Chats with Change Makers
    • Engineers Week
    • IMAX Films
    • Introduce a Girl to Engineering
    • World Engineering Day
    • Future City
  • Engineering Activities
  • Engineering Careers
  • Support Us
  • Store
  • Search
  • Join
  1. View More Activities

AI Machine Learning

The game Hexapawn demonstrates machine learning, how artificial intelligence “learns” to make the right choice and win a game 100% of the time.

Time
  • Half Day
Careers
  • Computer Science
Grade
  • 6-8
  • 9-12
Topic
  • Coding & Robotics
Leader Notes
Materials

Per Person or Pair:

  • A 9-square grid (3 rows across and 3 rows down) made from a template handout (glued to cardboard)
  • 6 pawns: 3 white, 3 black. Can use checkers, chess pawns, pennies, nickels, or other objects that fit the squares
  • 24 small containers with lids (examples: cardboard egg cartons cut apart with lid attached or 3 oz paper cups with another cup for a lid)
  • Small marks in 4 different colors (such as beads, M&Ms, small Lego pieces, or bingo chips—sized to fit 4 in each small container)
  • Scissors
  • Pen or fine marker
  • Tape or glue
Introduce

In 1952, Arthur Samuel wrote a program for an IBM computer to play checkers. The program kept track of all the positions on the checkers board it had already seen and combined them with an algorithm that calculated the chances of winning. The more the computer played, the better it got at the game of checkers. The machine “learned” how to win, and Arthur Samuel called this type of programming machine learning.

Machine learning is a form of artificial intelligence (AI). AI describes how machines, in particular computers, can be programmed to think and perform like humans. Not only that, they can be trained to make the best choice every time. In the case of games, how can a computer learn to win every time? Hexapawn is a game designed to reveal how the process works.

Student Challenge

Playing the game Hexapawn, your goal is to train a “machine” to beat you each time.

Instructions

Preparation

Review the Machine Learning: How to Play Hexapawn student handout.

There are several materials that need to be assembled before gameplay. Instructions are in the How to Play handout.

Decide if you will pre-assemble the components for your students or if you will have the materials available for them to assemble themselves.

Practice playing so that you can answer any questions. As needed, amend the student instructions to make them as clear as possible for your students.

Define the Problem 

  1. Set the context for students with a brief introduction. Tell them that in the early 1960s, a mathematician named Martin Gardner recognized that machine learning, a form of artificial intelligence (AI), would have an ever-growing impact on our lives. Accordingly, he wanted to help people understand the answers to these questions:
    • How can a machine learn like a human?
    • How can a machine get even better at playing games of strategy than a human?

In 1962 Gardner came up with a game he called Hexapawn. It demonstrates how a computer can be programmed to improve with experience, which is another way to describe machine learning. The students’ goal in playing this game isn’t to win against a computer; it’s to teach a computer to beat them every single time.

  1. Show students the 9 x 9 grid (game board) and explain how you play the game.

Any of these three results is considered a win:

    • Get a pawn to the other side.
    • Make the opponent unable to move.
    • Take all of your opponent’s pawns.

Explain that the robot, or machine learner (Gardner called it HER, short for Hexapawn Educable Robot), is made out of 24 small containers that hold a varying number of different colored small pieces, such as beads, known as marks.

The containers are grouped by a round of play. Only certain moves are possible in any round, and these are represented by diagrams attached to each turn’s set of containers.

Summarize the instructions in the gameplay handout to get students familiar with the game: When it’s the robot’s turn, students find the container with the diagram that matches the board. They close their eyes, shake the container, open it, and pick a mark. They place this mark on top of the container and make this move for the robot.

Students take turns until they or the robot wins.

If the robot wins, students put all of the marks back in their containers. If the robot loses, students remove the mark that represents their robot’s last move. Then they play again.

 What students will discover is that as they continue to play, only marks representing winning moves remain in each container. The robot has “learned” which moves are successful by having the losing moves pruned away.

Build and Test  

Once students understand how to play, get them started with the first few rounds. If students are playing in pairs, one student can be the robot. Give students 15 minutes to play.

Stop play and troubleshoot in a class discussion. What are students discovering? What are they confused by? As much as possible, have other students answer so that they are teaching each other to teach the robot.

Evaluate and Redesign  

When time is up, see if any students are consistently getting beaten by their robot.

Elicit reactions. How does playing Hexapawn help—or not help—them understand AI?

Use the additional information under Science & Engineering to further explain machine learning.

STEM Connections

The rules of the game represent an algorithm, a set of rules that is followed in a particular kind of problem-solving. In this case, the problem to be solved is a game to be won. Computer scientists use algorithms in the development of AI (and just about every form of machine learning).

Machine learning is similar to the way people learn through rewards and consequences. At first, when all the marks are in their respective containers, the robot is a blank slate. It has no strategy. Winning is a reward in that the robot loses no marks, but removing a mark when the robot loses is a form of negative consequence. Each negative consequence improves the likelihood of winning the next game. Eventually, as Gardner says, “Such machines do not do what they have been told to do but what they have learned to do.”

Enjoy this activity?

Join our community and receive activities, early access to programs, and other special news, and/or leave feedback on this activity below!

Thank you! Your submission is processing.

Cancel reply

Your email address will not be published. Required fields are marked *

Submitting...

11 Comments

  1. David kelly
    David kelly on February 22, 2024 at 9:35 am

    Fun

    Reply
  2. Benjamin Magana
    Benjamin Magana on February 22, 2024 at 9:35 am

    It sounds cool.

    Reply
    • Fiona Perkins
      Fiona Perkins on October 10, 2024 at 9:59 am

      it looks cool to me!

      Reply

Submit a Comment Cancel reply

Your email address will not be published. Required fields are marked *

Print
Downloads
Share this activity with your network!
Enjoy this activity? Please let your friends know!
Share Activity
This activity was developed through the support of the Northrop Grumman Foundation. Northrop Grumman Foundation More Activities from Northrop Grumman Foundation
Downloads
  • 1
Other Resources
  • 24 possible moves handout (Color copy recommended)
  • Machine Learning: How to Play Hexapawn Student Handout (Color copy recommended)
  • Scorecard Template
Related Activities
View All
AI: Assessing the Risks and Rewards
AI: Assessing the Risks and Rewards
  • Half Day
  • 6-12
View Activity
Cyber Sleuth: Which DMs Can I Trust?
Cyber Sleuth: Which DMs Can I Trust?
  • 45 minutes or Less
  • 6-12
View Activity
Stop the Cyberattacks!
Stop the Cyberattacks!
  • 45 minutes or Less
  • 6-12
View Activity
Lidar: Mapping with Lasers
Lidar: Mapping with Lasers
American Society of Civil Engineers
  • 45 minutes or Less
  • 6-12
View Activity
My Robot Friend
My Robot Friend
Saint Louis Science Center
  • 45 minutes or Less
  • 3-8
View Activity
Robot Challenge
Robot Challenge
Saint Louis Science Center
  • 1 to 2 Hours
  • 6-12
View Activity
Operation Polar Eye
Operation Polar Eye
ThinkerSmith
  • 1 to 2 Hours
  • 6-12
View Activity
Homemade Wigglebot
Homemade Wigglebot
  • 45 minutes or Less
  • K-5
View Activity
Coding Without Computers
Coding Without Computers
ThinkerSmith
  • 1 to 2 Hours
  • 6-12
View Activity
DiscoverE helps create activities like this around Coding & Robotics for children in Middle School and High School to help prepare them for STEM careers in fields like Computer Science.

Find our resources helpful?
Please consider donating.

Make a donation

Want to find out how you can volunteer?

Get Involved

DiscoverE works to provide every student with a STEM experience and the resources, programs, and connections to improve the understanding of engineering through a united voice and a global distribution network.

The development of this site was made possible by a grant from the United Engineering Foundation (UEF).

About Us

  • Our Story
  • Our Board & Staff
  • Our Impact
  • Donate

Get Involved

  • Messages Matter
  • Teach
  • Volunteer
  • Our Programs
  • Store

Resources

  • Learn about Engineering Careers
  • Engineering Activities
  • Our Blog
  • Logos & Graphics
  • Outreach Grants

Connect

  • Facebook
  • LinkedIn
  • Instagram
  • YouTube
  • Twitter
  • Pinterest
  • Contact Us
Website designed and developed by RedSwan5.

© 2025 DiscoverE. All rights reserved.

Privacy Policy | Terms & Conditions

Join Our Community

Stay up-to-date with all the programs and resources that Discover E has to offer!

Login or Create Account

All of the content on this site is free!

Registering for the site helps us tailor future activities, webinars, and events so that we can serve you better.

Thank you for your interest and for helping us in our mission to transform lives as we put the E in STEM!

Login Form

Log in or sign up

Forgot your password?

Don’t have an account? Sign up!

We use cookies that are necessary to make our site work. We may also use additional cookies to analyze, improve, and personalize our content and your digital experience. For more information, see our Cookie Policy.OKCookie Policy