I oversimplified it: yes, it is class of (decision problems only, afair) problems, not their solution. It should be "if bubble sort is the solution for some problem, that problem is in P". |
Yeah, it's something that's easy to do, because the distinction between P and the set of algorithms or time complexities that are bounded in polynomial time and the problems that have algorithms with running times bounded in polynomial time isn't really much a big deal informally. That and it's perfectly valid to use P to abbreviate any of those things if you like. But when you talk about NP, the distinction is crucial.
A lot of people think P=NP would mean that all algorithms can be done in Polynomial time. Which is what it would mean if P was a set of time complexities in polynomial time, and NP were a set of time complexities not in polynomial time. But the problem with this is pretty obvious.
Anyways, I was just wondering, because it got me curious. I think I probably had a sort of vague incorrect understanding of P and NP in my first years, and it wasn't until later I finally learned what it actually means. I guess one thing is that it's hard to understand what NP is when you define it as Non-Deterministic ... . I think It would have been better if they used a different name. The definition in a book I'm reading, "Introduction to The Theory of Computation" by Sipser ( which is highly recommended ), has a very simple and easy to understand definition,
NP is the class of languages that have polynomial time verifiers. In simpler terms, they are the problems where if you have a correct solution, a machine can look at it and give you back a yes if it correct in polynomial time.
The best example is Cryptography. If you have the secret key, then you can use it to decode the message quickly ( which is analogous to verifying ). However, cracking by brute force cannot be done quickly )?