The Alphabet: a, b, c
I’m trying to define a PDA which accepts
a^n b^m c^p : n + p = 2k for some integer k, m = k, and n, m, p, k >= 0
I think some strings that would be accepted are: #abc#; #aabbcc#; #aaabbbccc#; #abbccc#; #aaabbc# etc
The number of a’s, b’s and c’s are not necessarily equal.
Start the head of the push down automata on the black space that is right most.
Usually I write my PDAs in columns:
State: Symbol Read: Next State: Head Instruction:
s # r1 Left
r1 c r2 #
and so on…
I think the language you describe is not context-free, and therefore cannot be
recognized with a PDA. The problem is that you need to enforce a constraint
(n+p = 2m) that spans an arbitrarily long substring, yet is not allowed to “pump” (when
attempting to construct a proof using the pumping lemma for context-free languages).