Specialty Digest

Global English editionLearners’ Study Dashboard — in development
The Knowledge Library for All

Flashcards: open the module flashcards (end-of-module review with workplace questions).

Online Courses / Professional Track / Working with AI

Module 5 · Lesson 2 · Core

Let a tool do the sums: calculators, code and formulas

Have the assistant set out the method as a formula or a short program, then run it with a calculator or spreadsheet you trust.

  • 50 minutes
  • Serves O3
  • Assumes M5.L1

Phase 1: Prepare

Step 1 Warm-up recall

From M5.L1: how do you check a 15% rise from 4,980?

Private: nothing you type here is sent or stored.

Step 2 Learning goal

By the end of this lesson you can:

  • ask for the method as a formula, not just an answer (Foundation);
  • run the formula in a calculator or spreadsheet (Core);
  • work out a compound discount correctly (Core).

Phase 2: Teach

Step 3 A familiar example

A surveyor does not carry the area of a field in his head; he writes the formula, enters the measurements and reads the result. The assistant is best used to write the formula, and the instrument to do the arithmetic.

Step 4 Clear explanation

The strongest habit is to separate setting up the problem from doing the arithmetic. Assistants are good at the first and weaker at the second. Researchers at Carnegie Mellon showed this with a method called PAL: the model read the word problem and wrote it as a short program, and a Python interpreter did the sums. With the same kind of model, this beat chain-of-thought prompting on a standard school-maths test, GSM8K, by about 15 points.

Estimaterough answerCalculatecalculator or codeComparedo they agree?Reportunits and rounding
Estimate first, let a tool do the exact sum, then compare the two.

At work you can copy the idea. Ask: Set out the calculation as a formula with every input named. Do not give a final number. Then enter the formula in a spreadsheet or calculator yourself.

Take a trap: a jacket costs £80, with 20% off and then a further 10% off. Many people add the discounts to 30% and say £56. The tool shows the truth.

StepPriceWhat happened
Start£80.00
After 20% off£64.0080 × 0.80
After a further 10% off£57.6064 × 0.90
Total discount£22.40, or 28%Not 30%, because the second 10% is taken from a smaller price

The two discounts together are 28%, not 30%, because the second 10% applies to a smaller price. The price is £57.60, not £56.

Step 5 Worked example (4 marks)

A supplier gives 15% off £200, then a further 5% off. Find the final price and the total discount.

  1. After 15% off: 200 × 0.85 = £170. (1 mark)
  2. After 5% off: 170 × 0.95 = £161.50. (1 mark)
  3. Total discount = 200 − 161.50 = £38.50. (1 mark)
  4. Share = 38.50 ÷ 200 = 19.25%, so £161.50 and 19.25%, not 20%. (1 mark)

Go deeper: the professor's notes

Ask for the formula; let a tool do the arithmetic.
Formula

Named inputs.

Tool

Calculator or code.

Compare

With your estimate.

Askfor the formulaRuncalculator or codeComparewith estimateReportwith units
Tool

Discounts

StepPrice
Start£80.00
20% off£64.00
10% more off£57.60
Total discount28%

At work: Compound discount

A jacket costs £80 with 20% off, then 10% off.

  1. Multiply by 0.80.
  2. Multiply by 0.90.
  3. Compare with 30% off.

What a careful practitioner decides. The price is £57.60 and the discount is 28%.

Phase 3: Practise

Step 6 Learner practice (instant-marked)

1. A good request to an assistant for a calculation is:

2. £100 with 10% off then 10% off again costs:

3. Two discounts of 20% and 10% together are:

4. Which part do assistants handle best?

Phase 4: Close

Step 7 Recap

  • Ask for the formula, not just the answer.
  • Let a calculator, spreadsheet or code do the exact arithmetic.
  • Successive percentages multiply; they do not add.

Step 8 Exit ticket (ungraded)

£150 with 20% off then 10% off. What is the price?

Private: nothing you type here is sent or stored.

Step 9 Go further (Extension)

Ask an assistant for a formula for a real calculation of yours, then run it in a spreadsheet.

In industry: Let the model write the program and a computer run it

Carnegie Mellon researchers noted that language models often make logical and arithmetic mistakes in the solution step even when they break the problem down correctly. Their method, PAL, had the model read the problem and write a program, then handed the calculation to a Python interpreter. With the Codex model it beat PaLM with chain-of-thought prompting on the GSM8K school-maths benchmark by an absolute 15 percentage points.

Link to this lesson. Use the assistant to set the problem up and a tool to compute it.

Source: Gao et al. (2023), PAL: Program-aided Language Models, ICML 2023; arXiv:2211.10435

Common mistakes

MistakeWhy it fails
Adding successive percentagesMultiply the factors.
Accepting the final number without the methodAsk for the formula.
Typing numbers into the assistant and trusting itCompute in a tool.

Limits. Some assistants now run code themselves; you should still see the formula, because an error in setting up is invisible if only the answer is shown.

Flashcards for this lesson (3)

Tap a card to reveal the answer. Read the question, answer it aloud or in writing first, then check yourself against the explanation.

Card 1 of 3 · How can you check a percentage by working backwards?
15% of 4,980747Change747Matchyes
Check

Apply the percentage to the old value and see whether you get the change. 15 percent of 4,980 is 747, which matches the rise.

Card 2 of 3 · What should you ask an assistant for in a calculation?
Formulanamed inputsTooldoes the sumCompareestimate
Formula

The formula with every input named, not just a final number. Then run it in a calculator, spreadsheet or code you trust.

Card 3 of 3 · What did the PAL method show?
Modelsets upPythoncomputesGainabout 15 pts
PAL

Having a model write a program and a Python interpreter run it beat chain-of-thought prompting on a school-maths test by about 15 points. Set up with the model, compute with a tool.

Review with flashcards

Test yourself on this module with workplace flashcards and detailed answers.

Open the module flashcards