Step 1 : Problem

Would you follow the busiest path?

You are looking for somewhere to eat and notice a busy lane. You follow it, only to find that the nearest stall has sold out. Other stalls still have food, but they are farther away or harder to reach.

A busy path tells you where people have been. How would you decide whether it is still worth following?

Step 2 : The Story

🐜 An afternoon in the ant colony

Twenty hungry ants live at the edge of a garden. Four paths lead to food. One smells especially promising, but every patch holds a limited supply, and some journeys take much longer than others.

You cannot steer each ant. You can choose the instruction the whole colony follows. Bring home as much food as possible before sunset.

  • Level 1: choose whether ants strongly follow smells, explore unfamiliar paths, or combine the two.
  • Level 2: replay the same garden and choose how much smell, distance, food, and path difficulty matter.
  • Each ant carries one piece at a time. Stones and puddles slow ants in both directions. Food counts only when it reaches the nest.
  • Successful returns strengthen a path's smell; smells fade over time. A patch can run out while its trail still smells strong.
  • Each day lasts 90 simulated seconds. Pause, change playback speed, or skip to sunset to see the result immediately.
  • Compare food collected, completed returns, and time spent on empty paths. Replay either level to try another instruction.
Step 3: Game

The Ant Colony

Step 4: Reflect

What did you notice in the garden?

Think about the clues the colony uses. Explain your reasoning in your own words.

01
What clues about a path could help the ants decide whether it is worth following? What does each clue tell them?
02
Why might one clue, such as a strong smell, give an incomplete picture of a path? What other clues would help?
03
Distance and food amount use different measurements. How could you turn them into signals the ants could compare or combine?
04
Could you create a new clue by combining existing ones, for example, how much food a path offers for the effort of travelling it? What would that reveal?
05
In Level 2, the path marked “Looks promising” could change during the day. What could cause this change, even though the paths themselves stayed in the same place?
Step 5: Concept

From Clues to Features

Definition

Feature engineering means choosing, transforming, or combining information into useful inputs for a computer system. These inputs are called features.

Mechanism

In the garden, smell, distance, remaining food, and obstacles describe each path. These are the colony's features.

  • Choose useful clues: One clue may give an incomplete picture. A strong smell does not tell the ants how much food remains.
  • Make clues comparable: The game turns distance into nearness and obstacles into ease, then combines these scores using the importance you assign.
  • Describe the current situation: Food and smell change during the day. As their values change, a different path can look promising.

You could also create a new feature by combining clues, for example, food available per unit of travel time. This is a feature you could design, rather than one currently used by the game.

Vocabulary

Feature: a useful input. Derived feature: a clue created from other clues. Weight: how much a clue matters when combining scores.

Step 6: Exercise

Put the idea to work

Apply feature engineering to new situations. Explain your choices and the tradeoffs involved.

01
A bus app predicts that every 5 km journey takes 15 minutes, but actual times range from 12 to 35 minutes. What features could explain this variation? Propose one feature that combines two measurements and explain how you would test its usefulness.
02
You are designing a system to predict which crops need watering, but you have little farming knowledge. How would you identify useful features? How would you distinguish a feature that works across seasons from one that reflects a temporary pattern?
03
A fitness app collects 50 motion readings per second. What features could summarise a 10-second interval to distinguish walking from running? How would you make them useful whether the phone is in a hand, pocket, or bag?
04
A machine-failure predictor improves from 78% to 96% accuracy after adding replacement-part orders as a feature. However, parts are often ordered after a fault is discovered. What would you investigate to decide whether this feature supports a valid prediction?
05
A delivery system uses distance and historical traffic to rank routes. During a festival, its preferred routes become slow. How would you redesign its features to respond to changing conditions without reacting too strongly to a few unusual journeys?
06
A drone has 2 seconds to assess 8 landing sites. Checking flatness takes 0.05 seconds per site, while checking surface strength takes 0.4 seconds. If checks run one at a time, how would you prioritise them? Explain how you would evaluate the balance between speed and landing safety.