Algorithm exercises for kids

If there’s one word on everyone’s lips in the 2020s, it’s “algorithm.” These elusive strings of code dictate what we see on our social media, the products we see on the homepage of our favorite online shopping sites, and the types of movies and TV shows suggested when we log onto streaming services. 

So, why would we be looking for algorithm exercises for kids?  

Well, love or hate them, algorithms are here to stay, and they’re changing how we live. And while algoritmos sometimes get a bad rap in the press, they’re actually entirely benign (until they’re not!). 

This article is about algorithm exercises for kids — exploring what they are and why mastering them will give your child a distinct advantage.

Ready? Let’s go!

What is an algorithm?

It’s a great question because there’s a lot of confusion revolving around this very 2020s buzzword. 

Essentially:

An algorithm is a set of step-by-step instructions, functions, or rules. And each step guides you closer toward completing a task or solving a problem.  

However:

The word “algorithm” is actually nothing new — it was first used in the 9th century. Yes — the 9th century! That’s WAY before the first iPhone (if you can imagine such a time). So, algorithms aren’t just computer code. 

Indeed, algorithms are everywhere: from the recipe books on our shelves to the way we solve a math equation; from how we do our laundry or make a phone call. 

A laundry algorithm

Let’s think about the processes we might complete to clean dirty clothes — because they don’t jump into the machine and launder themselves (no matter what your kids might think!). 

Indeed, before your clothes get cleaned, there are several functions to complete, such as:

  1. Picking the clothes up off the floor
  2. Placing the dirty clothes in a laundry basket. Then, when it comes to laundry day:
  3. Dividing your whites from your colored clothes and separating the machine-wash garments from the hand-wash. 
  4. Placing the selected clothes in a wash basket to deliver them to the washing machine. 
  5. Putting the clothes in the machine. 
  6. Adding detergent and fabric softener. 
  7. Selecting an appropriate machine cycle, then switching the machine on. 
  8. Waiting for the cycle to complete, then emptying the clothes back into the wash basket. 
  9. Taking the clothes to the clothes drier. And waiting for them to dry. 
  10. Folding the clothes and returning them to your drawers. 

Sticking to the rules

Each stage in this process is essential — if you miss one, the sequence might not work (or go wrong). 

For example, you’ll end up with pink shirts if you don’t divide the whites from the colors. And if you put hand-wash-only clothes into the machine, they’ll fit Barbie better than your kids!

However:

We have a basic list of functions, but we must consider the complementary sub-steps of that primary sequence, such as ensuring the washing machine is plugged into the power socket (and the power switch is set to ON). 

Otherwise, the whole sequence fails. 

An algorithm in simple terms

So, algorithmic coding or programming is composing a list of rules a computer can understand and follow; telling it how to behave. 

And once you have your rough list, it’s about ensuring you don’t forget those all-important sub-steps that might prevent the computer from executing the completed task. 

How to explain algorithms to kids

It’s probably relatively clear what an algorithm is by now — it’s just a list of instructions. So, get your child to devise instructions for completing a task that offers them a reward, like how to make a slice of peanut butter toast. 

They might say:

  1. Put a slice of bread into the toaster (or under the grill).
  2. Open a jar of peanut butter and spread it on the toasted bread. 
  3. Take a bite. 
  4. And enjoy! 

Now, those instructions are probably enough for most humans who have had peanut butter toast before because they know what to expect as the outcome. 

But a computer needs greater specificity.

For example, the computer doesn’t know:

  • Where to find the bread 
  • Where to find the jar of peanut butter 
  • How much bread to use 
  • How thickly sliced the bread should be (if the loaf isn’t pre-sliced)
  • How to spread peanut butter: what tool do you use?
  • How much peanut butter to spread (and how thickly)
  • Whether to use a plate (and what type (and size) of plate). 

Then, you might need to explain which part of the peanut butter toast it should bite into — how much is a bite, and how to chew.

So:

Once you have your basic list of instructions, it’s about understanding the additional information a computer needs to complete the operations. And this is the fun part for kids because they love troubleshooting and finding solutions to problems. 

What are the components of an algorithm (and how do you explain them to kids?)

Computer algorithms are often written in languages similar to English but might have different syntaxes (how we arrange the words grammatically). 

Algorithms commonly instruct computers to:

Carry out a sequence = aka Secuenciación

Make a choice = aka Selection

Repeat a process according to additional rules = Iteration (or looping)

We’ve already talked about sequencing in its simplest terms. So, we’ll explore Selection:

Selection

You can author selection criteria into an algorithm to help the computer make a decision based on specific rules. You can instruct the computer to follow or repeat specific steps or to completely ignore them based on the rules you set out. 

For example, the algorithm script for buying a bus ticket might pose a question such as:

  1. How old are you?
  2. If you’re over 65, you’ll pay a different fee or get a free ticket.
  3. Otherwise, you’ll pay the full fare. 

These decisions are dictated by easily understood commands, such as SI, THEN, y DEMÁS

In other words:

  1. IF you’re over 65 years old, THEN you get a free ticket — ELSE pay full fare. 

So, with these simple selection criteria, your kids can build those sub-rules that fill in the gaps. 

coding algorithm

Some algorithm exercises for kids

Here are some group algorithm games that your kids will love:

Target Practice!

Start with a simple image that one child can describe to the rest of the group. I recommend sticking with simple, easily defined geometric shapes, like circles, squares, triangles, etc. Incorporate a range of colors in the image if you can. 

You could use a picture of a target like this:

picture of a target

If that looks too complicated, feel free to choose a simpler image — but this is a good challenge for 4-6-year-olds. 

