How to solve it
Solve it technique
Intro
Over the winter break, I learned about Georgy Polya’s “How to solve it” through a course. “How to solve it” is a book about problem solving. As a mathematician, Polya solved difficult math problems, and the book focuses on math. However, his problem solving techniques can apply into many other fields as well. Let’s briefly look at the technique.
Technique for solving problems
In the course, we utilize four-step problem-solving frame on advent of code problems to familiarize ourselves with problem solving. In the book, there are five steps, which I found was a bit more intuitive for me. Here’s the steps from the book.
Getting acquanted
Before we solve, we want to understand the problem clearly in a big picture. There is no need for little details now. It’s like looking at a painting in a distance. We can figure out what the painting is about.
Working for better understanding
We want to get a much deeper understanding of the problem. To the point where we can have everything related to the problem in our head without looking at the problem. We think about each component and consider how they are important for our problem.
Hunting for the helpful idea
Now we look for ideas that could help us solve the problem. We can look for similar problems we have solved in the past. This can be very straight forward for some problems, but it may not for others. Sometimes problems are related, but hard to find the connection. For instance, some designs in engineering may be inspired from biology.
Carrying out the plan
We take small steps and check for correctness. We think about it in different angles and as ourselves whether it makes sense. In the end, we have the correct solution.
Looking back
We make sure the solution is correct by thinking about it in differnt ways. We try to conquer the problem by simplifying the solution and applying those helpful ideas into other problems. Like our immune system, we can solve this type of problem with ease in the future.
After learning about the technique, I thought the steps were obvious and intuitive. I didn’t think there was anything new or surprising here. I thought to myself, “isn’t it what everyone does to solve any problem?” I was wrong. I learned that I wasn’t following the steps and got punished when I was solving advent of code problems.
Advent of code
Advent of code starts off with easy problems, and I believed in myself. But, I got one of them wrong because I didn’t fully understand the problem. Then, I realized how important it was to follow each step of the technique.
Some of the advent of code problems were very difficult for me, and I got stuck. First of all, it was difficult to even understand the problem for a few of them. After going through different cases by hand, I understood them fully. Even after understanding, it was difficult to come up with a solution. Those were problems I had never seen before, and I had no idea how to solve them. After a couple hours, looking at the problem in different angles helped me get helpful ideas to solve them.
To really conquer the problem and prepare myself for future difficult problems, I looked back at the problem for a review. This step was probably the hardest because I already got the stars from the problems and I just wanted to move on and forget about them. But that doesn’t do anything for me in the long run. To get the most out of those problems, I looked at other people’s code. Many people had interesting dialogues that led to solutions, which helped me look at the problems from different angles.
In the end, I stuck with reading pytudes and try to figure out how Norvig came up with the code. After studying line by line and pretending to be in his shoes, I reproduced his code without looking after a day or two. There could probably be better ways to “look back,” but this was helpful for me to understand the problem better.
Solving other problems
Other than math and coding problems, it is interesting to solve problems in other domains. For instance, from Veritasium’s Youtube video on PCR, we can find out Kary Mullis may have used Polya’s technique to solve his problem and create polymerase chain reaction (PCR). His steps could’ve been: 1. He needed a lot of DNA for testing, and creating DNA from scratch was very tedious and boring. He needed a way to automate or simplify this. 2. As an experienced biochemist he had every component that’s required to build DNA in his head. 3. While driving, he simulated performing PCR in his head and wrote down the notes. 4. He worked with his team to make his idea reality. 5. Trying to automate the tedious work paid off. We got to be lazy.
There may be other fascinating examples in the history.
Conclusion
Of course this technique applies to day to day problems as well with some flexibility and tweaks. I even apply to social problems if I feel like there is a problem with relationships and find ways to solve it. After practicing a lot on solving difficult problems, using the technique got easier. After all, I want to solve as many problems as possible fairly easily.