2.1.1 Computational thinking · Paper 2
Computational thinking: breaking problems down
Each section has pictures and things to try, then its key points and key words. Exam practice is at the end of the page.
You need to know
- Abstraction, decomposition and algorithmic thinking
- How they are used to define and refine problems
You don't need to know
- OCR doesn't rule anything out here.
The three principles
Exam tip: For abstraction questions, say what has been removed and what has been kept.
Try it
Which principle is being used?
- A sat nav shows the roads, but not every building
- Splitting a school website into login, timetable and homework parts
- Writing the steps to make toast, in the right order
- A weather app just shows a rain cloud, not all the readings
- A team shares out the levels of a game between programmers
- Planning the order of the checks when someone logs in
Try it
Abstraction: a program plans bus journeys. Keep or remove each detail?
- The names of the bus stops
- The colour of each bus
- The times buses leave each stop
- The name of the driver
- Which stops each bus route goes to
- The adverts on the side of the bus
Try it
Decomposition: watch a big problem get broken down into a structure diagram.
- The whole problem: an app where students order and pay for school lunch. It is too big to solve in one go.
- Decompose it: break it into smaller parts. Log in, order food, and pay.
- Keep breaking parts down until each one is small enough to solve easily.
- Each small part can now be coded and tested on its own, and different programmers can work on different parts at the same time.
Try it
Algorithmic thinking: put the steps for getting cash in order.
- Put your card in the cash machine
- Type your PIN
- Choose how much money you want
- Take your card back
- Take your cash
Key points
Abstraction
- Abstraction means removing detail that doesn't matter so you can focus on what does.
- A map of the London Underground is an abstraction: it shows stations and lines, but not streets or real distances.
- Programs use abstraction too. A football game stores the score and the time, not the colour of every blade of grass.
- Abstraction makes a problem simpler to solve and quicker to program.
Decomposition
- Decomposition means breaking a big problem into smaller parts that are easier to solve.
- Each small part can be solved, coded and tested on its own.
- Different people can work on different parts at the same time.
- Parts can sometimes be reused in other programs.
- A structure diagram is a picture of a problem after decomposition.
Algorithmic thinking
Before this: Decomposition
- Algorithmic thinking means working out the steps needed to solve a problem, in the right order.
- An algorithm is a set of instructions that solves a problem. A recipe is an everyday algorithm.
- The order matters: brushing your teeth before putting toothpaste on the brush doesn't work.
- Once you have a good algorithm, it can be reused for similar problems.
Key words
Say what each one means, then tap to check.
Exam practice
11 questions in the style of the OCR exam, 27 marks in total. Try each one, then check the mark scheme.
The three principles
Hint
Think of the tube map. What has it left out, and why?
Define means give the exact meaning in one clear sentence.
1 mark: one answer is enough.
Show mark scheme
- Removing / hiding unnecessary detail (to focus on the important parts of a problem).
Don't accept: "Breaking a problem into smaller parts". That is decomposition.
Give two details they could remove using abstraction, and one detail they must keep.
Hint
What does the simulation need in order to work properly? Anything else can be removed.
Give means give a short, clear answer. You don't need to explain it.
3 marks: make 3 separate points.
Show mark scheme
- Remove (max 2): the colour / make of the cars, the weather, the names of the drivers, the shape of the lights' casing, the sound of the engines.
- Keep (1): the order of the light colours / how long each light stays on / the number of cars waiting.
Also accept: Keep: which roads the lights control / the timing pattern.
Don't accept: Removing the light colours or how long they stay on. The simulation needs these to work.
Accept any sensible details. 1 mark each for two things removed, 1 mark for one thing kept.
Hint
To decompose something is to take it apart. What is broken into what?
Describe means say what it is like or what happens. Make each point a separate fact.
2 marks: make 2 separate points.
Show mark scheme
- Breaking a problem down…
- …into smaller, more manageable parts / sub-problems.
Don't accept: "Removing unnecessary detail". That is abstraction.
1 mark for each point.
Hint
Think about solving each part, testing it, and sharing out the work.
Give means give a short, clear answer. You don't need to explain it.
2 marks: make 2 separate points.
Show mark scheme
- Each part is easier to solve / code.
- Parts can be tested separately.
- A team can work on different parts at once.
- Parts can be reused.
1 mark each, max 2
Hint
What does the quiz do at the start, during each question, and at the end?
Decompose means break the problem into smaller parts that could each be solved on their own.
3 marks: check every part before you finish.
Show mark scheme
- Ask the user which times table / how many questions.
- Generate and ask each question.
- Check the answer.
- Keep / update the score.
- Show the final score.
Don't accept: Parts that are too vague, e.g. "make the program".
Don't accept: Three parts that are really the same, e.g. "ask question 1, ask question 2, ask question 3".
1 mark per sensible part, max 3
Hint
A recipe is one. What is it a set of?
State means give a short, clear answer. You don't need to explain it.
1 mark: one answer is enough.
Show mark scheme
- A set of (step-by-step) instructions to solve a problem / complete a task.
A: Check the password matches
B: Enter username and password
C: Show the home page
D: Open the login page
Hint
What must you do before you can type a password? What happens once it has been checked?
Put in order means arrange them from first to last.
3 marks: check every part before you finish.
Show mark scheme
- D first.
- B second, then A.
- C last.
Don't accept: A before B. The password has to be entered before it can be checked.
Example answer
D, B, A, C
1 mark for D first, 1 for B before A, 1 for C last
Mixed questions on the whole page
- A game designer splits a new game into a menu, levels and scoring.
- A map of the school shows only rooms and corridors, not the furniture.
- A student writes out the steps to make a cup of tea, in order.
Hint
Splitting up, leaving out, or putting steps in order: which principle is which?
State means give a short, clear answer. You don't need to explain it.
3 marks: make 3 separate points.
Show mark scheme
- a) Decomposition
- b) Abstraction
- c) Algorithmic thinking
Don't accept: a) "Abstraction". Splitting a problem into parts is decomposition.
1 mark for each.
Hint
What would a driver need to see to follow the route? What wouldn't they need?
Identify means pick out or name the right thing. A short answer is enough.
3 marks: make 3 separate points.
Show mark scheme
- Removed (any two): buildings, trees, house colours, shop names, exact shape of land…
- Kept (any one): roads, junctions, distances, speed limits, destination.
Also accept: Kept: road names, one-way streets, traffic.
Don't accept: Roads or junctions as removed. The driver needs these to follow the route.
2 marks for removed, 1 for kept
Hint
Name a few parts of a ticket website first. Then think: what is easier when the work is split up like that?
Explain means say what happens and why. Words like “because” and “so” help.
4 marks: aim for 4 things said, such as a point and then the reason for it.
Show mark scheme
- Each part (e.g. choosing a film, picking seats, taking payment) is smaller, so it is easier to solve and code…
- …and it can be tested on its own, so errors are easier to find.
- Different programmers can work on different parts at the same time…
- …so the program is finished sooner.
- Parts can be reused, e.g. the payment part in another program…
- …which saves time.
Don't accept: "It makes it easier" with no reason. Say why, e.g. each part is small enough to code and test on its own.
Don't accept: Benefits that are not about decomposing, e.g. "the program runs faster".
Example answer
The ticket program can be split into smaller parts, such as choosing a film, picking seats and taking payment. Each part is easier to code and can be tested on its own, so errors are easier to find. Different programmers can also work on different parts at the same time, so the program is finished sooner.
For each benefit: 1 mark for the benefit, 1 mark for explaining it. Max 4.
Hint
Think of a recipe: the steps, and the order they go in.
Describe means say what it is like or what happens. Make each point a separate fact.
2 marks: make 2 separate points.
Show mark scheme
- Working out the steps needed to solve a problem…
- …in the correct order / so they can be followed to reach a solution.
1 mark for each point.