Is there a difference in computational power between a deterministic stack and a nondeterministic stack?
Is there a difference in computational power between a deterministic stack and a nondeterministic stack?
Yes, there is a difference between the two. And she's brutal. Non-deterministic stack automata can solve many more context-free languages than deterministic ones.
I would like to point out that this goes against other automata, where the non-deterministic Turing Machine does not provide computational power beyond that which deterministic manages to provide, just as in the Nondeterministic Finite States Machine can be transformed into deterministic without loss of computing power.The set of languages recognized by deterministic stack automata is a proper subset of the set of languages recognized by non-deterministic stack automata.
For example, language composed by every parenthesis needs to be closed in order of opening is deterministic. For example, using only curved and square brackets, the grammar would be:
S --> '(' S ')'
S --> '[' S ']'
S --> '(' ')'
S --> '[' ']'
Now, for palindromes, this does not happen. Take a simple palindrome, consisting only of a
and b
:
S --> 'a' S 'a'
S --> 'b' S 'b'
S --> 'a' 'a'
S --> 'b' 'b'
S --> 'a'
S --> 'b'
How can the automaton distinguish whether it should consider a a
terminal as the beginning of a pair creation or the end? For example, the following words are ambiguous:
aabaa
aabababaa
It is impossible for a deterministic stack automaton to determine whether a
after b
must be to start a new pair or if it matches with a
previous.