What Is P and NP? - Explained by Viet Dao

  • Context: Undergrad 
  • Thread starter Thread starter VietDao29
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the concepts of P and NP in computational theory, focusing on their definitions, implications, and examples. Participants explore the nature of NP problems, the relationship between P and NP, and specific examples that illustrate these concepts.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Some participants describe NP problems as those that take a lot of time to solve, with examples of exponential growth in iterations based on the number of items.
  • Others clarify that just because a problem requires exponential time does not mean it is in NP, as it could be more complex than NP problems.
  • It is noted that all problems in P are also in NP, but the question of whether all NP problems are in P remains unresolved.
  • A participant provides an example of a problem involving selecting compatible students from a list, suggesting it is in NP due to the ability to verify solutions quickly.
  • Another participant challenges the example by stating that NP encompasses any problem where input leads to output, not just list-based problems.
  • There is a discussion about whether incorporating existing solutions, like a Dean's list, can aid in solving NP problems, with the response indicating limitations due to the infinite nature of possible lists.

Areas of Agreement / Disagreement

Participants express differing views on the definitions and implications of P and NP, with no consensus reached on the relationship between the two classes or the validity of specific examples provided.

Contextual Notes

Some limitations include the complexity of defining NP problems, the nuances in examples provided, and the unresolved nature of whether all NP problems can be solved in polynomial time.

VietDao29
Homework Helper
Messages
1,424
Reaction score
3
Hi,
I saw this in one of the thread here and I haven't seen this before.
Can any of you guys help me understand what it is? Or just show me a web-page that detailedly explain it? I surfed some and they somewhat confused me... :confused:
Thanks very much, :smile:
Viet Dao,
 
Mathematics news on Phys.org
http://www.claymath.org/millennium/P_vs_NP/
 
Last edited by a moderator:
an NP problem is one that takes a LOT of time to solve.

Ie, if you have a list with 4 items, an NP problem would take c^4 iterations to solve it. With 8 items it would be c^8 (grows exponentially)

A P problem isone that has a time 4^c, 8^c, depending on the list. (c is some constant)
 
Hi,
Thanks both of you. It's clearer now.
Thanks,
Viet Dao,
 
Alkatran said:
an NP problem is one that takes a LOT of time to solve.

Ie, if you have a list with 4 items, an NP problem would take c^4 iterations to solve it. With 8 items it would be c^8 (grows exponentially)

A P problem isone that has a time 4^c, 8^c, depending on the list. (c is some constant)

This is actually a really bad way to describe NP. For one thing, just because a problem requires exponential time to solve, it doesn't mean the problem is in NP; it may be a more difficult problem than any problem in NP. And just because a problem is in NP, it doesn't mean it takes a long time to solve; all of the problems in P are also in NP.


Basically, P and NP are concerned with what algorithms run in polynomial time. An algorithm runs in polynomial time if, given some function that describes how long the algorithm takes, you can find a polynomial larger than that function. A more intuitive explanation is that doubling the size of the problem always increases the amount of time it takes to solve it by a constant factor; for example, doubling the size of the problem means it takes four times as long to solve.

Then we consider P to be the class of all problems that can be solved in polynomial time. And we consider NP to be the class of problems where, if you're given a possible solution to the problem, you can verify if that solution is correct or not in polynomial time.

Now clearly if a problem is in P then the problem is in NP; if we know how to solve the problem in polynomial time, then we certainly know how to verify if a solution is correct in polynomial time. The more interesting question is, if a problem is in NP, is it in P? We don't know. That's what the whole P=NP business is about.
 
Hi,
So as I understand, any question which provides you a list of items. And ask you to pick up some of them, and all the picked items must be compatible. And a commondation for 100 students, who are picked from a lists of 400 is an example. Am I correct?
Viet Dao,
 
An example of what?
 
VietDao29 said:
Hi,
So as I understand, any question which provides you a list of items. And ask you to pick up some of them, and all the picked items must be compatible. And a commondation for 100 students, who are picked from a lists of 400 is an example. Am I correct?
Viet Dao,

No, its not just about picking items from a list. It's about any problem where you're given some type of input and asked to produce some type of output. For example, you're given a list and asked to produce a sorted version of the list. Or you're given a graph and asked to find a Hamiltonian cycle in it.

The problem of picking compatible students from a list is just a single example. It's clearly in NP, because if I give you a potential solution, there's a fast way to test if the solution is in fact correct. But it might not be in P; we don't know if there's a fast way to produce a correct list.
 
Hi,
Thanks Master Coda. I understand it now.
Thanks very much, :smile:
Viet Dao,
 
  • #10
master_coda said:
The problem of picking compatible students from a list is just a single example. It's clearly in NP, because if I give you a potential solution, there's a fast way to test if the solution is in fact correct. But it might not be in P; we don't know if there's a fast way to produce a correct list.
Can you not incorporate the solution (ex. the Dean's list) into the decision-making process?
 
  • #11
honestrosewater said:
Can you not incorporate the solution (ex. the Dean's list) into the decision-making process?

You can. But won't really help you solve the problem given a different list of students. You can't incorporate a solution for every possible list, since there are an infinite number of possible lists.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 15 ·
Replies
15
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 131 ·
5
Replies
131
Views
14K
  • · Replies 7 ·
Replies
7
Views
3K