` binary search is in NP (because it is in P),`
P = NP!? Casually proved in a HN comment?
"P" is the class of problems that can be solved by a deterministic Turing machine in polynomial time. "NP" stands for "nondeterministic polynomial time," and is the class of problems for which a solution can be _verified_ in polynomial time by a deterministic Turing machine, given the correct "hint" or "certificate." Every problem in P is also in NP, since if a problem can be solved in polynomial time, its solution can certainly be verified in polynomial time (just solve the problem again).
Certainly P is a subset of NP, but is this statement always true?
Consider a Galton board where a marble is dropped into an array of pegs. At each peg, it can go left or right at random (assume it never bounces further). After some number of choices, it falls into a slot.
Finding a solution (a slot that a marble can fall into) is easy: drop one marble. But it could take many marbles to verify that a marble can fall into a given slot.
As described, that is easy: all left choices, all right choices, everything in between. But imagine that the choices aren't fair, directly observable, or linear (LR != RL). Then it gets tricky.
I've never thought about non-deterministic problems of that sort in the context of computational theory, but it isn't uncommon in nature.
Indeed the Cook-Levin theorem
> https://en.wikipedia.org/wiki/Cook%E2%80%93Levin_theorem
which actually proves that there exist NP-complete problems in NP is not a trivial result (and was at that time a highly surprising one).
So, indeed, "one half of the proof" has been done; the other half (which seems to be much harder) of P vs NP is still open.