shahzaib

Every Problem has a Solution

This might be simply written from a sporadic burst of dopamine achieved from solving a seemingly hard programming problem that took a few days for me to figure out, but being able to solve such a problem has made me realize that there is no such thing as an "unsolvable problem" (unless the likes of Terence Tao would say otherwise).

When you are in the progress of learning something new, which in my case was learning programming in Python for use cases in the ai/ml field, you tend to come across a few problems that would create this sense of helplessness. You would feel that this field or course might just be too hard for you to progress ahead. Just a few lessons and problem sets prior, you would be breezing through them, thinking to yourself that "Oh come on, this is too easy!" and then you would stumble across this one problem that shatters your ego completely. Were these problems put in the exercise by the professor intentionally to do that? Maybe :), at least that's what I think.

The lingering feel to give up on the course after seeing such a problem is normal. You would feel that the gears in your brain that processes such questions into sensible solutions and pathways would stop rotating. But I would suggest to take a break; perhaps picking another activity like reading a book or playing video games for some time. Not for a few days, but for a few hours. Take that time to refresh your brain. After that, come back to the problem and take a good look at it. Look at the half written code on your screen, or the rough work on your notebook after roughly trying to solve the exercise problem. Look at the question and compare it with the resources given to you repeatedly. I would be scouring through the Python documentation, you may be searching for clues in your Math or Physics textbook. Suddenly, it will start to make sense like clockwork. Your hands will automatically type on the keyboard, or it will automatically grab that pencil and start creating new ideas that you would've never thought of at the prior stage of hopelessness. And alas, you would have a working program or solution, and believe me, nothing is more motivating than tackling a problem that took you a few days to solve.

Letting your mind relax for a while can do wonders. It reminds me of something Andrej Karpathy said about sleep: "Maybe my brain would commit those shaky short-term memories to the more stable long-term memories.". It's the exact same philosophy applied here, maybe that relaxation time was used by our brain to take that problem to another branch where the contributors (neurons) would work through and push various solutions in the background.

Now, what was that problem that made me write all this? Well, it might be a tad bit underwhelming for a lot of folk, but it was the "Vanity Plates" problem in the loops section of the Harvard's CS50P course that almost had me giving up because I thought I was not smart enough to come up with a solution for this problem, but as the title of this post suggests: Every Problem has a Solution.