Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Just to give a little more context, because I think this gripe is very common:

There exists a proof that NAND gates are all you ever need to compute an arbitrary boolean function from M bits to N bits. Actually, you also need a "copy" gate -- the ability to generate two bits with value X from one bit with value X -- and "wires" to communicate values from gate to gate, but that's about it.

The proof starts out like this: "a function from M bits to N bits is actually just N functions from M bits to 1 bit, as long as I can copy the input N times and feed it to the N functions which compute each output bit. So if I solve the problem for M-to-1, I automatically solve M-to-N as long as I have COPY and SWAP gates."

It's very important to see that the exact same approach is being used in the P-vs-NP question. P and NP are designed to be about functions which take M bits to 1 bit, hence they are "decision problems" with a boolean output but a variable input.

The question "P = NP?" can also be phrased more common-sensically, if not totally precisely, as "is brute force ever really necessary?". What is brute force? It is if you have to try a substantial fraction of the 2^M inputs to find a certain 1-bit output. What does this look like here? Well, that gets more complicated because we use scaling of a problem and a system of solution to discuss what's going on.

So a problem is in NP if (1) you can reduce it to some sort of M-bit input to 1-bit output, and (2) there exists some constant number K such that if I double the input size from M to 2M, the circuit has no more than K times the number of gates. This gives the logic circuit a "polynomial-time" size.

Then a problem is in P if we can find an input which makes the output 1 in a polynomial number of gates as well. Thus this is the "inverse" problem, "find me an input which makes this function 1." In fact we've just defined what's called a "satisfiability problem" -- find an input which satisfies this polynomial-size M-variable boolean formula.

A problem is in NP-complete if the recursion holds: if you can implement COPY and NAND and wires in that system in a polynomial number of gates, so that any problem in NP can be written in terms of your problem. This is part of the value of having these "constant K" constraints rather than specifying a given K; we get to define these NP-complete cases as the "hardest cases in NP," because if you can reverse them, then you can reverse any other problem in NP.

Does that help?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: