3.2 Problem Solving Strategy

3.2 Problem Solving Strategy#

In this page I outline a general strategy for solving the computational problems presented in this course, though these strategies may be applied more broadly.

When solving a problem, I recommend following these steps:

  1. Make sure you understand the problem.

  2. Start writing on paper.

    • Don’t start programming until you have a (high-level) algorithmic solution to the problem on paper (doesn’t have to look like code).

    • Maths expressions aren’t always easy to translate into code, and may need to be manipulated first.

    • If you get stuck while programming, go back to paper.

  3. Work on the solution iteratively, by first reducing the problem into a simpler version.

    • Solve the simpler problem completely and verify your results.

    • Add a little more complexity back into the problem and solve for this completely.

    • Repeat until you have solved the original problem.

    • If the problem has multiple parts that can be worked on in parallel, then work on simplified versions of those parts individually before putting it all together.