# “Given an algorithm, decide whether it runs in polynomial time” is this problem in NP?

This problem is not decidable (reducible to halting problem) but is semi-decidable and therefor verifiable (as those two definitions are equivalent: How to prove semi-decidable = verifiable?).

However, is this problem poly-time verifiable?

A decision problem $$P$$ is poly time verifiable iff there is an algorithm π called verifier such that if $$P(w)=$$ππΈπ then there is a string $$c$$ s.t. $$π(w,c)=$$ππΈπ, if $$P(w)=ππ$$ then for all strings $$c$$, $$π(w,c)=$$ππ and V runs in $$O(w^{k})$$ for some constant $$k$$ for all inputs $$w$$.

• Please edit your question to include a definition of the term "poly-time verifiable". The example does no appear to be a special case of the general question, because it is possible for a program $p$ to be in $P$ even if it is not an element of that enumeration. The reason has to do with the fact that two different programs can decide the same language, and "equivalent" (in terms of behavior) is not the same as equal (syntactically). – D.W. Jun 21 '20 at 21:50
• @D.W. I know that this is a separate question, but can you verify a string is an element of the above enumeration of P (or can you do this for any other enumeration of P for that matter)? I'll edit the question accordingly thank you! Just curious since you pointed out that this is a different question. – DeeDee Jun 21 '20 at 21:56
• @D.W. i ask the above question in the comments because an answer would greatly clarify why it is not an example and then i can remove it. It seems that we could efficiently decide whether a string fits the encoding in the example (is a member of the enumeration) in poly time, or at least that we could verify in poly time one of its members? – DeeDee Jun 21 '20 at 22:07
• @D.W. okay, I removed it and asked it separately: cs.stackexchange.com/questions/127525/… Curious about these two, sorry. – DeeDee Jun 21 '20 at 22:26

Why in exponential time? Because $$V$$ runs in time $$|w|^k$$, it can read at most $$|w|^k$$ bits of the input. So, it suffices to enumerate all possible strings $$c$$ of length at most $$|w|^k$$, and run $$V$$ on each of them. The running time will be about $$2^{|w|^k}$$, which is finite and thus enough to make the original problem decidable.