2

I've found the following statement:

If a program P for Non Deterministic Turing Machine solves a decision problem in time limited by a polynomial p(S), where S-size of input, then it can be run on a Deterministic Turing Machine, and the solution will be found in time limited in time O(2^p(S)).

My question is whether this statement is correct and how could we prove it? The exact value 2 is suspicious here.

user107986
  • 1,461
  • 1
  • 17
  • 24
  • Are you sure that's not supposed to be 2^O(p(s))? – templatetypedef Jan 30 '15 at 21:58
  • I'm not. But if you can prove it's 2^O(p(s)) then it doesn't matter, right? – user107986 Jan 30 '15 at 22:04
  • O(2^p(s)) and 2^O(p(s)) actually aren't the same thing. If that would clear things up, I'd be happy to put that into an answer. (I'm also skeptical, by the way, that the runtime would be O(2^p(s)), though I'm certain that it's 2^O(p(s)). – templatetypedef Jan 30 '15 at 22:16
  • What does `2^O(p(S))` even mean? `O(p(S)` is a statement about upper bounds on function growth. It is not actually a function. Conversely, you'd still need an outer `O(2^{...})` to make a statement about runtime complexity of the deterministic machine. – ganbustein Jan 30 '15 at 22:22

1 Answers1

3

The deterministic Turing Machine simply emulates the non-deterministic Turing machine. Each time the NDTM takes a fork, the DTM pushes one branch and takes the other. When it has followed one possible chain for p(S) steps without reaching an accepting state, it backtracks to a previous branch point.

This assumes the NTDM only does two-way branches. If it can take up to k branches, rewrite it as a machine that only does two-way branches, increasing its running time to O(log_2(k) p(S)), which makes it still technically O(p(S)). There's a little bit of sloppiness here. O(2^{x p(S)} is larger than O(2^{p(S)}) if x > 1, so although we can ignore constant factors multiplying the full expression, we can't ignore them in the exponent.

ganbustein
  • 1,593
  • 11
  • 10
  • So you are saying that a NDTM at any point can have more than 2 possibilities of the next action? And your point is the statement in my original question is true only if we assume NDTM does two way branches, right? – user107986 Jan 31 '15 at 22:05
  • Well, more than one possible action is what makes it non-deterministic. An NDTM that never has more than _k_ options can be rewritten as one that never has more than 2, at the expense of increasing its running time by a factor of log_2(k). I think the statement you saw assumes that the NDTM has been so re-written, which is where the 2 comes from. – ganbustein Feb 01 '15 at 08:12
  • Do you have a source with a proof of the fact that every NDTM with k options can be transformed into a NDTM with 2 options? – user107986 Feb 01 '15 at 08:38
  • Consider it a homework assignment. The proof is trivial, one you should be able to come up with on your own. – ganbustein Feb 01 '15 at 08:41
  • Ok, I think I got it. One more thing - the running time of NDTM is the time needed to guess an answer leading to a final state. Or is it the time needed to guess the answer AND verify it? Assuming the first answer is correct, then we can treat the decision tree height to be at most p(s) - ignoring the infinite branches. And knowing that the longest path from the start to final state takes p(S), we can treat p(S) as path length. Then the answer O(2^p(S)) is obvious. Am I getting it yet? – user107986 Feb 01 '15 at 18:15
  • Again, is my understanding ok now? – user107986 Feb 05 '15 at 11:42
  • Yes. The NDTM keeps splitting and splitting, until eventually one version of it says "Here's the answer" and halts. The time taken is considered to be the time taken for that incarnation. The DTM that is simulating the NDTM knows p(S), and aborts each simulation (and backtracks) when it has reached that many steps without halting. – ganbustein Feb 06 '15 at 07:13