1

A nondeterministic automaton, after reading an input symbol at some state, may jump into any of a (finite?) number of states.

Does the automaton uniformly randomly choose one out of the several states?

So different runs on the same input will give different sequence of states?

Does the automaton have to run in all the possible sequences of states on a given input? Or just one random run?

Gilles 'SO- stop being evil'
  • 44,159
  • 8
  • 120
  • 184
Tim
  • 5,035
  • 5
  • 37
  • 71

4 Answers4

10

A non-deterministic automaton runs in all possible sequence of states on a given input. It is not a random run.

An input symbol is accepted only if in at least one of the runs it has reached an accepting state after reading the given input.

Hope this helps :D

da4kc0m3dy
  • 121
  • 6
7

Non-deterministic machines are not realistic devices. They are conceptual devices useful for developing some theories. There are several possible ways of conceiving of the operation of a non-deterministic automaton:

  1. Whenever the non-deterministic automaton has to make a choice, it "forks" or "splits" to several different automata running in parallel, each making a different choice. The automaton accepts if at least one of its "copies" accepts.

  2. Whenever the non-deterministic automaton has to make a choice, it asks a "deity" for a "hint" (sometimes known as a "witness"), and follows the hint. The automaton accepts if some sequence of hints given it by the deity will make it accept.

  3. The non-deterministic automaton considers all possible execution paths sequentially (one by one). If any of them accepts, it accepts the input.

All these different views are valid. Choose whichever you like the most.

Regarding the second viewpoint, more can be said. You can think of it as a one-player game. The deity is trying to "convince" the automaton to accept the input. It's up to the deity to come up with a convincing sequence of hints. If the input does not belong to the language, then nothing the deity does will convince the automaton. If the input does belong to the language, then the deity can convince the automaton somehow.

A good example is the language of true propositions. Here a hint is a proof. Every true proposition has a proof, and no false proposition has one.

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
6

The computation of a non-deterministic automaton can be modeled by a tree. The input is accepted if there is a root-to-leaf path that eats the input and terminates in an accepting state.

When the automaton branches, each branch carries the computation on its own. So you can imagine that all possible root-to-leaf paths are being considered at the same time, meaning that the overall running time is bound by the height of the tree.

This process can be simulated on a real machine by trying out every possible path. The simulation takes more time naturally. Each branch contributes a factor of $2$, so the simulation takes $2^n$ or something similar.

mrk
  • 3,748
  • 23
  • 35
4

Strictly speaking I do not answer your question, but I will hint at a broader automaton model. (It is meant as a PS to the answer by Yuval.) I will not anwer questions here: it might get off-topic.

The nondeterministic automaton is "existential": it accepts a string iff a run on that string exists. How you want to visualize that is your own choice, and Yuval has sketched three possibilities: try all possibilities in parallel, one-by-one, or accept divine hints.

There is a larger type of automata, called alternating, that have existential and universal states. In an existential state one requires the existence of at least one succesful continuation, while in a universal state all continuations should end in a final state.

For finite state automata, the existential extension is equivalent in power as the original FSA, whether deterministic or nondeterministic). For Turing machines there is an additional layer of complexity classes for alternation: e.g., $P \subseteq NP \subseteq AP$. And there is an even much nicer connection to games and logic: alternation is like a two player game.

Hendrik Jan
  • 31,459
  • 1
  • 54
  • 109