Non Deterministic PDA accepted language not clear

This is a PDA from the lecture slides I'm using:

They say it accepts all words that contain double a's. While it makes some sense it's not full proof.

What prevents the second a to be read in the left branch not the right? Or even a 3rd..4th a and so on? Is that the case of human Intervention like needed in PDA for oddpalindrome?

Also as far as I understand a PDA needs to read the whole input tape AND have an empty stack by the end which doesnt seem to be the case if the input is more than an a. What am I not understanding?

• You should include the picture here. – Yuval Filmus Jul 27 '14 at 2:53
• @YuvalFilmus You can edit, you know. – Raphael Jul 27 '14 at 7:24
• This image does not seem to show a PDA as it's usually represented. You can check your understanding by translating it into the more common state machine form! Then, what do you mean by "human interference"? I think you have to check the definition of PDAs and their accepted language again. Regarding acceptance criterion, there are several, equivalent ones. – Raphael Jul 27 '14 at 7:26
• Also, I don't understand your language "definition". " all words that contain double a's" sounds very regular to me, namely $\Sigma^* aa \Sigma^*$. – Raphael Jul 27 '14 at 7:28
• @Raphael Yes, the stated language is regular but every regular language is accepted by some PDA so that needn't be a problem. – David Richerby Jul 27 '14 at 8:27

1 Answer

The PDA you're linking to is non-deterministic; indeed, the state you are confused about has two out-edges labeled $a$. For the PDA to accept its string, it's enough for there to be one accepting computation – what you refer to inaccurately as "human interference" [intervention?]. Regarding the acceptance condition of the PDA, figure out what acceptance condition makes this PDA accept the advertised language, and this is the accepting condition that you should have in mind.

• Yes I meant intervention. By one accepting computation im assuming you mean the program already ran in one "a" loop right before the current run? Also do you check for the accepting computation using the stack? – user3241846 Jul 27 '14 at 14:06
• I suggest you review the definition of nondeterministic PDAs. This will answer all your questions. – Yuval Filmus Jul 28 '14 at 13:10
• In the very paper in which Turing introduced the Turing machine, he also introduced nondeterminism. He motivated it by the act of guiding a machine by human intervention. I guess that user3241846's source still motivates it like that as well even though it seems a little outdated. – Oliver Witt Aug 27 '14 at 7:48