> For teachers > Elementary School

Lesson plan · 3 days

How a Computer Makes a Prediction

Three days that build one idea at a time: what a network is, how to fix one that is wrong, and how a network weighs two things at once. Each day starts with a short whole-class introduction and ends with a discussion.

Grade levels
Grades 3–5
Duration
Three class periods of 45 minutes
Class activities
3 activities, one a day, using 7 iiNNoo lessons

Learning objectives

Students will be able to:

  1. 01

    Inputs become outputs

    Describe a neural network as a machine that turns an input number into an output number, one step at a time.

  2. 02

    A weight is a multiplier

    Explain that each connection multiplies the number passing along it, and that a bigger weight makes a bigger output.

  3. 03

    Predict, then check

    Work out what the network will say before it says it, then step through the calculation to check.

  4. 04

    Tune the network

    Change a weight until the network's predictions match what really happened.

Prerequisite knowledge

Before starting, students should be comfortable with:

  • Multiplying a two-digit number by a one-digit number, such as 6 × 25.
  • Adding two numbers to make a total.
  • For Day 3: knowing that 0.5 is a half and 0.25 is a quarter. With third graders, do The Tomato Harvest Predictor together on the board.
  • Clicking, and typing a number, on a computer or tablet. Students can share one device between two.

Inputs, weights and outputs · 45 minutes

Class Activity: Day 1

Introduction for students

Ask the class for times a computer has made a prediction for them: the weather app, a video site picking the next video, a phone guessing the next word. Explain that these are made by AI, and that for three days the class will open one up to see what is inside. Spoiler: it is mostly multiplication.

Make a prediction together, without a computer. "A zoo gets about 200 visitors for every hour of sunshine. How many visitors on a day with 3 hours of sun?" Ask how students got 600, and write it on the board as 3 × 200 = 600.

Key Vocabulary

AI
Short for artificial intelligence: computer programs that do things that usually take human thinking, such as making predictions.
Prediction
A guess about something we don't know yet, made from something we do know.
Neural network
A kind of AI that makes predictions by passing numbers along connections and multiplying them.
Input value
The number that goes into the network, such as the hours of sun.
Weight
The number on a connection. The input is multiplied by it.
Output value
The number that comes out of the network: its prediction.

Guiding the activity

Step through the zoo together

Open The Zoo Visitors Predictor on the board and step through the first input as a class. Label its parts on the board as they appear: the input value (hours of sun), the weight (200), and the output value (visitors). Then let pairs step through the other three inputs on their own devices.

Predict the cricket chirps

Pairs open The Cricket Chirp Predictor, where the weight is 6 chirps a minute for every degree. Before each output, the app asks students to predict it. They work it out on paper first, then type it in. Ask partners to take turns: one predicts, the other checks.

Spot the pattern

Listen for students who stop multiplying and start adding 30 each time (90, 120, 150, 180). Ask them why that works: each input is 5 degrees warmer, and 5 × 6 = 30.

Post-activity discussion

  1. What are the three parts of the network we used today?

    Listen for The input value, the weight on the connection, and the output value.

  2. What would the cricket network say at 10 degrees?

    Listen for 60 chirps a minute. Students can predict inputs the network was never shown.

  3. What would change if crickets chirped 7 times a minute for each degree?

    Listen for Only the weight. The network is the same shape; the weight holds what it knows.

Fixing a network that's wrong · 45 minutes

Class Activity: Day 2

Introduction for students

Recall Day 1 in one sentence from a student: the input gets multiplied by the weight to make the output. Today the weights are wrong, and the class's job is to fix them.

Introduce the target output: the real answer, what actually happened. The network's output is its guess. When the guess and the real answer match, the network is right.

Key Vocabulary

Target output
The real answer, what actually happened. The network's output should match it.
Tuning
Changing a weight, a little at a time, until the outputs match the targets.

Guiding the activity

Model the first fix

Open The Phone Battery Predictor on the board. Step through the first input: the network says a 1-hour video uses 5% of the battery, but the target is 12%. Ask the class: is 5 too big or too small? So should the weight go up or down? Then hand it over to pairs.

Find the weight

Students click the weight and type a new value. When an output matches its target, the double lines between them turn green. The answer is 12, and students should step through all four inputs to show it works for each one.

Two outputs, two weights

Pairs move on to The Smoothie Stand Predictor: one input, the temperature, now feeds two outputs, smoothies and popsicles, and each has its own weight. The answers are 4 for smoothies and 2 for popsicles. Ask what it means that the smoothie weight is twice the popsicle weight: a warm day sells twice as many smoothies.

Share the shortcut

Some students will find a shortcut: divide the target by the input. Let them explain it to the class, then ask whether it would still work if the network had two inputs. That question sets up Day 3.

Post-activity discussion

  1. How did you know which way to change the weight?

    Listen for If the output was too small, the weight went up; too big, it went down.

  2. Why test all four inputs, not just one?

    Listen for A weight has to work for every input. One right answer could be luck.

  3. What did you do each time you got it wrong?

    Listen for Looked at how far off the output was and adjusted. This is how real AI learns: it measures its mistake and nudges each weight to shrink it.

Two inputs at once · 45 minutes

Class Activity: Day 3

Introduction for students

Ask: "What decides how many butterflies visit a garden?" Collect answers. Real predictions usually depend on more than one thing, so a network can have more than one input, each with its own connection and its own weight.

Show how the output is worked out with two inputs, using the board: multiply each input by its weight, then add the two together. For a garden with 3 flower beds and 4 bushes, with weights 1 and 2: 3 × 1 + 4 × 2 = 11 butterflies.

Key Vocabulary

Input values
The numbers that go into the network. A network can have more than one, such as flower beds and bushes.
Connection
The line that carries a number from an input to an output. Each connection has its own weight.
Total
With two inputs, the output is each input times its weight, added together.

Guiding the activity

One weight to change

Pairs open The Butterfly Count Predictor. The task is to make each bush count twice as much as each flower bed. The flower bed weight is already 1, so the bush weight needs to be 2. Students change the second weight and confirm it works for all four gardens.

Both weights to find

Next comes The Tomato Harvest Predictor, which asks for both weights, and both are between 0 and 1. The answers are 0.5 for each hour of sun and 0.25 for each liter of water. Encourage students to change one weight at a time, and remind them that 0.5 is a half and 0.25 a quarter.

For early finishers

Pairs who finish can explore The Honey Harvest Predictor, an example with no task to finish. Ask them to figure out what each weight means: 0.28 kilograms of honey for each flower nearby, and 0.45 for each day in the month.

Post-activity discussion

  1. In the tomato garden, which matters more: an hour of sun or a liter of water?

    Listen for An hour of sun: its weight, 0.5, is twice the water's, 0.25.

  2. What does a bigger weight tell us about an input?

    Listen for That the input matters more to the prediction.

  3. Why was this harder than one input?

    Listen for Changing one weight changes every output, so the two weights have to be found together.

Wrap up

On a half sheet of paper, each student designs a network of their own. They pick something to predict from their own life and the input it depends on, such as minutes of reading and pages read, choose a weight, and work out the output for two different inputs. Volunteers share theirs with the class.

Close the unit by returning to the first day's question: how does a computer make a prediction? Students should now be able to answer that it multiplies each input by a weight and adds them up, and that it gets better by checking its answers and adjusting its weights.

Ready to bring iiNNoo to your classroom?

Questions or ideas? Email us at support@iinnoo.app.

Start Learning How AI Learns