- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Construct a PDA that accepts (a,b)* language but not contain bbbb?

Push down Automata (PDA) is complement of the PDA that contain Substring bbb

**Steps**

Make the PDA for accepting those strings that have conation bbb.

Complement it by making non-accepting as accepting and vice versa.

**Construct PDA**

You can construct the PDA as shown below for the **(a,b)* language**

The nature of transition format is Input, Top of stack, PUSH/POP

**Example**

a ,a , aa means on i/p a and top of stack is a then push a

At q0 i,e initial if a or b anything came move state to q1

Till q1 we get 1 b to make substring b_ _ so now on q1 if a comes, then it will disturb the pattern of bbb. So make a move to q0, as shown in PDA above.

But on getting b, b, bb that means i/p is b and Top of stack is b. Push bb and now the pattern is bb_ and move to state q2.

Now at q2, we get 2 bb to make substring bb_. So now, if at q2 a comes, then it will disturb the pattern of bbb. So make a move to q0, as shown in PDA above.

But on getting b, b, bb that means i/p is b and Top of stack is b. Push bb and now the pattern is bbb and move to state q4.

At state q4 now, we have completed the substring bbb. So now, a or b any symbol is accepted.

When the whole string is ended and state is q4, we move to state q5.

Now, if we want the language that accepts the string having bbb as a substring, then q5 is the final state.

- But our question is we don't want bbb. So all the other states are final states, that is q0,q1,q2,q4 all are final states.
So, the PDA is completed.

- Related Articles
- Construct a PDA for language L = {0n 1m2m3n | n>=1, m>=1}
- Construct Deterministic PDA for a^n b^n where n>=1
- Design a PDA which recognizes the language
- Construct a TM that accepts even-length palindromes over the alphabet {0,1}?
- Construct a ∈-NFA for the language L = (a* + b*)
- Construct DFA beginning with ‘a’ but does not have substring ‘aab’
- C Program to construct a DFA which accepts L = {aN | N ≥ 1}
- Construct ∈-NFA of Regular Language L = b + ba*
- Design a DFA that accepts at most 3 a"s
- Construct PDA for L = {0n1m2(n+m) | m,n >=1}
- Print a closest string that does not contain adjacent duplicates in C++
- Construct DFA with Σ= {0,1} accepts all strings with 0.
- MySQL query to get a field value that does not contain empty spaces?
- Create bash alias that accepts parameters
- Most of the fuels contain carbon as one of the constituents. Name a fuel which has very high calorific value but does not contain carbon.