› Free · ages 8–16 and the grown-ups who guide them
Kinds of algorithms.
An algorithm is a set of steps a computer follows. Different jobs need different kinds of steps.
Here are 11 kinds: what each one does, where you meet it, and where it goes wrong. Each one has a game, engine or printable you can try.
Supervised learning
Learn from labeled examples
It looks at examples that come with the right answer and finds a rule that fits them.
- You meet it in
- A spam filter learning from emails people marked as spam.
- Where it goes wrong
- It can memorize the practice examples and still get new ones wrong.
Try it
Unsupervised learning, clustering
Find groups with no labels
Nobody gives it answers. It puts things that are alike near each other and sorts them into piles.
- You meet it in
- A music app grouping songs that sound alike.
- Where it goes wrong
- Look at too few numbers and two very different things can land on the same spot.
Try it
Reinforcement learning
Learn from rewards
It tries something, finds out if it won or lost, and changes what it does next time.
- You meet it in
- A game bot that gets better by playing itself again and again.
- Where it goes wrong
- A habit learned in one maze can freeze or go in circles in a new one.
Try it
Gradient descent
Go downhill
It measures how wrong it is, then takes a small step in the direction that makes it less wrong. Over and over.
- You meet it in
- How almost every AI model is trained.
- Where it goes wrong
- Steps that are too small never get there. Steps that are too big fly right past the bottom.
Try it
Decision trees and if/then rules
Decide by asking questions
It asks yes-or-no questions in order, and each answer picks the next question.
- You meet it in
- A help line menu: press 1 for this, 2 for that.
- Where it goes wrong
- A tree that's perfect on what it has seen can still miss a surprise.
Try it
Search: BFS, Dijkstra, A*
Search for a path
It checks places in a careful order until it reaches the goal, and keeps track of how it got there.
- You meet it in
- A map app finding the fastest way home.
- Where it goes wrong
- A bot that only heads straight for the goal can get stuck behind a wall.
Try it
Sorting
Sort things
It compares two things at a time and swaps them when they're in the wrong order, until everything is in line.
- You meet it in
- Putting search results in order, or a leaderboard.
Try it
PageRank
Rank by links
Something matters more when important things point to it, not just when lots of things do.
- You meet it in
- Early web search deciding which page to show first.
- Where it goes wrong
- The spot with the most arrows pointing at it doesn't always win.
Try it
Language models
Predict what comes next
It cuts text into pieces, counts what usually comes after what, and guesses the next piece.
- You meet it in
- The word suggestions above a phone keyboard.
Try it
Convolution
Look for patterns in pictures
It slides a tiny grid of numbers over a picture and adds up what it finds, which picks out edges and shapes.
- You meet it in
- A phone camera finding faces.
- Where it goes wrong
- An edge finder sees nothing at all in a patch that's one flat color.
Try it
Mixture of experts
Send work to specialists
A router sends each piece of work to the couple of specialists who are best at it, so not everyone works on everything.
- You meet it in
- How some of the biggest AI models save work.
- Where it goes wrong
- Send everything to the same desks and they overflow, so work gets dropped.
Try it
› For grown-ups
Each “where it goes wrong” line is something the linked activity really shows. A kid can make it happen, not just read about it. Want the words behind these ideas? Try the AI concepts field guide.