Preview

03 - Decomposition

 1. What is decomposition?

  The process of breaking down a problem into smaller manageable parts

  The process of breaking down multiple problems and combining them into one hugely complex problem

  The process of breaking down a problem into more complex problems

  The process of taking a problem and making it bigger

 2. Decomposition helps us solve complex problems and manage ____________.

  our daily emotional life

  extremely simple small projects

  large projects

  the smallest of problems with only one tiny step

 3. The process of making breakfast can be 'decomposed' into:
decomposition1.png

  eating

  making breakfast

  making toast and making tea that can both be further decomposed

  boiling water and adding milk

 4. Decomposition gives us an overview of the problem and how to tackle it, e.g. for making breakfast ….

  only one person could make this breakfast and it would take a very long time to do so

  two people could make this breakfast at the same time, one could make tea and one could make toast

  it is not possible to decompose the 'big problem' into smaller problems

  the process of decomposition makes it obvious that the task is far too complex for even ten people to attempt

 5. Decomposing problems into their smaller parts is not unique to computing: it’s pretty standard in engineering, design and project management.

  TRUE

  FALSE

 6. Why is decomposition useful in the creation of a tablet?
A tablet can be broken down (decomposed) into smaller 
components.
decomposition2.jpg

  It is not useful

  Different people can work on the different components and save time/test more accurately

  It highlights the whole problem as a single entity and creates a sense of urgency

  It shows the immensity and difficulty of the single problem and encourages hard work

 7. Which statement is most accurate (with reference to the below quiz modular diagram)?
decomposition3.jpg

  A quiz cannot be broken down as it a single thing and this diagram is therefore inaccurate

  A quiz can be decomposed into its parts to help the programmer work on each part in turn

  A quiz is a problem that can be broken down into smaller problems but this is not decomposition

  A quiz cannot be decomposed as it is not a problem in itself

 8. Why is it useful to use decomposition when dealing with a large problem?
decomposition4.png

  Easier to delegate and assign different people to work on different parts of the problem

  Easier to debug and manage smaller modules/problems

  Smaller parts of a problem are easier to solve/tackle/understand than the larger problem

  All of these options

 9. Read the following excerpt on top down programming (decomposition) and see if you think it is TRUE or FALSE.
Top down programming
==================================
In top-down programming, a programmer takes a task and 
then breaks it down into smaller tasks. They then take 
each smaller task and break it down further into sub-tasks. 
They continue to do this until each sub-task is simple 
enough to understand and program and, ideally, each 
sub-task performs only one job. The sub-tasks are then 
programmed as self-contained modules of code.

  False

  True

 10. Read this excerpt on reusability of modules and decide whether it is TRUE or FALSE.
Decomposition and re-usability of modules
==================================
Splitting up a problem into modules improves a company's efficiency 
because self-contained modules can be re-used. They can be put into 
a library of modules. When a module is needed to, for example, display 
some values, you don't need to get the programmers to write and test a 
module for this again. You just re-use a module from the library. Over 
time, this will save a company a lot of time and money.

  True

  False

 11. Which of the following statements is an ADVANTAGE of decomposition?
The advantages of decomposition
==================================
#1 >> Splitting up a problem into modules helps get the job done more 
efficiently because modules of code can be worked on at the same time 
by different programmers. In addition, it helps because easier modules 
can be given to less experienced programmers while the harder ones can 
be given to more experienced ones.

#2 >> Splitting up a problem into modules helps program testing because 
it is easier to debug lots of smaller self-contained modules than one 
big program.

#3 >> Splitting up a problem into modules helps program readability 
because it is easier to follow what is going on in smaller modules 
than a big program.

#4 >> Splitting up a problem into modules improves a company's 
efficiency because self-contained modules can be re-used. They can be 
put into a library of modules. When a module is needed to, for example, 
display some values, you don't need to get the programmers to write and 
test a module for this again. You just re-use a module from the library. 
Over time, this will save a company a lot of time and money.

#5 >> Splitting up a problem into modules improves a Project Manager's 
ability to monitor the progress of a program. Modules can be 'ticked 
off the list' as they are done and this will demonstrate some progress. 
This is far harder for a Project Manager to do if the program has not 
been split up into modules.

#6 >> Splitting up a problem into modules is good for future program 
maintenance. If a program needs to be changed for any reason, it may 
be possible simply to remove one module of code and replace it with 
another.

  #1, #2 and #4

  None of the above

  All of the above

  Just #1 and #3

 12. In programming, one way of decomposing a task is to break it into…..

  modules (e.g. separate functions or subroutines)

  python programming code variables

  binary sequences

  N/A - decomposition cannot be used in programming

 13. How would you decompose the task of creating an app?

  By making the problem a single whole entity by using an overview diagram (to define a single task)

  First know the answer to a series of smaller problems e.g. will it be android or iphone, what is the colour scheme, what language will you use?

  By finding other similar apps and copying their code

  The task of building an app can simply not be decomposed

 14. Dealing with many different stages all at once is much more difficult than breaking a problem down into a number of smaller problems and solving each one, one at a time.

  FALSE

  TRUE

 15. Which of these is an example of decomposition?

  Watching a mechanic repair a bicycle

  None of the above

  Looking at different bicycles for similarities between them

  Finding out how a bicycle works by looking in detail at the different parts that make up the bicycle