Build a multi-stack Push Down Automata (PDA) (it means you can use more than one stack, for example 3 stacks) to accept the language {a"b"a"b" | n21} over the alphabet E={a,b}. Please explain your design shortly and draw the PDA.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Computer Theory PDA

Build a multi-stack Push Down Automata (PDA) (it means you can use more than one stack,
for example 3 stacks) to accept the language {a"b"a"b" | n21} over the alphabet E={a,b}.
Please explain your design shortly and draw the PDA.
Transcribed Image Text:Build a multi-stack Push Down Automata (PDA) (it means you can use more than one stack, for example 3 stacks) to accept the language {a"b"a"b" | n21} over the alphabet E={a,b}. Please explain your design shortly and draw the PDA.
Expert Solution
Step 1 Approach

We can clearly see that the language is not possible to be constructed by a Single stack but it can be constructed by using the two stacks.

{(€,ala), (6.xlx)} (W) Where (€, b/b) = input lymbol & Top of stock = b / No change. {(1, x/»), (0, 1/)} {(a, alan), (a, » (x

 

In the above PDA, the first n a's are being accepted in the first state i.e q0. And while accepting the a's we didn't push anything in Stack 2. The no. of a's read pushed to the Stack 1.

Now, in the state q1, we will read all the b's. For that reading each b, we will pop one a from Stack 1 and for that, we will push b in the Stack 2. So, after reading all b's Stack 1 will empty and Stack 2 will contain n b's.

In the state q2, we will read all the a's. For that reading each a, we will pop one b from Stack 2 and for that, we will push a in the Stack 1. So, after all a's Stack 2 will empty and Stack 1 will contains n a's.

In the state q3, we will read all the b's. For that reading each b, we will pop one a from Stack 1 and will not change Stack 2.

At last, when both Stack 1 and Stack 2 will be empty the string will reach into the accepting state.

steps

Step by step

Solved in 3 steps with 7 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education