0

http://rationalwiki.org/wiki/Pseudomathematics#P_vs._NP_problem

A computational problem is considered "in P" if an algorithm exists that can solve the problem in "polynomial time" — that is, it's O(n), or O(n2), or O(n3), or any order where the n is raised to some fixed power. If, however, the fastest algorithm is something like O(2n), where the n appears as an exponent, then the problem isn't being solved in polynomial time and isn't "in P".

I recently took an algorithm analysis course that I didn't feel was taught well and I spent a while trying to understand "poly time" and nothing I read led me to believe that an O(2n) algorithm was not considered to be in P. Is that the case?

  • What is your current view on what makes an algorithm polytime? Similarly, what would be an example of a non-polytime algorithm to you? – Derek Elkins left SE Jan 26 '17 at 04:41
  • Welcome to [cs.SE]! Your question is a basic one. Since you did not show your thought process or much of an attempt to consult standard resources, we have little to work with. Let me direct you towards our reference questions which cover your problem in detail. Please work through the related questions listed there and try to solve your problem again. If you're still stuck, edit to include your attempts along with the specific problems you encountered. Your question may then be reopened. Good luck! – D.W. Jan 26 '17 at 06:14
  • Strictly speaking, the article is wrong. For any problem in P, its fastest algorithm is in O(2^n). – Pontus Jan 26 '17 at 07:40
  • @Pontus: You are just confusing things. Your comment is not helpful unless you add some essential information. – gnasher729 Jan 26 '17 at 09:10
  • @gnasher729: Point taken. – Pontus Jan 26 '17 at 09:19
  • Here is some context for Dinosaur12: The O-notation used in the article specifies an upper bound (though there exists related notation to specify lower bounds, or both). Algorithms that scale much better than 2^n are also in O(2^n). Specifically, O(n^k) is a subset of O(2^n) for any constant k. The take home message? The article is wrong, but likely not in the way you suspected. You would be better off studying another reference, the reference questions linked to by D.W. is a good start. – Pontus Jan 26 '17 at 09:28

0 Answers0