4 ms·
Ah, should've double checked before posting. Thank you everyone who corrected me. Leaving it up for others. > SAT is an NP-complete problem, meaning that it is
by arcastroe 3y ago
Ah, should've double checked before posting. Thank you everyone who corrected me. Leaving it up for others.
> SAT is an NP-complete problem, meaning that it is at least as hard as any other problem in NP
I think this statement is backwards. Instead, any other problem in NP is at least as hard as SAT
- amluto 3y agoNP-complete means that a problem is both NP-hard (it's as hard as anything else in NP) and is in NP (with all that membership in NP implies: there is a polynomial time witness and verifier for a "yes" answer, it's at most polynomially harder than any NP hard problem, etc.).
- tsimionescu 3y agoNope. For example, binary search is in NP (because it is in P), but is much easier than SAT.
- deleted 3y ago[deleted]
- JohnKemeny 3y agoTo be slightly nitpicky, it is problems that belong to complexity classes and not algorithms. Binary search is an algorithm that solves searching in a sorted list. Funnily, although we usually think of it as having complexity O(log n), that does not hold true for the Turing machine model, with which the complexity classes P and NP are defined.
- U2EF1 3y agoJoin the rest of us in post-1950's complexity theory. We can use register machines now. Or you can bust out the big bucks and buy a RASP.
- refulgentis 3y agoWait: ` binary search is in NP (because it is in P),` P = NP!? Casually proved in a HN comment?
- dataflow 3y agoIt's well known that P is a subset of NP.
- refulgentis 3y agoIf you're a fellow dropout like me, context: "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).
- crznp 3y ago> (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.
- strangetortoise 3y agoTo make meaningful statements about P and NP problems, you probably need to be able to model your problem as a computational one. If for example, you model it as a graph, with a peg represented by a node, and a bounce direction to another peg with a directed edge. Assign probabilities to all the edges. Then you cqn simply flood search outwards to the end of the graph, accumulating probabilities by multiplication. Any node on the boundary with probability higher than zero can be reached, given enough balls. This job is clearly in P. I'm not sure it makes sense to talk about "P" for physical problems without a computational model, but I'm not a complexity theorist
- nyrikki 3y agoThinking of this way helps me. NP-complete is the intersection of sets NP and NP-hard , but not the part of NP that contains P. Lots of NP-hard problems are not in NP is important.
- gbacon 3y agoSee this helpful diagram: https://en.wikipedia.org/wiki/NP-hardness#/media/File:P_np_np-complete_np-hard.svg https://en.wikipedia.org/wiki/NP-hardness#/media/File:P_np_n...