Construct pushdown automata (deterministic or nondeterministic) that accept the following languages. Provide a brief English description of how your PDA works, as well as a state diagram for the PDA.
[Reminder: The model that we used for a PDA is significantly different from the one in the book. Please review the lecture slides and your notes from class.]
aL1={w∈{0,1,2}*|no(w) represents the number of zeroes in w, n1(w) represents the number of ones and n2(w) represents the number of twos. (Hint: You should be able to do this with just two states.)}
(b) L2={0^m1^n2^m| m,n∈Z+, m≠n}
(For example, the strings 0011222, 0000012222 and 02 are in L2. The strings 012, 0001112, 122 are not.)