views:

118

answers:

6

Hello guys, these days I have been studying about NP problems, computational complexity and theory. I believe I have finally grasped the concepts of Turing Machine, but I have a couple of doubts.

I can accept that a non-deterministic turing machine has several options of what to do for a given state and symbol being read and that it will always pick the best option, as stated by wikipedia

How does the NTM "know" which of these actions it should take? There are two ways of looking at it. One is to say that the machine is the "luckiest possible guesser"; it always picks the transition which eventually leads to an accepting state, if there is such a transition. The other is to imagine that the machine "branches" into many copies, each of which follows one of the possible transitions. Whereas a DTM has a single "computation path" that it follows, an NTM has a "computation tree". If any branch of the tree halts with an "accept" condition, we say that the NTM accepts the input.

What I can not understand is, since this is an imaginary machine, what do we gain from saying that it can solve NP problems in polynomial time? I mean, I could also theorize of a magical machine that solves NP problems in O(1), what do I gain from that if it may never exist?

Thanks in advance.

+3  A: 

What you gain from that is that you can prove that a problem is in NP by proving that it can be solved by an NTM in polynomial time.

In other words you can use NTMs to find out whether a given problem is in NP or not.

sepp2k
Can you please elaborate on that? How can I prove something like that using an NTM?
Clash
@Clash: You construct an NTM which solves the problem. Then you prove that it is correct and that it runs in polynomial time.
sepp2k
Can you post an example, a link to study such thing? I'm completely lost on how to do that. I'm not used to think non-deterministically. Thanks!
Clash
@Clash: for example, you can find if a graph has a tricolouring by non-determistically guessing it. For |V| first rounds, you assign colours to vertices, and then check if your colouring is correct. See NP-complete problems for more examples.
sdcvvc
Thanks sdwc, will take a look!
Clash
A: 

From Hebrew Wikipedia - "NTM is mainly a tool for thinking, and it's impossible to actualy implement such machine". You can replace the term "NTM" with "Algorithm that at every step tries all possible steps" or "Algorithm that at every step chooses the best possible next step".. And I think you understand the rest. NTM is here only to help us visualize such algorithm. You can see here how it's supposed to help you visualize (at Pascal Cuoq's answer).

Oren A
"Algorithm that at every step can select from a number of possible steps". Anything can 'select' anything. NTM is just a lucky guesser that can pick the correct path at each step.
OTZ
@OTZ: You can also think about it as if it's trying all possibilities (click the link I gave). Both definition are equal. But you were right, the original wording wasn't good. Changed it.
Oren A
+1  A: 

By definition, NP stands for nondeterministic polynomial time as can be looked up in Wikipedia.

An incarnation of a nondeterministic Turing machine that randomly chooses and examines (or assembles) the next potential solution will solve an NP problem in polynomial time with some probability (it would solve the problem in poly time with absolute certainty if it were the "luckiest possible guesser").

Therefore, saying that an NTM can solve a problem in polynomial time effectively means that that problem is in NP. This again is equivalent to the definition of the NP class of problems.

Archimedix
Thanks for clarifying, but you still haven't answered my question... if such lucky guesses doesn't exist, why is this any useful... it's like saying, hey, if I could know the results of the lottery before it happens I'd be rich. NTM must be useful for something else. This is what I can't understand.
Clash
It is hoped that quantum computers are (with some limitations) able to simultaneously test all potential solution paths and therefore behave like the luckiest possible guesser NTM. Quantum computers compute with *qubits*, where any set of qubits represents a set of all possible combinations of the same number of conventional bits (superposition). (Peter) **Shor's algorithm** for factoring numbers / cracking RSA encryption exploits this.
Archimedix
The hard part with quantum computers though is protecing the superposition from decoherence (where the qubits turn to conventional bits by means of physical interaction with the world) and extracting the correct solution from it in the end by decoherence.
Archimedix
A: 

What we gain is that if we have the magical power to guess the correct step, which will always turn out to be correct, we can solve NPC problems in POLYTIME. Of course, we can't always "guess" the correct step. So it's imaginary. But just as imaginary numbers are applicable to real world problems, consequences can be theoretically useful.

One positive aspect of morphing the original problems this way is that we can tackle them from different angles. In a theoretical domain, it is a good thing because we have (1) more approaches we can take (thus more papers) and (2) more tools we can use if they can be phrased in other fields.

OTZ
np problems are verified in polytime, not solved.
DanJ
I use imaginary numbers all the time at electrical engineering, they have real use and advantages. On the other hand I can't see any advantage of saying that is something can be solved magically in polytime. The thing I'm looking is exactly these real world problems that can be helped by a NTM. Thanks@DanJ, he is talking about NTM, therefore it is solved in polytime.
Clash
@Clash We can't apply NTM to any real world problems as it is impossible to create one in the first place. For one advantage, read the second paragraph I've just added.
OTZ
@DanJ it's NPC. what's up with your attitude.
OTZ
@OTZ Imaginary numbers also do not exist, still we use them in many situations. I'm interested in those cases where an NTM is useful for anything. I think it's finally getting into my head that NTM is useful to prove that a certain problem is NP, whereas using a deterministic TM to prove such thing would be harder, what I need now is an example of how can I prove such thing with an NTM. Can you think of any or do you know any link to such thing? Thanks!
Clash
A: 

I think your answer is in your question. In other words, given a problem you can prove that it is an NP problem if you can find an NTM that solves it.

NP problems are a special class of problems, and the NTM is just a tool to check if the given problem belongs to the class or not.

Note that the NTM is not a specific machine - it is a whole class of machines with well defined rules of what they can and cannot do. In order to use "magical" machines, you need to define them, and show which complexity class of problems they correspond to.

See http://en.wikipedia.org/wiki/Computational_complexity_theory#Complexity_classes for more info.

DanJ
If NP can also be defined as the problems that can be VERIFIED in polytime with TM, why would I need a NTM, that doesn't even exist?Thanks
Clash
verifying a solution in polytime with a TM is equivalent to solving in polytime with an NTM. http://en.wikipedia.org/wiki/NP_(complexity)#Verifier-based_definition" (see Machine-definition)
DanJ
Sometimes it is just easier to come up with the NTM than the TM, but in order to prove a problem is NP both solutions are valid.
DanJ
+3  A: 
Jouni K. Seppänen
+1. I've never heard of that oracle theorem -- it sounds awesome.
Edmund