# NPDA for accepting the language L = {ambncn | m,n ≥ 1}

Prerequisite â€“ Pushdown automata, Pushdown Automata Acceptance by Final State

Problem: Design a non deterministic PDA for accepting the language , i.e.,

L = {abc, aabc, aabbcc, abbbccc, aabbbccc ...... }

The following DFA must contain:

1. The number of aâ€™s is equal to number of câ€™s.
2. The number of bâ€™s is independent of the number of aâ€™s and câ€™s.
3. Order of a, b and c must be maintained.

Explanation: The order of aâ€™s, bâ€™s and câ€™s is maintained as follows that is, all the aâ€™s  are coming first and then all the bâ€™s and then câ€™s are coming. Since the number of bâ€™s is exactly equal to the number of câ€™s.So, the count of bâ€™s and câ€™s will maintained by the stack. Stack used will have a start symbol and extra symbol for count of b’s and c’s.

 = { a, z }

Where, = set of all the stack alphabet. z = stack start symbol.

Approach used in the construction of PDA â€“

• Step-1: Whenever â€˜aâ€™ comes then push it in stack and if again â€˜aâ€™ comes then also push it.
• Step-2: When â€˜câ€™ comes then pop one â€˜aâ€™ from the stack each time.
• Step-3: When â€˜bâ€™ comes then ignore it and change the state in state diagram.
• Step-4: Stop the execution if at the end, the stack becomes empty.Thus the string is accepted by the PDA.

Note that there always maintains the order of a, b and c.

Stack transition functions:

(q0, a, z)  (q0, z)(q0, b, z)  (q1, bz)(q1, b, b)  (q1, bb)(q1, c, b)  (q2, )(q2, c, b)  (q2, )(q2, , z)  (qf, z)

State transition diagram:

Here, q0 = Initial state qf = Final state = indicates pop operation And, q1,q2= Intermediate State