So I have been given the task of creating an PDA that recognises the language
$\{a^{2n} b^{3n} \mid n = 0,1,2,\dots\}$.
Am I right in thinking that it needs to have at least 3 times number of $b$'s than $a$'s?
So for example: $aabbb$ would be accepted $aaabb$ would NOT be accepted However, how do I show that using JFlap because I am unfamiliar with the software?
Asked By : Anish B
Answered By : Dave Clarke
The following pushdown automaton should do the trick. I publish this only because the existing answer can be improved upon. (Note, I am using $e$ to denote $\epsilon$- (or $\lambda$-) transitions.
The idea is that the left-hand part counts the number of $a$'s (modulo 2). Each time it has seen two $a$'s, it pushes $3$ $b$'s onto the stack. Nondeterministically, the machine can change to the right-hand state. It then matches a $b$ from the string fro each $b$ on the stack.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/10423
0 comments:
Post a Comment
Let us know your responses and feedback