DFA machines are designed to accept the specific kind of input whose output is generated by the transition of input alphabet from each state.
Approach :
- In this situation, strings all strings are acceptable except more than 3 zeros. In this kind of string no three continuous zeros are acceptable.
- Create initial state and start with minimum length of possible string do transition of its input 0 and 1 to possible states.
- according to transition ,notice the final state and mark it.
Designing DFA step by step :
Step-1:
Make a initial state,say “A”, minimum possible strings are 1 and 0 and also any number of 1 are acceptable.To do this put self loop of 1 on state “A” and make transition of input alphabet 0 to state “B”.Because only 1’s are acceptable so state “A” is termed as final state as well.

Step-2:
As single zero is acceptable in the string so make state “B” is final state.Transect input 0 from state “B” to state “C”.

Step-3:
As every 00 is immediately followed by 1 so now after state “C” do transition of input 1 from state “C” to state “A”.

Step-4:
We are left with transition of input alphabet 1 of state “B”.So make transition of 1 from state “B” to state “A”.

Step-5:
After 00 not more zero is acceptable in continuity.So transect 0 of state “C” to dead state “D”.

Step-6:
Input alphabet 0 and 1 of dead state transect to dead state itself.

Transition Table and Transition rules of above DFA –
State “A” is both final as well as the initial state, state “C” is final state, state “D” is Dead State. Initial state is depicted by —> and final state ids depicted by *.
| State | Input (0) | Iinput (1) |
|---|---|---|
| —>A* (initial and final state both) | B | A |
| B* (final state) | C | A |
| C | D (dead state) | A |
| D (dead state) | D (dead state) | D (dead state) |
Q’: set of finite sets = {A, B, C, D}
set of input alphabets = {0, 1}

Transition Rules tells about the transition function working on each state with each input alphabet.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
Recommended Posts:
- Design a DFA that accepts a string containing 3 a's and 3 b's
- Conversion from NFA to DFA
- Minimization of DFA
- DFA for accepting the language L = { anbm | n+m=even }
- Program to Implement NFA with epsilon move to DFA Conversion
- DFA in LEX code which accepts even number of zeros and even number of ones
- DFA for Strings not ending with "THE"
- DFA of a string with at least two 0’s and at least two 1’s
- Union process in DFA
- DFA machines accepting odd number of 0’s or/and even number of 1’s
- Concatenation process in DFA
- Complementation process in DFA
- DFA of a string in which 2nd symbol from RHS is 'a'
- Reversal process in DFA
- DFA for accepting the language L = {an bm | n+m=odd}
- Cross Product Operation in DFA
- DFA of a string in which 3rd symbol from RHS is ‘a’
- Program to construct a DFA which accept the language L = {anbm | n mod 2=0, m≥1}
- DFA for strings not containing consecutive two a's and starting with 'a'
- Construct DFA which interpreted as binary number is divisible by 2, 3, 4
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

