Tuesday, 22 January 2019

P vs NP and binary searches

If I understand right one part of this is the question of whether working forward towards a solution to a problem is of similar order to working backwards from the answer to check it is right.

In my mind the class of problems I'll call mazes are obviously NP. Or even better a monkey climbing a binary tree to find a single banana. At each fork the monkey must chose left or right. Importantly there is no way to know if the banana is there until we get to the end of the branches.

This splits into 2 problems. (1) checking the solution space made up of all the branch ends where the banana could be (2) checking the solution space of paths to the ends of the branches.

The number of possible solutions grows exponentially with the number of forks, and obviously therefore so does the search time for (1) since the only information we have to go on is to look at the end of each branch and see if the banana is there.

There are ways to do this very badly, like set off randomly each time. But if we equip ourselves with a memory, and always chose a left turn initially, and when failed backtrack to the last branch with an unexplored right and take that, we'll cover the whole tree in pretty much optimal time. Whether there is a better solution to that is another question (2).

While the problem has 2 components with (2) being very hard itself, what we can't do is eliminate the fundamental problem of (1) and having to search an exponentially increasing number of possibilities.

But once a solution is known, it is easy to give the monkey a list of left/right turns and have the monkey shin up the tree and check for a banana.

Nothing rigorous but seems to my initial mind that there is an insurmountable problem here that definitely separates N from NP.


No comments:

"The Jewish Fallacy" OR "The Inauthenticity of the West"

I initially thought to start up a discussion to formalise what I was going to name the "Jewish Fallacy" and I'm sure there is ...