AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Divide and conquer

Week 13 · 1.7 Software development · 3 lessons
1

Split the big job

Computing 8: Topic 1.7, pp. 150–172
GoalDecompose a big problem, with or without a computer, into sub-problems that can be solved one at a time.
New words
decomposition · breaking a big problem into smaller parts that are easier to solvesub-problem · one of the smaller parts; it can often be split againsingle step · one small action that cannot sensibly be split any further
Explanation

Big problems are hard to solve all at once. Decomposition means breaking a problem into smaller parts called sub-problems. Each sub-problem can be solved on its own, and it may be split again if it is still big. A sub-problem is not the same as a single step. “Choose the teams” is a sub-problem, because it needs several steps. “Pick up the pencil” is only a step. It works for jobs with no computer, like organising an event, and for programs. There is more than one correct way to decompose a problem. Two people may split the same job in different ways, and both can be right if every part of the job is covered.

Count the ballsMark the trackEquipmentChoose teamnamesMake the listsTeamsOrder of racesBreak timesTimetableWater for allFruitRefreshmentsHold a schoolsports morning
Worked examples
Clear the weedsLoosen the soilPrepare thegroundMark the rowsPlant theseedlingsSow and plantMake a wateringrotaPut up a namesignLook after itPlant a herb bed
A second decomposition tree for a job with no computer. The big problem is at the top, the sub-problems are below it, and each one is split again until the pieces are easy to do. Together the three branches cover the whole job.
Ask for thehoursTurn the textinto a numberGet the detailsHours times thehourly rateTake off afamily discountWork out thepricePrint thereceiptShow the resultBike-hire priceprogram
A programming problem: a price calculator for a bike-hire stall. A programmer could split it into getting the information, working out the price, and showing the result. Each part can be written and tested separately.
Split by orderSplit by person
plan the layoutMia: all the writing
write the textKofi: all the drawings
draw the picturesLena: layout and colours
put it togethereveryone: checking
Two different decompositions of “make a class poster” are both correct. One splits by order of work, the other by who does what. Both cover everything.
Class activity

Sticky notes (no computer). Write a big job on a card, for example “organise a family picnic” or “make a school newsletter”. Write each sub-problem on its own small piece of paper and put them under the job. Split any piece that still seems too big, until a single person could do it in one go. Compare your tree with a partner’s. How are they different? Are both correct? Make sure that nothing is missing, and that nothing is just a single step at the top. If you have a computer or tablet, ask an adult to help you draw the tree in a drawing program.

Practice
1
Decompose “make a class newspaper” into three sub-problems, and split one of them again.
???Make a classnewspaper
2
Which of these is a sub-problem and which is a single step? (a) sort the books by subject; (b) pick up one book; (c) design the sports-day certificates; (d) write the pupil’s name on one certificate.
JobSub-problem or single step?
(a) sort the books by subject?
(b) pick up one book?
(c) design the sports-day certificates?
(d) write one name on one certificate?
3
A program asks for two numbers, adds them and shows the answer with a message. Split it into three sub-problems.
4
A pupil says, “There is only one right way to decompose a problem.” Do you agree? Explain.