The game works like this:

  1. Give one child in the group a piece of paper bearing your chosen image. We’ll call them Child 1. 
  2. Hand out pieces of paper and colored pens to the other children in the group. Don’t let the other kids see Child 1’s piece of paper. 
  3. Now, ask Child 1 to describe the image to guide the rest of the group to draw it. Encourage them to use numbers, shape names, and colors to describe the image. 

Then, everyone shares the image they’ve drawn, discussing how each is similar or different and why that might be. 

HOW DOES THIS RELATE TO ALGORITHMS?

The instructions Child A gives to the group are the algorithm. And how similar the other children’s images look relies on the precision and accuracy of their given instructions. 

It sounds simple, but children quickly learn how to adapt their language. And this is an excellent inclusive activity for neurodiverse learners and those with a very logical brain. 

However, it also depends on the comprehension abilities of the children taking the instructions — representing how different machines might use a different language or understand instructions in slightly different ways. 

LEARNING A COMMON LANGUAGE

This is all about adapting language to suit the receiver. For example, university students might describe the first stage as:

Draw three concentric green circles, each one smaller than the previous. 

But a child probably doesn’t know the word “concentric,” and they might not be able to describe the function so succinctly. They might say:

  • Draw a big green circle. 
  • Inside that, draw a smaller green circle.
  • Inside the smaller green circle, draw another smaller green circle. 

So, writing an algorithm is partly:

  • Understanding the objective, and 
  • Learning the computer’s vernacular (i.e., the language it uses to translate the instruction into an action). 

Here’s another algorithm exercise for your kids to try:

Guide the Monkey

This game starts with an obstacle course you could easily set up in your living room or the classroom. 

Set up a range of non-hazardous obstacles, such as socks, chairs, or pieces of paper around the room, and get the children into pairs. 

Then, blindfold one of the kids (they’re the Monkey) and ask the other (the Instructor) to guide them around the obstacle course, avoiding contact with the obstacles. 

You could even place a grid over the floor that dictates how many steps the Monkey needs to make to navigate around, up, and over the obstacle course. And the Instructor can use algorithm commands such as STEP forward/backward/left/right while determining the number of steps. 

HOW DOES THIS RELATE TO ALGORITHMS?

This is a great way to teach basic animation algorithms that they can apply to simple computer game coding platforms, such as CodeMonkey Jr

Guide the Monkey shows children how to develop instructional language, which comes in super-handy when they come to write algorithms. It also helps children learn the importance of sequencing and strategizing — how might they streamline their process for faster results?

You could even limit the words they’re allowed to use — perhaps just using the words:

  • Forward
  • Back
  • Right
  • Left
  • Jump
  • Steps
  • And numbers

Paper airplanes

All kids love making paper airplanes, right? Well, now they can turn their origami creativity into algorithmic games!

Get each child to make a paper airplane. Then, ask them to unfold it and write the instructions for making their airplane from scratch. Encourage them to be creative, adding their own flourishes, like drawn symbols and extra folds for more streamlined planes. 

Get each child to pass their instructions around the group, asking other kids to make their invention from their algorithm. 

You could even challenge them to mix the order of instructions up a bit or miss a step. What happens then?

Egg Carton Lava Game! 

Keep things analog with the egg carton lava game. This is an excellent game for playing in pairs. 

All you need is:

  • A large egg carton for 30 eggs. Tape several cartons together to increase the difficulty. 
  • Screwed-up pieces of red paper (the lava)
  • A green plastic egg
  • A blue plastic egg
  • A playing piece, such as an action figure. 

Alternatively, you could substitute the plastic eggs for Kinder Surprise Eggs! 

Here’s how to set it up:

  1. Place your green egg in one of the slots around the edge of the egg carton. 
  2. Place your blue egg in a slot away from the green egg. 
  3. Screw up four or five pieces of red paper into balls, and place them in random slots around the egg carton. This is the lava. 

Now, encourage one child in the pair to write down the steps the action figure will take to get first to the green egg and then to the blue. Then, ask the other child to follow those steps. 

If the instructions work, they win the Kinder egg — if they don’t, they’ll need to streamline the instructions together. 

If the action figure ever lands on a lava rock, the game is over, and they’ll need to start again; reassessing their algorithm. 

HOW DOES THIS RELATE TO ALGORITHMS?

Ultimately, this activity encourages kids to think like computers and plan their moves in advance. To make the game harder, use a larger grid, and perhaps get older kids to collect as many eggs as possible for different prizes. 

When their action figure lands on a lava rock, they need to go back to the planning stage to “debug” their code, which real-life programmers need to do when a piece of code fails to work. 

This game offers rewards for accuracy, encouraging children to develop logical thinking and spatial awareness. 

Algorithm exercises for kids!

I hope you’ve enjoyed exploring these simple algorithm exercises for kids. Ultimately, consider any fun task that requires a sequential process for successful completion and turn it into an algorithm game, such as:

  • Making and baking a cake (it will nearly always go wrong if you miss a step)
  • Tying your shoelaces
  • Making a cup of coffee or tea
  • Cleaning the windows
  • Setting the TV to record a program
  • Making a sandwich
  • Climbing a tree
  • Tidying their bedroom

In fact, if you’re really clever about it, you’ll get a very tidy house and your lunch made for you. All in the name of fun and learning! 

Check out our blog for more ideas about algorithms and para niños.

Thanks for reading. 

¡Prueba CodeMonkey en casa o en la escuela!

o

para tu escuela / distrito

Más para explorar:

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.

Suscríbete al blog de CodeMonkey

Manténgase al día sobre las últimas noticias
Y MÁS INFORMACIÓN SOBRE CODIFICACIÓN PARA NIÑOS.