Skip to content
Home » Blog » What is decomposition?

What is decomposition?

Decomposition is part of the foundation of computer science

Decomposition happens when we break down a problem into smaller parts so we can both understand and manage the problem better. For large, complex problems – we can then analyze, solve and design the smaller parts of the problem and then put it all together for a solution.

Decomposition examples

  • Building an airplane – this is a large, complex machine with lots of safety features that need to be built into each part. Consider how we would begin building an airplane. Let’s break it down by the various parts of an airplane – wings, engine, rudder, fuselage, cockpit. Then each part becomes more manageable for a team to work on individually.
  • A large video game like Madden NFL –  How would we begin designing this? Let’s try breaking it down by function – game design, programming, art, audio. Then this would make it easier for us to form teams to plan and divide up the work.

 These are large, complex examples, though. Let’s try a simple problem some of us have faced in our daily routine and try to “brainstorm” a solution by decomposing the problem.


Example # 1 – Simple decomposition example from our daily life – Late for school

You have been late to school 3 times this week. You’d like to fix the problem and be on time starting tomorrow. To start with, define the problem.

Problem definition: Tardy to school multiple times.

Solution we would like: Change morning process so you can’t be late for school ever again!

Decomposition:
1. Why were you late for school?  I missed the school bus.
2. Why did you miss the bus? It leaves exactly at 7:26 AM and I reached there a few minutes late for it.
3. Why were you late by a few minutes? It takes me too long to get all my stuff together (backpack, pack lunch bag, fill water bottle, put on shoes, etc.) in the morning.
Break down “takes time to get all my stuff together” into smaller parts and we’ll have multiple potential solutions:
  1. I have to pack my backpack in the morning: Maybe pack your bag before you go to sleep and place by the door?
  2. It takes me forever to find matching fresh socks in the sock drawer: Organize your sock drawer! Do it anyway, even if you’re not running late! And possibly put fresh socks in your shoes and place them by the door also.
  3. I never know when it’s time to go to the bus stop: Try setting an alarm on your phone or clock to remind you 5 minutes before it’s time to leave.
  4. I have to rinse and fill my water bottle: How about rinsing and filling your water bottle in the night and setting it in the refrigerator?
  5. I have to put an outfit together for school, it takes effort to be this cool: Lay out your “outfit” for the next day so you’re not wasting time looking for them in the morning.
  6. I organize all the above but wake up late and then have to rush: Set an early alarm so you have enough time to get ready.
  7. I end up shutting it off and going back to sleep: Set 2 alarms then! Convince your neighbor to buy a rooster! Whatever helps you get up and going on time.
Now, start implementing 1 or more of the potential solutions and see which one or which combination helps you get to school on time.

 

Latest posts by Aniruddha Pochimcherla (see all)