SpicyRicecaker

Is Looking at the Solution Tantamount to Giving Up?


In advent of code 2022 this year, I was able to solve many more problems than last year. However, now I’m currently at the point in time where I’m able to come up with a so-called “naive” solution to a problem but seemingly unable to solve the problem in a reasonable amount of time.

Wrapping my head around the problem and trying out some of the naive solutions already took a ton of time, and I poured a lot of effort into it, but the problem is still unsolved.

The question remaining is, should I pour more time into trying to solve this problem, or should I just “give up” and look for advice in the reddit forums?

The crux of the issue is, when presented with a difficult computer programming problem with an existing solution, is it better to look up the solution or is it just better to try and tackle the problem for hours or days, even if it doesn’t lead to a solution?

The “Specialized Skill” View

Let’s consider the results of going with each option first. If we look up the solution, then we’d be able to get the solution in a fraction of the time, but we would have used our “problem solving muscle” less, and as a result, it’d become stronger by only a small amount. On the other hand, If we try to tackle the problem relentlessly without giving up until we find the solution by ourselves, it could take anywhere from a moment longer, a couple of hours, a day, years, or maybe even forever. Though we’d train our problem solving muscles much more and probably have a deeper understanding of the particular problem at hand.

Both methods lead to the solution, the difference the amount of time spent and problem understanding and problem-solving skill gained.

But then we’d have to question what kind of problem-solving skill we’re really gaining. Because both methods we described above, when carried out, lead to solving the problem, but one in a much less amount of time than the other. If time was our metric for solving problems effectively, then it’d seem that looking up problems is better. On the other hand, if solving problems we’d never seen before was our metric, keeping at a problem for longer would probably be better. Or would it?

Because part of solving problems is being able to know the ways that people have looked at a problem in the past. In the time that it takes us to solve a single problem alone and without help, we could’ve looked up the solution algorithms of multiple problems of harder and harder difficulty.

To put this into perspective, sure, we could’ve tried to come up with the formula for the quadratic formula by spending months alone, but in that same amount of time, if we drew upon the knowledge of textbooks, we would probably be able to learn algebra, precalc, and calc, and as a result be able to solve more problems in different ways (though, on one hand we’re training how to derive formulas and on the other we’re training on their existence and how to apply them).

On the other hand, persisting with the problem would grant a lot of mastery with that problem, and it would probably be easier to recognize similar problems in the future. So, if we were looking at the academic field, and arguing that persisting with a difficult problem without help could help us with solving difficult problems in research, it’d probably depend more on knowing the problem at hand than any general problem-solving skill.

Memorizing Algorithms & The “Pride” View

We are already standing on the shoulders of giants. Coding is a global endeavor: computers are built off of existing hardware such as cpus, gpus, and conventions that have been built over decades.

While using external libraries is one thing, programming languages all have standard libraries that we’re already using.

We can program in javascript, which is built in c++, or use c++, which translates to machine code that runs on circuits in the CPU, or maybe we could use logic gates to try and solve a problem. Each is built on years and years of work, and so the idea of persisting at a problem alone with the tool at hand of a base programming language is already drawing upon help from thousands of people.

Or maybe even look at the english language itself. Every single word I’ve typed on this entire blog already exists in a dictionary. Someone, or a collection of people had to decide the lexeme structure of the language: the shape of the letters of the alphabet, the separation of characters of a word by spaces, and people had to come up with the pronounciation of words, their spelling, as well as their definition and uses. If I was born into the stone age without language, I would undoubtedly not be able to think or easily grasp problems of the scope, even if my intelligence level were the same.

What I find is that in trying to solve a problem, I’m holding onto my pride of being smart enough to solve the problem by myself, but in reality we’re already “standing on a million lives”.

We still teach in physics classrooms in schools today how to derive the gravitational constant by dropping a ball from a certain height and taking snapshots of its velocity. Or run through the formal proofs of some formula in geometry rather than thinking about how to use that formula. But we also have problems where we’re asked to apply those constants and formulas all the same.

It’s tempting, at least for me, to suppose that the methods of solving a problem are either black-or-white “giving up” and looking at the solution or being obstinate and tackling the problem alone until a solution presents itself, but in reality we can’t help knowing what we already know: our english and programming language of choice, the problems we’ve encountered in the past, maybe even a hint given by a friend.

There’s too many solutions to too many problems out there in the world for us to solve all alone in isolation. So long as we try our hand at it first and seek to learn, I think that we should acknowledge our predecessors, and not be afraid to “give up” on a problem that’s already been solved.