ScholaFly

CS10-02 Computer Science Watch

Decomposition and abstraction

Watch on YouTube

In this lesson

Decomposition and abstraction: how to define decomposition as breaking a problem into sub-problems that each do an identifiable task. AQA 8525, Edexcel 1CP2 and OCR J277 GCSE. Algorithms 2 of 9. More at https://scholafly.com

By the end: Define decomposition as breaking a problem into sub-problems that each do an identifiable task, and abstraction as removing unnecessary detail from the PROBLEM, then apply both to a given scenario and explain the benefit each brings to solving it.

What it covers

  1. 0:00 Intro: decomposition and abstraction
  2. 0:38 Decomposition
  3. 2:46 Abstraction
  4. 5:52 What courses ask
  5. 8:10 A scenario question

Key words

About this video

Decomposition and abstraction | GCSE Computer Science | CS10-02

Decomposition and abstraction: how to define decomposition as breaking a problem into sub-problems that each do an identifiable task.
AQA 8525, Edexcel 1CP2 and OCR J277 GCSE. Algorithms 2 of 9.
More at https://scholafly.com

Watch first: CS10-01 - https://youtu.be/pCbMQpRnmuE
Video code: CS10-02 (search "ScholaFly CS10-02")

#GCSEComputerScience #Algorithms

For teachers
This GCSE Computer Science lesson teaches decomposition and abstraction. By the end, students should be able to define decomposition as breaking a problem into sub-problems that each do an identifiable task, and abstraction as removing unnecessary detail from the PROBLEM, then apply both to a given scenario and explain the benefit each brings to solving it. It works through four worked examples and the mistakes examiners report.

Exam board specification references:
AQA 8525
- 3.1.1
Edexcel 1CP2
- 1.1.1
- 6.1.1
OCR J277
- 2.1.1

Read the transcript

The London Underground map gets distances and bends wrong. So why do travellers rely on it every day? Not because nobody notices: anything a traveller does not need was left off on purpose. And a whole school sports day, every race, time and certificate, is too much to plan in one go. Two ideas deal with those two problems, and the skill is using the right one on each.

Decomposition means breaking a problem into a number of sub-problems, so that each sub-problem accomplishes an identifiable task, which might itself be further subdivided. A sub-problem is a smaller problem inside the big one. Identifiable means you could give its job a name, and further subdivided means a part can be split again. The sports day splits into three jobs: entering the competitors, recording the times for each race, and printing a certificate for each winner. Recording the times can split again, one part for each race. Two answers about a school quiz program. Answer A says the scores are kept in one part of the file, in a list of their own. Answer B says one part asks the questions and another part keeps the score. Which answer, A or B, describes decomposition? B. Decomposition is something you do to the problem, splitting it into jobs. A only says where some data already sits. One examiner's report, on a sports day question, says: "Decomposition use was more tricky to correctly identify, as many candidates simply referred to how already separate data was stored." Further on, it adds: "A much more successful approach was to discuss the decomposition of the program, such as having a separate algorithm for each event." The habit that fixes it: describe a job being split off, like one algorithm for each race, never data that was stored apart already.

Abstraction is the process of removing unnecessary detail from a problem. The last three words, from a problem, say what the detail is taken out of. Decomposition splits a problem into pieces and throws nothing away. Abstraction throws detail away and splits nothing. Both make a problem easier, by different means. The Tube map is abstraction. The real distances and bends were removed, because a traveller only needs the stations, the lines and where to change. A satnav turns a real street into a simple map for the driver. Some details from the real street are gone, and some are kept. Name three details a satnav removes, and one it keeps. How does each help the driver? Removed: the trees, the shop signs and the colour of the houses. None of them changes the turns the driver takes, so leaving them off keeps attention on the route. Kept: the roads and their names, because those are what the driver follows. That is the benefit of abstraction. The model keeps only what the problem needs, so it is simple enough to build, and the focus stays on what matters. Two answers to what abstraction means. Answer A: removing parts of the code you do not need. Answer B: removing unnecessary detail. What is wrong with answer A, about code, and answer B, about detail? A takes things out of the program, but abstraction acts on the problem. B is true and stops short, because it never says what the detail comes from. One examiner's report records both: "Question 4 looked at some of the standard definitions and whilst it was pleasing to see over eighty per cent of students successfully identifying decomposition, a lot of the descriptions for abstraction either referred to removing elements from a program or code rather than from the problem, or just stated removing unnecessary detail without qualifying what it is removed from." The fix is three words. Write removing unnecessary detail from the problem, and then name the detail, in this problem, that you would remove.

