title: Problem Solving description: > Notes on a basic problem solving approach and how it relates to algorithms and computer science. categories: posts
Table of Contents
Computer science is, ultimately, about problem solving. The way we reason and solve a problem is known as an algorithm. Studying how algorithms work as well as their efficiency is important and beyond the scope of this post. Here we'll only cover a basic problem-solving approach, outline application development, and mention a few things to consider while developing an algorithm.
Start by planning how to find a solution to the problem at hand. List all known facts as well as those we wish we knew. We should change our plan as we learn more about the problem domain.
When we understand a problem we are able to answer most questions about it. In order to understand a problem we need to get rid of ambiguities, and wrong assumptions. Asking for clarification should get rid of the former. While restating the problem should get rid of wrong assumptions. Whenever we need extra help understanding a problems we could:
Break the problem into steps or phases that are easier to solve.
Learn to recognize different problems with similar solutions.
Deduction should help in developing an answer. We could make a table of values. Extend it if possible. Use that data for automated tests.
Try things, observe the results. No guessing, though.
Solving problems can get overwhelming quickly specially when our understanding of the problem is less than ideal; which is the norm. When that happens, go over the techniques for understanding a problem.
A simplistic way of describing application development would be:
Each of these points cover several books. Learning all about them is part of how we solve problems with code.
As we can see, the first two points of the previous section are closely related with how we understand a problem and the algorithm we create to solve it. The experimentation gets done while we implement and test the algorithm.
Check notes under Racket for a systematic approach at application development.
Finally, here's a few things to consider when designing an algorithm: