Sorting and Predicting
Two of AI's favorite jobs are sorting things into groups and predicting what comes next. See how both work and play a guessing game.
Welcome back!
Step 1 of 13Learn
Job 1: sorting
Many AI tools sort things into groups. Scientists call this classifying.
- An email filter sorts messages into "spam" or "not spam."
- A photo app sorts pictures into "beach," "dogs" or "birthday."
- A recycling robot sorts trash into plastic, paper and metal.
Each time, the AI looks at something new and decides which group it belongs to, based on patterns it learned.
Step 2 of 13Practice · Diagram
A robot sorts trash
Where does a soda can go?
Tap the shape that answers the question, then press Check.
- Trash on the belt
- Plastic
Bottles.
- Paper
Boxes, newspapers.
- Metal
Cans.
Step 3 of 13Practice · Sort into groups
You are the AI! Sort these emails.
Tap an item, then tap its group (or drag it there).
Step 4 of 13Learn
Job 2: predicting
AI also predicts: it uses patterns from the past to guess what comes next.
- A weather computer uses past weather to predict tomorrow's rain.
- A typing app guesses the next word in your message.
- A map app predicts how long your trip will take.
A prediction is a smart guess, not a promise. That is why a forecast can say 70% chance of rain and you still stay dry.
Step 5 of 13Practice · Chart
Chance of rain this week
Which day should you surely pack an umbrella?
Tap the bar that answers the question, then press Check.
Step 6 of 13Practice · Choose one
A typing app suggests "birthday" after you type "Happy". What is the AI doing?
Step 7 of 13Learn
Twenty questions
Some AI sorts things by asking a chain of yes-or-no questions, like the game twenty questions. This is called a decision tree.
To guess an animal: Does it have feathers? No. Does it live in water? Yes. Does it breathe air? Yes. It might be a dolphin!
The AI learns which questions to ask, and in which order, from its training examples. Good questions split the choices quickly.
Step 8 of 13Practice · Diagram
A decision tree guesses an animal
No feathers, lives in water, breathes air. Tap the answer.
Tap the shape that answers the question, then press Check.
- Has feathers?
- Yes: a bird
- No: lives in water?
- No: a land animal
- Yes: breathes air?
- Yes: a dolphin
- No: a fish
Step 9 of 13Practice · Put in order
A decision tree is guessing a fruit. Put its questions in a sensible order, from the most general to the most specific.
Drag the items, or use the arrow buttons, to put them in order.
- Is it long and curved?
- Is it yellow?
- Is it a fruit or a vegetable?
- Is it a banana?
Step 10 of 13Practice · True or false
A prediction made by AI is always correct.
Step 11 of 13Practice · Fill in the blanks
Fill in the blanks
When an AI sorts things into groups, scientists call it .
Step 12 of 13Note
Step 13 of 13Practice · Match the pairs
Is it sorting or predicting? Match each example.
Tap an answer, then tap the place where it belongs (or drag it there).
- Spam filter moves junk mail
- Weather app says rain tomorrow
- Photo app groups dog pictures
- Typing app suggests your next word
Lesson complete!