Blog of Andrés Aravena

Hard problems

20 March 2020

Some students argue that the exercise “find the largest value” is too hard. This raises the question “What do we mean by hard problem”? Some problems are hard to understand, some are hard to translate into a program and some are really hard to solve, even if you have a super-computer.

I would argue that “find the largest value” is not a hard problem, because:

The hard part on this problem seems to be how to explain what we do in our minds. Some people have said that we need to compare all things to all things. But that is not the case, since we only need to compare to the best-so-far option. Imagine how fat you would be if you had to eat all food in order to decide which one is your favorite dish.

So the hardness of this problem is understanding yourself, observing yourself as you make decision, and describe this in simple terms. This capacity is highly valuable. It will allow you to be a better boss, to define better laboratory protocols, or to do sport better. At the end, computational thinking is about communication, with the computer, with other users of the program, and with yourself.

There are, in fact, much harder problems. For example

These problems are hard to program, but people have already solved them. There are known solutions for all of them, that anybody can learn.

In 2003 the Russian mathematician Grigori Perelman solved one of the Millennium Problems, but rejected the million dollars. He also rejected the Fields Medal (which is the Nobel Prize of Mathematics), resigned from the university, moved out of the city and isolated from other people. He rejects interviews and journalists. Apparently being famous was the biggest problem for him.

On the other side, there are other much harder questions that (almost) nobody has solved. In the year 2000, the Clay Mathematics Institute proposed eight problems for the Millennium Prize. If you solve any of these problems they give you 1 million dollars. Only one person has solved one of these problems.

Other computational problems

Outside the scope of this course

Real life problems

The really hard problems have little to do with computers, and are very practical. Some really hard practical problems include:

  • Decide if you should register in the university and study, or instead get a job right now. The richest people in the world, such as Bill Gates, the Google founders, the Facebook guy, the Oracle guy, the Virgin guy, and so, never finished the university. They say that, if they had, they would not be as successful as they are now. But maybe this is only valid if you were born in California and your parents are already rich.Every month in the university is a month you do not get paid. You may fail in the university, and lose all that time. If you finish, maybe the job will not be well paid, especially if you had bad marks in your courses.
  • Passing all courses in the university with good grades. If the courses are good, passing them is hard.
  • Learning the important concepts form each course. Sometimes we memorize enough to pass the exam, but we do not learn. Then the course is time lost.
  • Finding a job. Ideally we want a job that have five characteristics: well paid, entertaining, fulfilling, stable and where we know what to do. Most jobs only have three of these characteristics. Some have less.
  • Moving to another country. Sometimes the best jobs are far away. We have to choose between being close to our family versus having a good job that fills our soul. Both options have good and bad parts.
  • Find how to teach essential life lessons to students that do not care. Figure out how to teach them to be good scientists, or good professionals, or at least good citizens.
  • Decide when to get married, and who to marry. As Elvis said, “only fools rush in”. And when we are in love, we do fool things. If you decide too soon, it may get to the next problem. Maybe if you wait a little you may find a better spouse.
  • Deciding if you should divorce. We all know people that had divorced. It may happen to us. In these cases people can make irrational decisions that may be painful in the long term.
  • If you are very rich, what to do with the money is a very hard problem.
  • If you are poor, how to get enough money in an honest and healthy way is a hard problem.
  • The hardest problem seems to be how to do what you want to do with your life.
  • In fact, the hardest one is deciding what do you want to do with your life.

Can you imagine other real-life problems that do not have easy answer?

The issue here is that each person may have a different solution to every problem, since everybody is different. The circumstances are not the same, and they are not clear. We do not know all the options; we do not know all the consequences; Not all problems have a solution. Some problems have several solution. In these cases people may disagree on what is the solution.we do not know if there is a solution. And if we do not solve the problem, we create another problem.

In contrast, the problems we discuss in class are well defined, have clear consequences, and have at least one correct answer. They are easy problems. Moreover, the strategies that we learn to solve problems can also be used to real-life problems. This is our goal: to learn how to solve problems.

Molecular Biology problems

Let us go back to something “practical”. If we think about Science in general, and Molecular Biology in particular, there are some key hard problems that do involve computers.

As you can see, the hard problems are also the interesting problems.

Inverse problems

Some hard problems come from undoing something easy. For example

  • \(35/2=17.5,\) not integer
  • \(35/3=11.666\ldots,\) not integer
  • \(35/4=8.75,\) not integer
  • \(35/5=7.\) Good!

Thus, we found that \(5\cdot 7=35.\) Try to do that for \(2^{532}-1.\)

All these problems have a common characteristic. They all can be solved by brute force, that is, by trying all the alternatives. For example, to find the integer factors of 35, we can try different values of \(x\in \mathbb{N}\) and see if \(35/x\) is integer.

In other words, it is easy to write a simple program that can “solve” the problem by testing all the options, one by one. Does that means that our internet banking is in danger? No, since easy to write does not mean easy to solve.

All problems can be solved using brute force, given enough time. Some problems have shortcuts, such as method to find the square root or to divide numbers. Some problems that do not have any known shortcut are called NP-complete problems. We do not know if someday we will find a shortcut for these problems, or if it is impossible. So the hardest problem of all problems is to prove that there are no shortcuts for NP-complete problems, or to find a shortcut for any of them.

The issue is that there are too many options, so these simple programs will take a lot of time to find the solution. We are speaking of years, centuries or sometimes more than the age of the universe.

Speaking of the universe, there is a puzzle invented by the French mathematician Édouard Lucas in 1883, called “Tower of Hanoi”. It has three rods and a number of disks of different sizes. You can see the details on Wikipedia. To promote the toy and increase the sales, a story was created:

“Somewhere in the mountains there is a temple with a big version of this puzzle, with 64 disks. Brahmin priests, acting out the command of an ancient prophecy, have been moving these disks in accordance with the immutable rules of Brahma since that time. According to the legend, when the last move of the puzzle is completed, the world will end.”

We can write a program to solve the puzzle. It is the kind of problems we have solved in previous years. Shall we solve it? If we write the program, and we use it to solve the puzzle with 64 disks, will the universe end?