Phase 1: Prepare
Step 1 Warm-up recall
Think of a task you do with fixed steps, such as making tea. List the steps and say what must be ready before you start.
Private: nothing you type here is sent or stored.
Step 2 Learning goal
By the end of this lesson you can:
- define a computational problem as inputs, a required output and constraints (Foundation);
- spot what is missing from a vague request (Core);
- write a precise specification for a simple task (Core).
Phase 2: Teach
Step 3 A familiar example
You ask a colleague to “tidy the list”. One person sorts it, another deletes duplicates, a third makes it shorter. The request did not say what a tidy list is, so nobody could be wrong or right.
Step 4 Clear explanation
A computational problem is a question with defined inputs and a required output. A specification states three things: what kind of input is allowed, what the output must be, and any constraints, such as “the list is never empty”. A machine cannot ask what you meant, so anything left open is either guessed or fails.
Compare vague requests with precise specifications:
| Vague request | Precise specification |
|---|---|
| “Sort the students.” | Input: a list of student names. Output: the same names in alphabetical order. Ties keep their original order. |
| “Find the best price.” | Input: a list of prices in pounds. Output: the lowest price in the list. The list has at least one price. |
| “Check the password.” | Input: a text string. Output: yes if it has at least 12 characters, otherwise no. |
A good specification says what the answer is, not how to find it. “Return the lowest price” is a specification. “Check each price and keep the smallest” is a method, which is the subject of Lesson 2. Keeping the two apart lets you ask whether a method is correct: does it always produce the output the specification requires?
Step 5 Worked example (4 marks)
Write a specification for “find the oldest person in a team”.
- Input: a list of people, each with a date of birth. (1 mark)
- Output: the person with the earliest date of birth. (1 mark)
- Constraint: the list has at least one person. (1 mark)
- Open question stated: if two people share the earliest date, return the first in the list. (1 mark)
Phase 3: Practise
Step 6 Learner practice (instant-marked)
1. What are the three parts of a specification?
A specification states the input, the output and any constraints.
2. Which statement is a specification rather than a method?
A specification says what the answer is; the others describe how to find it.
3. Why is “sort the students” a poor specification?
The sort key and the handling of ties are left open.
4. What does a constraint such as “the list is never empty” do?
A constraint defines the valid inputs.
Phase 4: Close
Step 7 Recap
- A computational problem has defined inputs and a required output.
- A specification states the input, the output and the constraints.
- Say what the answer is before saying how to find it.
Step 8 Exit ticket (ungraded)
Write a one-sentence specification for “find the longest word in a sentence”, including what happens in a tie.
Private: nothing you type here is sent or stored.
Step 9 Go further (Extension)
Choose a spreadsheet function you use, such as a sum or a lookup, and write its specification: input, output and one constraint.
Common mistakes
| Mistake | Why it fails |
|---|---|
| Describing steps instead of the answer | That is a method; the specification comes first. |
| Leaving ties undefined | A machine will do something, and you may not like it. |
| Forgetting the invalid input | State which inputs are allowed. |
Limits. This lesson uses small everyday tasks. Real specifications for large systems are longer and are written with the people who will use the result.