# 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

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.