Definitions are one demand. Some questions want the benefits instead, and others want both ideas used on a scenario, so an answer that can do all three is safe on any course. The benefits of decomposition belong to whoever is solving the problem. Each part can be solved on its own, tested on its own, and handed to a different person to build. The benefit of abstraction belongs to them too. A model with only the detail that matters is quicker to plan, quicker to build, and easier to check. Picture a group of students making a maze game together. Someone says abstraction helps because a simpler character saves file size, and a simpler maze is easier to get round. Why is neither of those a benefit of abstraction for the group? Both are about the finished product and the player. Abstraction helps the people building it, by leaving out what the problem does not need. An examiner's report met both reasons: "Many cited vague benefits and although the definition for abstraction was often given, students were not clear on its benefits or its use. For example: some students thought abstraction would save on file size if a simplified character was used, while others talked about using a simplified maze, because they would be easier to navigate." The fix is to name the people who gain. For the maze group, decomposition gives two benefits: the map, the player and the scoring can be shared out, one person each, and each part can be tested on its own. Abstraction lets them model the map as walls and paths, so it is quicker to plan and build.

When a question gives you a scenario, every sentence of your answer names something from that scenario. A school is building a program for its sports day. It has to enter the competitors, record each race's times, and print a certificate for every winner. A textbook definition of abstraction, with no sports day in it, does not answer this question: it would fit any problem at all. The question wants decomposition and abstraction, one example each, and both must use the sports day. Pause it there and work it out for yourself. Decomposition: split the program into three parts, one to enter the competitors, one to record the times, and one to print the certificates. Recording the times could split again, with a separate algorithm for each race. Abstraction: keep each competitor's name, their event and their time. Leave out their hair colour, the weather and the crowd, since none of them decides who wins. One examiner's report is plain about this: "No marks were given by examiners for generic definitions of what the term abstraction or decomposition means." The same report adds: "Where the context of the sports day was used, candidates were generally successful in achieving this mark." The habit, then: after writing each sentence, check that it names something from the scenario, like a race, a time or a certificate. One more idea sits beside these two on some courses. Algorithmic thinking means working out the steps that solve a problem, and the rest of this chapter is about that.

To finish, each idea gets used once more, on problems this video has not touched. A school trip needs tickets, a coach and permission letters. Give one decomposition. One part sells the tickets, one books the coach, and one sends out and collects the permission letters. Another one: a bus-times app. Name one detail it removes, and one it keeps. It removes things like the driver's name and the colour of the bus. It keeps the stops and the times, because those are what a passenger needs. Now finish this definition: abstraction is removing unnecessary detail from what? From the problem, and never from the code. Try the Tube map last: which idea is it, and what did it leave out? Abstraction. It left out the real distances and bends, and kept the stations, the lines and the places to change.

This video now joins the list. If it is in the bag, press thumbs up so it counts as done, and you never sit through it twice; anything left without one is your list to come back to. If it is still settling, save it, and try both ideas on a problem from your own week, like planning a party.

Next in the chapter: Inputs, processing and outputs, reading what goes into an algorithm and what comes out. Hopefully that's next in your feed, but if not, search for ScholaFly C S ten, oh three.

Every other video is on scholafly.com too, easy to search by video code or by keyword. Whatever you're revising, go there and have a look, or, watch the next video.

Related terms

For: AQA GCSE 8525, Edexcel GCSE 1CP2, OCR GCSE J277

On the specification

BoardSpecStatement
AQA GCSE 85253.1.1Representing algorithms
Edexcel GCSE 1CP21.1.1Explain the benefit of using decomposition and abstraction to model aspects of the real world and to analyse, understand and solve problems.
Edexcel GCSE 1CP26.1.1Use decomposition and abstraction to analyse, understand and solve problems in code.
OCR GCSE J2772.1.1Explain abstraction, decomposition and algorithmic thinking and use them to define and refine a problem.
For teachers

This GCSE Computer Science lesson teaches decomposition and abstraction. By the end, students should be able to define decomposition as breaking a problem into sub-problems that each do an identifiable task, and abstraction as removing unnecessary detail from the PROBLEM, then apply both to a given scenario and explain the benefit each brings to solving it. It works through four worked examples and the mistakes examiners report.