- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- 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, …

- Related Questions & Answers
- Construct DFA of a string in which the second symbol from RHS is ‘a’
- Design a DFA machine accepting odd numbers of 0’s or even numbers of 1’s
- What is the difference between DFA and NFA in compiler design?
- What is the Representation of DFA in compiler design?
- Design a DFA accepting a language L having number of zeros in multiples of 3
- What is minimizing of DFA in compiler design?
- Design DFA for language over {0,1} accepting strings with odd number of 1’s and even number of 0’s
- Design a DFA that accepts at most 3 a"s
- Design NPDA for accepting the language L = {am b(2m) | m>=1}
- What is the Symbol Table?
- Design a TM that increments a binary number by 1
- What is the difference between DFA and NFA?
- C Program to construct DFA accepting odd numbers of 0s and 1s
- Why is that Air Conditioners consume so much electricity?
- Design a DFA of a string with at least two 0’s and at least two 1’s

Advertisements