Unclear about the definitions of $P$ and $NP$

96 Views Asked by At

I am trying to build my intuition about the np-completeness problem.

As I understand, it is well-known that there are problems that are neither $P$ nor $NP$.

Here is an example of a problem that is beyond $np$ taken from this quora question;

Input: A function that accepts no inputs and returns an integer (if it returns at all).

Output: False if the input function returns 0, otherwise True.

Assume there is an unordered set $S$ of computation problems such that there is an infinite number of problems that are $p$ and an infinite number of problems that are neither $p$ nor $np$

Now, until an algorithm is found for a given problem in the above set, it is not known if the problem is $P$ or beyond $NP$.

Here's where I am unclear.

The problem of finding an integer $i > 0$ algorithms that are in $S$ that are $p$ would itself not be a $p$ complex because the time to solution does not vary as a polynomial function on the size of $i$ (taken from the first paragraph of this wikipedia article). Am I wrong?

But finding $i$ such algorithms is clearly $NP$ complete since it is verifiable in polynomial time by definition of its algorithm having complexity $P$.

Clearly, this supposition cannot be correct. Where am I wrong in my understadning of definitions? Did I misunderstand $P$? Did I misunderstand $NP$?


Update: I believe that Thomas Andrews answered my question.

Each problem would clearly be $NP$, or not $NP$. The algorithm itself is irrelevant. So, the problem of finding $i$ such problems would always be $P$.

The example that I outlined makes a bad assumption. It would never be the case where it was unclear if a problem was $NP$ or not $NP$.

I will spend more time thinking about this (it is not yet fully clear to me).

1

There are 1 best solutions below

0
On BEST ANSWER

If I understand the question correctly, the problem you are describing is:

Given a set of decision problems $S = S_{P} \cup S_{\neg NP}$ where $S_P$ and $S_{\neg NP}$ are both infinite sets such that $S_P \subseteq P$ and $s \in S_{\neg NP} \implies s \not\in NP$,

and given an integer value $i$,

find a subset $X \subset S$ such that $|X| = i$ and $X \subseteq P$.

If this is correct, I notice a few problems in your question (other than some confusion about the role of problems and algorithms, note that problems are in $P$ or $NP$, not algorithms):

  1. When you say that "the time to solution does not vary as a polynomial function on the size of $i$" you are missing the fact that the set $S$ is also an input of the problem, and therefore its size must be accounted for.
  2. I don't see how "finding $i$ such algorithms is clearly $NP$ complete since it is verifiable in polynomial time by definition of its algorithm having complexity $P$". Suppose you are given a solution $X \subseteq S$, then verifying that a given problem $x \in X$ is in $P$ is definitely nontrivial (i would be surprised if, for example, verifying that SAT belongs to P could be done so easily ;) ). If I were to wildly guess, being able to verify that $X$ is a solution in polynomial time would imply that being able to verify that a given problem is in $P$ can be done in constant time. In particular, even if the solution to be verified was composed of a set $(x, a)$ of $i$ problem-algorithm pairs such that $a$ is a polynomial algorithm solving problem $x$, verifying that each algorithm has a polynomial worst-case complexity would be a difficult task (afterall, it boils down to constructing a generally nontrivial proof, right?)

Hope this helps.