Algebra in the City All articles
Consumer Maths

The £2.84 Problem: Your Pocket, the Platform Machine, and a One-Penny Gap

Algebra in the City
The £2.84 Problem: Your Pocket, the Platform Machine, and a One-Penny Gap

At 23:14 on platform 12 at Leeds station, the vending machine is the only thing still awake. It hums, it glows, and it carries a sticker that says EXACT CHANGE ONLY. You have a £2 coin, a £1 coin, a 50p, a 20p, a 10p, a 5p, a 2p and a 1p. That is £3.88 in total — comfortably more than the £1.84 bottle of water. Yet the machine will not take your money.

The problem is not your budget. It is your pocket. Exact change turns a handful of coins into a small algebra question, and some prices simply cannot be built from the coins you happen to be carrying. The good news: you can spot the impossible ones before you join the queue.

Your pocket is a tiny equation

Give each coin a variable. Let a be the number of £2 coins, b the number of £1 coins, c the 50p coins, d the 20p coins, e the 10p coins, f the 5p coins, g the 2p coins and h the 1p coins. If the price is P pence, exact change means:

200a + 100b + 50c + 20d + 10e + 5f + 2g + h = P

Here comes the Diophantine part: a, b, c and the rest must be whole numbers, and they cannot be negative. You cannot pay with minus one 20p. They are also bounded by what is in your pocket — in this case, each variable is either 0 or 1, because you have one of each coin. A Diophantine equation asks for integer solutions; a bounded one asks for integer solutions you can actually afford from the contents of your coat.

That sounds formal, but it is just a shopping list with rules. The trick is not to try every combination in your head. The trick is to look at what the coins can do to the last digit — or, more precisely, to the remainder when the price is divided by 5.

The £1.84 problem

Start with a price that works. A £1.85 coffee is easy: £1 + 50p + 20p + 10p + 5p = £1.85. In pence: 100 + 50 + 20 + 10 + 5 = 185.

Now try £1.84. You have a £1 coin, so the remaining 84p has to come from the 50p, 20p, 10p, 5p, 2p and 1p. The 50p, 20p, 10p and 5p are all multiples of 5. They can move the total in steps of 5p, but they cannot create a remainder of 4p. Only the 2p and 1p coins can do that.

You have one 2p and one 1p. Together they can make 0p, 1p, 2p or 3p — but not 4p. And 84 divided by 5 leaves a remainder of 4. So no combination of your coins makes exactly 184p. You can make £1.83: 100 + 50 + 20 + 10 + 2 + 1 = 183. You can make £1.85: 100 + 50 + 20 + 10 + 5 = 185. The £1.84 price sits in the gap between them, one penny away from each side.

That is the station-machine version of being one penny short. You are not short of money in total. You are short of the right penny-shaped building block.

A 30-second check before you queue

You do not need to solve the full equation at the machine. Use the remainder method:

  1. Write the price in pence. For £1.84, that is 184p.
  2. Ignore the coins that are multiples of 5p — the 5p, 10p, 20p, 50p, £1 and £2 coins. They cannot change the remainder when you divide by 5.
  3. Look at your 2p and 1p coins. List every remainder from 0 to 4 you can make with them. With one 2p and one 1p, the list is 0, 1, 2 and 3. No 4.
  4. Compare that list with the price's remainder. If the price leaves a remainder you cannot make, exact change is impossible, however much total money you have.

With one 2p and one 1p, any price ending in 4p or 9p is out — £1.84, £2.84, £4.99, and so on. Add a second 2p coin and the picture changes: now you can make a remainder of 4p with 2p + 2p, and some of those prices come back into play. This is the bounded version of a classic coin problem. With unlimited 2p and 5p coins, the largest amount you cannot make is 3p; with a real pocket, the limits are the whole point.

What the machine is really telling you

A vending machine that gives change turns payment into an inequality: pay at least the price. A machine that demands exact change turns it into an equality, and equalities are fussier. The machine is not judging your arithmetic. It is asking whether a particular Diophantine equation has a solution inside a very small set of coins.

So next time the platform machine glows at you at midnight, do the mod-5 check first. If the price ends in 4p or 9p and you are carrying only one 2p and one 1p, save your dignity and your queue time. The equation has no solution. The crisps can wait for a machine that gives change.

All Articles

Related Articles

The Snaking Line, Solved: Queue Arithmetic for Parcel Season

The Snaking Line, Solved: Queue Arithmetic for Parcel Season

One Number to Rule Your Bill: The Band D Yardstick for Council Tax

One Number to Rule Your Bill: The Band D Yardstick for Council Tax

Three for £3.50? Put Your Lunch Deal Through the Algebra Test

Three for £3.50? Put Your Lunch Deal Through the Algebra Test