- 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
Design a DFA accepting stringw so that the second symbol is zero and fourth is 1
Problem
Construct DFA which accepts a string that contains second symbol is zero and fourth symbol is 1 over an alphabet ∑={0,1}.
Solution
Input − 00110
Output is accepted; because in the given string the second symbol is ‘0’ and the fourth symbol is ‘1’.
Input − 11001
Output − string is not accepted, because the second symbol is not ‘0’.
Design DFA step by step as given below −
Step 1 -
Valid inputs − 0001
Step 2 -
Valid input − 1001
Step 3 -
Valid inputs − 0011, 1011
Step 4 -
Valid inputs − 00010, 10010, 00110, 00011, 10011, 00111, …
Step 5 -
Invalid inputs − 0101, 0100, 0010, 1100, 0000, 1000, …
Step 6 -
Valid inputs − 01010, 01000, 11111, 0100000, …
Advertisements
To Continue Learning Please Login
Login with Google