What the Snack Machine Knows
Three short lessons on the maths inside a snack machine: the one number it remembers, why largest-coin-first change works for coins and not for every token, and how much to stock when nobody knows the demand.
For grown-ups, from what CodeRealm teaches children at Spark & Anvil.
- Lesson 1The machine remembers one number
- Lesson 2Largest coin first
- Lesson 3Stocking under uncertainty
The shoebox machine
You'll need: A shoebox, a handful of coins, a card for the state, a few wrapped snacks or tokens as the goods.
- One player is the machine. Write the price on the box and keep the money-so-far on the card, starting at 0.
- The others put in one coin at a time. The machine updates the card, and refuses any coin that would go past the price.
- When the card equals the price, hand over the snack and reset the card to 0. Then change the coins the machine takes, and find a price nobody can reach.
- Swap who is the machine. Talk about what the card is: the only thing the machine knows.
A little history, and what nobody knows
The first machine
The first known vending machine was described by Hero of Alexandria in the first century AD: a coin dropped in released a measured amount of holy water.
Whether his machine was ever built and used in a temple is not known.
Source: Vending machine (Wikipedia)
The same idea, with the world taken away
You start at zero and may only add fours. Can you ever land on exactly ten? Which numbers can you never reach?
Ask it, then let everyone say the answer in their own words. A child's rung on Spark & Anvil ends the same way, with the world gone and the numbers left.
The same idea at every age
- Ages 3–5One Coin, One Snack
- Ages 6–8Exact Change Only and 1 more
- Ages 9–14The Machine’s Memory and 2 more
- Ages 15–18Stock the Slot and 2 more
Your child will meet this idea again at every age. The tools and courses here are the part for you.