A push down automata (PDA) can be formally described as seven tuples
(Q, Σ,S, δ,q0,I,F)
Construct PDA for 0n1m2m3n where n,m≥1.
So, the strings which are generated by the given language are −
The number of 1’s and 3’s are same and number of 2’s and 1’s are same
Construction of PDA for given problem
The PDA is as follows −
Step 1 − First 0’s are pushed onto the stack.
Step 2 − Next 1’s are pushed into the stack.
Step 3 − For every 2 as input a 1 is popped out of stack.
Step 4 − If some 2’s are still left and top of stack is a 0 then string is not accepted by the PDA.
Step 5 − If 2’s are finished and top of stack is a 0 then for every 3 as input equal number of 0’s are popped out of stack.
Step 6 − If the string is finished and the stack is empty then the string is accepted by the PDA. Otherwise, the string is not accepted.