In: Computer Science
Define a PDA that accepts language L3 = { anbm | n > 0 and n > m }.
Implement that PDA in JFLAP. Must use JFLAP
The strings accepted by the given language are as follows:-
L3 = {a, aa, aaa, ......, aab, aaab, aaaab, ......, aaabb, aaaabb, aaaaabb,......}
The PDA for the given language L3={anbm | n>0 and n>m} is as follows:-
First we push all the a's into the stack, then for every 'b' pop the 'a' from the stack, when all the 'b' gets readed then on reading if the top of the stack is a then go to the state q2 by accepting the string, otherwise not. also afte reading all the a's if their is no 'b' present then also go to the state q2 by accepting the string.
Let us take an input string "aaaabb" to check whether the above PDA works or not.
Present state | Input | Stack top symbol | Operation | Next state |
q0 | a | z | push | q0 |
q0 | a | a | push | q0 |
q0 | a | a | push | q0 |
q0 | a | a | push | q0 |
q0 | b | a | pop | q1 |
q1 | b | a | pop | q1 |
q1 | a | read | q2 |
Since all the b's get exhausted and the stack still have a's therefore, reach to final state q2 by accepting the string.
--------------------------------------------------
Please give me a UPVOTE. Thank you :)