NARRATION:Decomposition. No, it’s not your smelly socks or mouldy food rotting away on your bedroom floor. You probably know what decomposition means in everyday life - it’s when stuff breaks down into smaller and smaller parts, and it’s usually not very pleasant.
In computer programming terms, decomposition is much less smelly - it means breaking complicated problems and tasks down into smaller, easier to manage sections. When a computer programmer is faced with a big problem, they start by breaking it down into smaller problems. They ‘decompose’ the problem. They can then break those smaller problems down even further into smaller, simpler parts. By breaking things down it’s often easier to see what needs to be done.
Let’s look at a real life example. This is Carol, she lives in the Stone Age and she has a big problem. Carol is fed up with eating raw meat - it tastes horrible and takes ages to chew. Carol remembers tasting some meat that had been cooked on a fire and it tasted fantastic. Mmm… Carol really wants to try and work out how to make her own fire so she can try cooking some of those woolly mammoth steaks the hunters bring back to the cave.
Carol breaks down the problem: How to make the fire. How to stop the fire spreading. How to cook the meat
Carol breaks each of these smaller problems into even smaller ones… Carol has noticed when she hits two stones together she sometimes sees little fire sparks. Carol uses some mammoth hair to try and catch the fire sparks and see if it will burn. She now thinks about the fire spreading - she needs something that won't burn to keep the fire in one place, rocks and mud might work. Carol can now put the meat on the fire.
By breaking the big problem down into smaller ones, and the even smaller ones, Carol has worked out how to have woolly mammoth steaks for dinner tonight.
Let's get back to the 21st century. A computer game is a complicated business. So many things to think about, to design, to plan. Computer programmers use decomposition to help break the process down into smaller parts. The first thing is to make a list of all the different parts of the game. It’s a bit like planning a story, we need to make sure we have a beginning, middle and end. Let’s break these down.
Story - We need to plan the narrative. What’s our game about? Where do the players start? What’s their mission in the game? How do they win or lose? What's the end goal?
Setting - Where is the game set? Are we going for a castle which has been taken over by fire-eating dragons, or maybe a fast-paced racing game with loads of points to collect along the way?
Characters - Who’s in the game? What powers do they have? What are their quests and missions? How do they gain points and lose lives?
Levels - What are the levels in the game? What does the player have to do to pass each level?
End - How does the player win the game? What’s the end goal?
Once the game designer has broken down the game and thought about each smaller part, then they might decompose each part even further. So for the game setting you would need to look at background graphics, music, sound effects. And for each character you’ll need to think about hair colour, costumes, accessories, how they move.
After breaking everything down each smaller part can be tackled individually. The game designer might even send some of the jobs to other companies such as graphic designers or music composers. Once all these smaller parts are finished they can be combined to make the finished computer game.
On a larger scale, imagine the computer systems that control all the traffic lights, crossing lights and road signals in a big city. Think about all the different devices and programs that need to work together to make sure the traffic flows smoothly. And all of the decisions and actions that those programs need to control. Without decomposing all of those complicated parts down into smaller, easier to manage sections it would be impossible to stop the traffic from jamming up completely.
So remember, if you have a big problem that needs a solution, try breaking it down using decomposition or you too might have to eat raw mammoth steak for your dinner! Mmm!
This short film explains how decomposition involves breaking one big problem down into smaller, more manageable problems that can be tackled step by step.
Decomposition is explored further by looking at the example of an imaginary Stone Age character working out how to cook mammoth steaks over a fire.
She has to work out how to start the fire, keep it from spreading and how to cook the meat safely. We see her working through the problems as she decomposes the big problem and tackles each smaller problem in turn.
The film then looks at how a complex task like making a computer game can be broken down into smaller tasks such as deciding on a setting, making the characters, working out the game play, adding the music, etc. We then see how these smaller elements are combined to make the final, complex outcome.
Finally, the film discusses how decomposition is used to break down large and complex real world problems like controlling traffic, into smaller problems that can be solved using different types of computer systems working together.
This short film is from the BBC Teach series, Cracking Computing.
Teaching Notes
Decomposition can be introduced by looking at familiar everyday problems and breaking them down into smaller problems, using flow charts and diagrams to identify the smaller tasks needed to achieve the larger outcome.
When pupils are working on developing their programming skills by writing algorithms and then creating programs, decomposition is an important skill that they will need to use as they start to learn how to turn their ideas into functional programs.
Modelling and demonstrating ways to do this - using pencil and paper notes, discussion with classmates, drawing diagrams, flow charts, lists, etc. - will help to ensure that the idea of decomposition is an integral part of the programming process from the start.
Other subjects
Maths: Decomposition is a familiar aspect of calculation in the maths curriculum and the process can be compared to the idea of decomposition when programming as they are using the same concepts.
Design & technology: The design process, working out how to fulfill a brief and deliver a functional product, is also similar to the development of a computer program and the concept of decomposition can be useful when applied here.
This short film is suitable for teaching:
- KS2 computing curriculum in England
- Technologies curriculum area at 2nd Level in Scotland
- KS2 digital competence framework in Wales
- KS2 using ICT cross-curricular skill in Northern Ireland

Algorithms. video
This short film for primary schools outlines how algorithms are sets of instructions to make something happen, before explaining further using a recipe analogy.

Computer networks. video
This short film explains computer networks. It looks at different types of computer network and the elements that make up a basic network including clients, servers, switches and hubs.

Creating with computing. video
This short film explores the many creative computing tools we have access to, with a focus on how they are used to create new creative content and media.

Debugging. video
This short film uses computer games to explain debugging, which is the process of finding and correcting errors in computer programs.

Input and output. video
This short film gives a brief history of input and output methods with examples, and brings us up to date with examples of familiar input and output devices that we use every day.

Logical reasoning. video
This short film outlines logical reasoning as ‘sensible thinking’ when following rules, and explains how a problem with a computer program can be solved using logical reasoning.

Repetition. video
This short film for primary schools explains how repetition within computing allows a command to be repeated to make a computer program more efficient.

Search technologies. video
This short film gives a brief history of the development of the internet and the invention of the world wide web by Sir Tim Berners-Lee, and explains the role of a search engine.

Selection. video
This short film covers the use of selection in simple computer programs, and shows how this idea of yes/no questions can allow computers to respond to external conditions and select different paths.

Sequencing. video
This short film covers the concept of sequencing, or making sure things are in the right order, and explores what might happen if things are done in the wrong order, or sequence.

Variables. video
This short film explores how computers use variables to store things that change, like names, numbers and scores.

Working with data. video
This short film explores how data is collected using digital devices in response to questions, and how it is organised into tables, records and fields on a computer system.
