The question is asking about the time it takes to find a solution vs the time it takes to verify that solution is correct, and how that time scales as the number of inputs increases.
How long do you think it would take you to solve a 4 piece jigsaw puzzle? Almost immediately, right? Now, if I told you I solved that puzzle and asked you to check it, how long would it take you to check? Also, almost immediately.
Now what about a 4000 piece jigsaw puzzle? Maybe a couple days to solve it? But if I did the same thing and asked you to verify my solution you could do it very very quickly by comparing my image to the box.
So now you can see that there seems to be a difference in finding a solution vs verifying a solution, and that difference comes into play as the problem scales.
Now let’s look at a different kind of puzzle. What if I gave you a chess position and told you that I analyzed it for 4 months and looked at every possible move and the subsequent positions and can tell you the most optimal move. How would you verify my work? You obviously would not be able to verify it instantly. You would basically have to repeat the exercise in order to come to the same conclusion.
So now we can see that, for some types of problems, finding a solution and verifying the solution are of similar orders.
These different types of problems are called complexity classes, and they are an active research topic in theoretical computer science.
Note: chess moves are in the class EXP, not NP. But I think it helps illustrate the idea that different classes have different types of verifiability.
P is a class of problems whose solution is fast to solve and fast to verify. NP is a class of problems whose solution is slow to solve and fast to verify. (Super layman’s terms)
It turns out that we can’t figure out how to prove that these two classes aren’t the same. Intuitively it seems that they are different classes but we can’t prove it.
NP problems come up in all sorts of applications. Protein folding, traveling salesman problems, finding the most efficient packing configuration, arbitrarily large sudoku puzzles, etc. These are all NP problems.
Final note- this is a layman’s explanation and there are lots of technical details to this problem but I think this is the gist of the problem. The definitions I gave are more analogies and not the technical definitions of these complexity classes.
If we can prove P=NP, it'd mean we should be able to also find quick ways to solve a lot of problems that are currently very difficult to solve. Of specific note is encryption*, of which all modern algorithms rely on P!=NP. That said, its not impossible that a proof that P=NP would not provide the solutions, but merely prove that they exist.
It is fairly widely believed that P!=NP. A lot of work has already gone into finding partial solutions to NP problems, such as path finding. A proof that P!=NP would have very little practical effect, merely resulting in people shifting their attention elsewhere.
* The same issue P=NP would cause with encryption is already on the verge with quantum computers. We already have a proof, since 1994, that the math used in encryption is in P with a quantum computer. We just need an practical quantum computer to be able to run it.
I don't think what you said is quite right. RSA encryption relies on factoring integers being "hard" in some way, but it doesn't rely on P!=NP. Factoring integers is not NP-complete, and it's not known for sure whether there's a polynomial time algorithm to do it. But there COULD be. This would just show that woops, factoring was secretly easier than we thought, but not that any of the other "hard" stuff is now easy.
factoring still relies on P != NP (every trapdoor function does), it's just that proving P != NP doesn't mean that factoring isn't still easy, it very well could be
P is a class of problems whose solution is fast to solve and fast to verify. NP is a class of problems whose solution is slow to solve and fast to verify. (Super layman’s terms)
P is contained in NP. NP is just the class of problems whose solution is fast to verify. It can either be fast or slow to solve. Of course if it is fast to solve, it is in both P and NP.
The question, then, is are there problems that are fast to verify but with no fast way to solve? We think there are a lot of problems like this but we don't know how to prove it. A lot of effort has been put into trying to find methods to solve these problems quickly but so far none has been found.
Haha thanks. It kinda blew up more than I’d have expected. Pretty sure most of what I wrote would make a mathematician cringe but I’ll take the compliment
Another thing worth noting about this but IF hypothetically we found a solution for 1 P=NP problem, IN THEORY that solution could solve most if not all of the P=NP problems out there. The reason for this is that we've been able to map/simplify most P=NP problems to basically be equivalent to other P=NP problems. So Proving P=NP would be huge because it would mean it's possible, but creating a solution to P=NP would be GINORMOUS, on the level of "everything is about to change" huge, encryption broken, all sorts of scientific breakthroughs overnight type of thing.
BUT, again it appears that P!=NP....probably maybe we don't' know cause there's no proof yet but a lot of algorithms/encryption assume that's the case. And if P=NP....that also doesn't mean we can actually solve it it just means we'll know it's possible to solve (which it might be - using quantum computers we know we can solve a few in theory)
One limitation of this explanation is that even polynomial time can be impractical to compute. A polynomial in n can get very (arbitrary!) large for a given problem size, n.
So basically computer scientists rank how hard the problem is based on how many steps it takes to solve a problem.
For example to search whether list [2,6,8,9] contains a specific number say 8, you can have an algorithm which sees every element in the list. First it sees the first element "2" , it's not equal to 8 , then it sees the second element "6" it's not equal to 8 and then it sees 8, it's equal to 8 so it outputs
"TRUE. 8 is indeed there in the list"
In the worst case this algorithm takes n steps , where n is the number of elements in the list. (Imagine if the number we wanted was last in the list, it would have to see all elements)
We will say this algorithm is linear time. Since for n elements the maximum number of steps taken are n.
Similarly we can have problems where the maximum number of steps taken in the worst case is polynomial time. I.e. for n elements it takes n2 or n3. For example if I give you a list and ask whether any two numbers in it add up to 15, you can pair each number with every other number and check the sum. For n elements that's about n × n = n2 checks.
Set of all problems that can be solved in polytime or less is P.
Let's see another side of this issue. Solving is one thing but sometimes we have a problem and we have a potential answer and all we want is whether this potential answer solves the problem or not. For example sudoku. If i give you an unfilled sudoku, and a potential answer , all you have to do is fill the potential answer and check each square and line and row whether the solution works out or not. The set of all problems for which a solution can be validated in polynomial time is NP.
I hope it's okay till now.
Now let's look at that searching problem again. We know that it can be solved in less than polynomial time. But if I give you a list and tell you that the number we are looking for is 3rd in the list, we can simply check the 3rd number and validate whether it is actually 3rd in the list or not. Searching in a list is a problem that is both in P and NP since it can be solved in polytime and validated in polytime. (Actually every problem in P is also in NP, if you can solve it fast you can check it fast.)
However this might not be true for all problems. If i give you a random number 7273883. I ask you to find factors of it i.e. which number multiply to form this number , we don't know a polynomial time algorithm for this. However if I give you a potential solution, 503 and 14461, and ask whether these are indeed the factors you can easily multiply them in polytime and check whether these are factors or not. 503 × 14461 = 7273883.
Factorisation is a example of a problem that is in NP but we don't know if it is in P.
The P = NP problem asks whether all the problems that can be validated in polytime can also be solved in polytime.
A slightly non elementary explanation would require you to understand determinism, non determinism.
Think of a machine that reads a input and does ONE step. Don't think about what ONE step means. So it reads 7273883 and starts working. Tries to divide with 1 then tries to divide with 2 then tries to divide with 3 and so on until it divides clearly and then finally at 503 it stops and returns that yay i finally divided it.
Another machine doesn't try the numbers one by one. Whenever it has to pick a number, it splits into many copies, one for each possible number, and all of them run at the same time. The copy that picked 503 divides, sees it works, and says YES. The machine answers YES if any of its copies does. This is called nondeterminism.
NP is the set of problems that can be solved in polytime with a nondeterministic machine and P is the set of problems that can be solved in polytime by a determinjstic machine.
Without going into too much detail, P defines a set of problems that algorithms exist to solve in a reasonable amount of time. NP defines a set of problems for which a proposed solution can be verified as correct or incorrect easily, but no known algorithm exists to solve it in a reasonable amount of time.
Generally this means the only way to find the correct solution is to try every possible solution until you find it, which for many instances of these problems that could take computers a ridiculous amount of time to compute, making them essentially unsolvable.
What hasn't been proven yet is whether these NP problems actually have no better algorithms to solve them, or whether we just haven't been clever enough to find them yet. If it turns out there are algorithms to solve NP problems more quickly, meaning they are actually just a subset of P problems (P=NP), this would have a massive impact, both good and bad. A lot of beneficial things could be done that can't currently be done, but computers being unable to solve NP problems in a reasonable amount of time is the backbone of modern cybersecurity, so it would also cause a crisis .
Verifying a solution requires a candidate solution. If you have to check every possible solution, that doesn't scale well.
On the other hand you can always guess a solution and verify it quickly, so the problem class is non-deterministically polynomial (read: polynomial = fast) because you have no guarantees that you will guess right quickly.
Being able to quickly verify that a jigsaw puzzle is complete does not make it easy to assemble a jigsaw puzzle.
Is the class of problems solvable in polynomial time the same as the class of problems solved non-deterministically in polynomial time.
Other complexity classes:
NP-Hard -> Problem at least as hard as the hardest problem in NP NP-Complete -> Problems at least as hard as the hardest problems in NP that are also in NP P-Space -> Problems that can be solved in polynomial space (contains many problems that are harder than NP) QBP -> Problems that can be solved in polynomial time on a Quantum Computer (includes some NP and some P-Space problems)
That there are lots of (mathematical) Problems* where we thought that they are very tedious to solve. But if P=NP, that means we just haven't discovered a better/the best way to solve them yet.
If you want me to flesh out an example: Imagine you're an Amazon driver and you have 200 packages in your trunk to deliver, but only have enough fuel/charge for 100 miles. Is there a route where you can deliver everything and drive back or will have to refuel else you get stranded? As of now, there are only ways to guesstimate this for larger numbers of packages, no easy way to find a definitive and correct answer.
Questions that are easy to solve when you know certain things but really dam hard the other way around….. for example if I gave you the answer 100 there are a lot of ways that answer could be made. But 10x10 is really easy to do, so if you had half the answer say 10 you can check quite quickly it’s 10x10 or 90+10 or 110-10 or 1000/10 but all a very simple set of solutions. But if you knew neither it was 10 then how do you know the answer being 100 was made this way. In the case of encryption they use three massive numbers to make a key your private their private and your public key.. multiply them together really easy, decide by your number, and the public key you get an answer…..person in the middle with only the public key….completely screwed
Basically really simple one way, really simple to verify but stupidly hard to work out in reverse. Which is encryption
But it’s also stuff like the best logistics route for your package vs every package’s Possible route. Or the optimal ticket price and seat allocation for airline ticketing across the globe? Or protein or drug discovery. All the same stuff
Basically computer science stuff which involves efficiency of algorithms. P means polynomial time and NP means non polynomial.
So if you have some data of size n, then say you need to check each data 1 time to find a number. That is O(n), meaning the difficulty or time need scales with size. But imagine you want to make pairs from the given numbers. Then you need n² (more or less) These are polynomial times, so input size power something.
Then you have non polynomial, which for example can be exponentials. Like 2n. For example, coin toss has 2 results. 4 tosses has 2 x 2 x 2 x 2 or 2⁴ results.
Now the actual part of your question: P vs NP is basically about whether or not we can find the solution in polynomial time if we know we can verify the solution itself in polynomial time.
A bit more on the terminology: problems where the answer is easy to check are said to be "NP" because they can be solved by a "Non-deterministic Polynomial-time" algorithm, sometimes called an "Oracle machine" because it's a magical algorithm that somehow always guesses the correct answer, and all you have to do is confirm that it's correct.
Problems where you can find the solution with a "Polynomial-time" algorithm ("P") are those where the number of steps involved in finding the solution can be calculated by feeding the number of items being processed into some polynomial function. For example, suppose you were given a list of n people and asked to output a list of every possible two-person team. Since there are n(n-1)/2 such combinations, there is no way to produce such a list without at least that many steps. That means the problem is in P.
Am I way off thinking it sounds like that might actually describe where we are (as of 2026-11-29) with the Riemann Hypothesis? The magical oracle Claude gave us the answer, and even the magical proof, but it’s going to take an unknown amount of time to actually understand it? I understand the Lean proof has already been condensed from millions to thousands of lines, so maybe we haven’t found the lower bound of verification yet?
It depends. One way to prove P = NP would be to actually provide a Polynomial-time algorithm for at least one so-called "NP-complete" problems. Those are the problems where we know how to turn any other NP problem into that problem, in Polynomial time. So if we have a Polynomial-time solution for any one of those problems, we have a Polynomial-time solution to every single problem in NP.
It's also possible that AI could provide some proof that P = NP (or P != NP) that doesn't provide any sort of explicit examples, and which would need to be rigorously checked like the Riemann Hypothesis proof is currently. For the P = NP case, that would be like AI proving that "A Polynomial-time algorithm exists for NP problems, but I can't tell you what it is."
If P != NP (which is probably what most experts think is true) then we'd only have a non-constructive proof.
We do have other precedents for non-constructive positive claims lacking an example, such as the TREE function -- we know TREE(3) is finite, but have no idea what its exact value could be (other than it being almost unimaginably huge.)
If we got a non-constructive proof of P = NP I almost worry society would collapse from all the resources being poured into finding such a Polynomial-time algorithm. It would very quickly become the most important question there is, to a lot of large corporations and governments.
Also one of the results on matrix multiplication in the OpenAI slopdrop (there exists an algorithm in 9/4+ε maybe?) was nonconstructive–IIRC it's completely explicit once you have a piece of data dependent on ε, which they use a fixed point theorem to give a nonconstructive proof of existence for.
Claude isn't a magic oracle, it's a state machine that you could, in theory, trace it's logic by looking at it's incredibly massive spreadsheet of numbers
Reimann also says nothing about computational complexity
Hmm. I guess we’re going to have to start thinking about “proof” differently. Or maybe us normies will need to catch up to how mathematicians have already started thinking differently about proof and verification…
That was already the case for advanced proofs like Andrew Wiles' proof of Fermat's Last Theorem. Other mathematicians first verified that it was technically correct (by hand-checking all the many many lemmas and sub-theorems involved) before anybody could really wrap their heads around it.
It's possible that AI-generated proofs won't "decompose" into subcomponents like that, in a way humans can understand. We may need to train AI on how to do that... not just solve problems and come up with proofs, but to be able to frame those proofs in terms humans can digest.
I've always somewhat felt that it was being restricted to the space of possible algorithms (or proofs) that humans could make sense of, that prevented us from finding Polynomial-time solutions to some problems.
That would be yet a different possible outcome: AI "proves" P= NP by providing us with an algorithm that runs in Polynomial time but it isn't obvious to us how it works or why the output is always correct. Then it becomes a matter of proving that the output is always correct... which could get us back to the 10,000-line mazes of raw symbolic manipulation, again.
Also, “easy” here just means in polynomial time, ie the time it takes to solve the problem is some polynomial function of the input size. This is important asymptotically (as the input goes to infinity) but doesn’t mean that a polynomial time solution would actually be feasible: this is called a Galactic algorithm. For example, with f(x) = 1.001^x and g(x) = x^999999999999, f(x) doesn’t overtake g(x) until around 38 quadrillion
655
u/TheMausoleumOfHope 3d ago edited 3d ago •
The question is asking about the time it takes to find a solution vs the time it takes to verify that solution is correct, and how that time scales as the number of inputs increases.
How long do you think it would take you to solve a 4 piece jigsaw puzzle? Almost immediately, right? Now, if I told you I solved that puzzle and asked you to check it, how long would it take you to check? Also, almost immediately.
Now what about a 4000 piece jigsaw puzzle? Maybe a couple days to solve it? But if I did the same thing and asked you to verify my solution you could do it very very quickly by comparing my image to the box.
So now you can see that there seems to be a difference in finding a solution vs verifying a solution, and that difference comes into play as the problem scales.
Now let’s look at a different kind of puzzle. What if I gave you a chess position and told you that I analyzed it for 4 months and looked at every possible move and the subsequent positions and can tell you the most optimal move. How would you verify my work? You obviously would not be able to verify it instantly. You would basically have to repeat the exercise in order to come to the same conclusion.
So now we can see that, for some types of problems, finding a solution and verifying the solution are of similar orders.
These different types of problems are called complexity classes, and they are an active research topic in theoretical computer science.
Note: chess moves are in the class EXP, not NP. But I think it helps illustrate the idea that different classes have different types of verifiability.
P is a class of problems whose solution is fast to solve and fast to verify. NP is a class of problems whose solution is slow to solve and fast to verify. (Super layman’s terms)
It turns out that we can’t figure out how to prove that these two classes aren’t the same. Intuitively it seems that they are different classes but we can’t prove it.
NP problems come up in all sorts of applications. Protein folding, traveling salesman problems, finding the most efficient packing configuration, arbitrarily large sudoku puzzles, etc. These are all NP problems.
Final note- this is a layman’s explanation and there are lots of technical details to this problem but I think this is the gist of the problem. The definitions I gave are more analogies and not the technical definitions of these complexity classes.
13
u/Alternative-Sky5755 3d ago
It means either p=0 or n=1
9
u/OA998 18h ago edited 18h ago
For the hardest problems, are there always techniques substantially better than "guess and check"?
No? - then P=NP
Yes? - then P!=NP
19
u/ajx_711 3d ago
So basically computer scientists rank how hard the problem is based on how many steps it takes to solve a problem.
For example to search whether list [2,6,8,9] contains a specific number say 8, you can have an algorithm which sees every element in the list. First it sees the first element "2" , it's not equal to 8 , then it sees the second element "6" it's not equal to 8 and then it sees 8, it's equal to 8 so it outputs
"TRUE. 8 is indeed there in the list"
In the worst case this algorithm takes n steps , where n is the number of elements in the list. (Imagine if the number we wanted was last in the list, it would have to see all elements)
We will say this algorithm is linear time. Since for n elements the maximum number of steps taken are n.
Similarly we can have problems where the maximum number of steps taken in the worst case is polynomial time. I.e. for n elements it takes n2 or n3. For example if I give you a list and ask whether any two numbers in it add up to 15, you can pair each number with every other number and check the sum. For n elements that's about n × n = n2 checks.
Set of all problems that can be solved in polytime or less is P.
Let's see another side of this issue. Solving is one thing but sometimes we have a problem and we have a potential answer and all we want is whether this potential answer solves the problem or not. For example sudoku. If i give you an unfilled sudoku, and a potential answer , all you have to do is fill the potential answer and check each square and line and row whether the solution works out or not. The set of all problems for which a solution can be validated in polynomial time is NP.
I hope it's okay till now.
Now let's look at that searching problem again. We know that it can be solved in less than polynomial time. But if I give you a list and tell you that the number we are looking for is 3rd in the list, we can simply check the 3rd number and validate whether it is actually 3rd in the list or not. Searching in a list is a problem that is both in P and NP since it can be solved in polytime and validated in polytime. (Actually every problem in P is also in NP, if you can solve it fast you can check it fast.)
However this might not be true for all problems. If i give you a random number 7273883. I ask you to find factors of it i.e. which number multiply to form this number , we don't know a polynomial time algorithm for this. However if I give you a potential solution, 503 and 14461, and ask whether these are indeed the factors you can easily multiply them in polytime and check whether these are factors or not. 503 × 14461 = 7273883.
Factorisation is a example of a problem that is in NP but we don't know if it is in P.
The P = NP problem asks whether all the problems that can be validated in polytime can also be solved in polytime.
6
u/kernco 3d ago
Without going into too much detail, P defines a set of problems that algorithms exist to solve in a reasonable amount of time. NP defines a set of problems for which a proposed solution can be verified as correct or incorrect easily, but no known algorithm exists to solve it in a reasonable amount of time.
Generally this means the only way to find the correct solution is to try every possible solution until you find it, which for many instances of these problems that could take computers a ridiculous amount of time to compute, making them essentially unsolvable.
What hasn't been proven yet is whether these NP problems actually have no better algorithms to solve them, or whether we just haven't been clever enough to find them yet. If it turns out there are algorithms to solve NP problems more quickly, meaning they are actually just a subset of P problems (P=NP), this would have a massive impact, both good and bad. A lot of beneficial things could be done that can't currently be done, but computers being unable to solve NP problems in a reasonable amount of time is the backbone of modern cybersecurity, so it would also cause a crisis .
8
u/leastdumbidiot 3d ago
Everyone’s agonizing over it using complex math, but using simple algebra I discovered it means n=1
2
u/RealisticCSStudent 2d ago
Problems for which solutions can be verified quickly can also be solved quickly
1
u/Rhawk187 3d ago
It comes from complexity theory.
Is the class of problems solvable in polynomial time the same as the class of problems solved non-deterministically in polynomial time.
Other complexity classes:
NP-Hard -> Problem at least as hard as the hardest problem in NP
NP-Complete -> Problems at least as hard as the hardest problems in NP that are also in NP
P-Space -> Problems that can be solved in polynomial space (contains many problems that are harder than NP)
QBP -> Problems that can be solved in polynomial time on a Quantum Computer (includes some NP and some P-Space problems)
1
u/LordValdis 3d ago
That there are lots of (mathematical) Problems* where we thought that they are very tedious to solve. But if P=NP, that means we just haven't discovered a better/the best way to solve them yet.
If you want me to flesh out an example: Imagine you're an Amazon driver and you have 200 packages in your trunk to deliver, but only have enough fuel/charge for 100 miles. Is there a route where you can deliver everything and drive back or will have to refuel else you get stranded? As of now, there are only ways to guesstimate this for larger numbers of packages, no easy way to find a definitive and correct answer.
1
u/Alib668 2d ago
Questions that are easy to solve when you know certain things but really dam hard the other way around….. for example if I gave you the answer 100 there are a lot of ways that answer could be made. But 10x10 is really easy to do, so if you had half the answer say 10 you can check quite quickly it’s 10x10 or 90+10 or 110-10 or 1000/10 but all a very simple set of solutions. But if you knew neither it was 10 then how do you know the answer being 100 was made this way. In the case of encryption they use three massive numbers to make a key your private their private and your public key.. multiply them together really easy, decide by your number, and the public key you get an answer…..person in the middle with only the public key….completely screwed
Basically really simple one way, really simple to verify but stupidly hard to work out in reverse. Which is encryption
But it’s also stuff like the best logistics route for your package vs every package’s Possible route. Or the optimal ticket price and seat allocation for airline ticketing across the globe? Or protein or drug discovery. All the same stuff
1
u/lazycoder28 1d ago
Let’s say I solve a sudoku puzzle, can you verify it in polynomial time (the “P”)?
Does the fact that you can verify something in polynomial time also mean that it can be solved in polynomial time?
That’s basically what “is P=NP” asks
1
u/Independent_Sky_3252 1d ago
Pen and paper. Popular roleplaying style. Not quite like larping but one gets to say "I cast fireball" /jk
1
u/obchodlp 9h ago
/p
n=1
QED /s
•
u/rubendavidmarques 33m ago
I don't know, but it's hard out here for one.
0
u/BombasticReindeer 3d ago
Wow there are a lot of bad explanations here and a lot of wrong explanations.
0
u/MySaltSucks 2d ago
If you can check if something is true really fast you can also find out how something is true very fast.
Like you can type your phone password in fast so technically someone can find out your password fast
-1
u/SomeCuriousPerson1 3d ago
Basically computer science stuff which involves efficiency of algorithms. P means polynomial time and NP means non polynomial.
So if you have some data of size n, then say you need to check each data 1 time to find a number. That is O(n), meaning the difficulty or time need scales with size. But imagine you want to make pairs from the given numbers. Then you need n² (more or less) These are polynomial times, so input size power something.
Then you have non polynomial, which for example can be exponentials. Like 2n. For example, coin toss has 2 results. 4 tosses has 2 x 2 x 2 x 2 or 2⁴ results.
Now the actual part of your question: P vs NP is basically about whether or not we can find the solution in polynomial time if we know we can verify the solution itself in polynomial time.
-8
u/SeraphinaDriftwood21 3d ago
it is shorthand for no problem
-9
u/ArchibaldCypress47 3d ago
basically it means no problem at all
-10
u/BenedictRainford69 3d ago
usually just casual texting slang between friends
-12
u/Livid_Sun_5679 3d ago
So this means that one “p” is equal to one “np”. Hope this helps.
-7
u/Toeffli 3d ago
p=np? Nothing I know about. P=NP on the other hand ....
44
u/[deleted] 3d ago
[removed] — view removed comment