- 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 DFA beginning with ‘a’ but does not have substring ‘aab’
Problem
Given language to construct the deterministic finite automata (DFA) is, the strings start with ‘a’ but not contain substring ‘aab’ over alphabet ∑={a,b}.
Solution
If the input is: “baabba”
The output is: string is not accepted
Because the string does not start with ‘a’, and generating a substring ‘abb’,
DFA transition diagram
The DFA transition diagram for the string beginning with ‘a’ but not having the substring as ‘aab’ is as follows −
Transition table
The transition table is as follows −
STATE | INPUT (a) | INPUT (b) |
---|---|---|
→ 0 | 1* | 4 (dead state) |
1* | 2* | 3* |
2* | 2* | 4 (dead state) |
3* | 1* | 3* |
4 (dead state) | 4 (dead state) | 4 (dead State) |
Advertisements