A girl and a robot thinking together

Let’s think it through · Start with a story

The robot has to run a scoring contest: collect scores, find the winner, and print certificates. The girl breaks the job into small tasks that can be checked one by one.

Break down the process

Follow the numbered steps, then explain them in your own words
  1. CollectCheck that scores are valid
  2. CalculateFind the highest score
  3. Handle tiesChoose the winners according to the rules
  4. PresentOutput the list

Breaking a problem down gives each step clear inputs and outputs.

Together, the subtasks still have to cover the original problem. For example, splitting the work must not make you forget to handle ties.

01Why break a problem down?

A big problem can be hard to think through all at once, but many big problems consist of several simpler tasks.

Big problem→Several smaller problems→Combine the answers

02Break it down into steps

For example: “Read scores and output the name of the student with the highest score.”

  1. Read the data.
  2. Find the highest score.
  3. Record the student associated with it.
  4. Output the answer.

03Break it down into subproblems

This is common in recursion and dynamic programming:

Current problem = smaller subproblem + work for this step

Factorials, range problems, and tree structures are often approached this way.

04Solve a simplified version first

If the original problem is complicated, start by asking:

  • What if n were only 5?
  • What if we only needed to decide “whether any exist” rather than find the best answer?
  • What if one of the special constraints were removed?

A simplified version often makes the core structure easier to see.

05Is smaller always better?

No.

If each tiny subproblem depends on many outside details, breaking things down too far can make their relationships more confusing.

06How do you know if the breakdown makes sense?

Clear responsibilities

What does each part solve?

Clear interfaces

What input does it need, and what result does it produce?

Combinable results

Can the smaller answers be combined into the final answer?

What you have learned

  • A complex problem can be broken into simpler subtasks.
  • You can break it down by steps, states, or smaller subproblems.
  • Solving a simplified version first can reveal the core pattern.
  • Breaking a problem into pieces that are too small can add complexity.
  • A good breakdown has clear responsibilities, clear inputs and outputs, and parts that can be combined.

Next: Why Start with the Simplest Case?

Your turn

If a function that finds the winner returns 2, how will the display function know whether that means second place, index 2, or a score of 2?

Have an answer? Click to see the explanation

Agree on what the return value means and how items are numbered. Use a clear name or structure to represent it.