**Prerequisite:** Designing finite automata

In this article, we will see some designing of Deterministic Finite Automata (DFA).

**Problem-1:** Construction of a minimal DFA accepting set of strings over {a, b} in which a^{n}b^{m}, where n and m is greater than or equal to 1.

**Explanation:** The desired language will be like:

L1 = {ab, aab, abb, aabb, aaabbb, aaabbbb, ...........}

**Note:** In the above string there should not be any ‘a’ after ‘b’.

Here as we can see that each string of the language containing a and b whose power is greater or equal to 1 but the below language is not accepted by this DFA because some of the string of the below language does not containing a and b whose power is greater or equal to 1.

L2 = {ε, a, b, ..............}

This language L2 is not accepted by this required DFA.

The state transition diagram of the desired language will be like below:

In the above DFA, the state ‘W’ is the initial state and which on getting ‘a’ as the input it transit to the normal state ‘X’ which on getting ‘a’ as the input it remains in the state of itself and on getting ‘b’ as the input it transit to the final state ‘Y’ which on getting ‘b’ as the input it remains in the state of itself and on getting as the input it transit to the dead state ‘Z’ and when initial state ‘W’ gets ‘b’ as the input then it transit to the dead state ‘Z’.

The state ‘Z’ is called dead state because it can not go to the final state on getting any input.

**Problem-2:** Construction of a minimal DFA accepting set of strings over {a, b} in which a^{n}b^{m}, where n and m is greater than or equal to 0.

**Explanation:** The desired language will be like:

L1 = {ε, a, b, ab, aab, abb, aabb, aaabbb, aaabbbb, ...........}

**Note:** In the above string there should not be any ‘a’ after ‘b’.

Here as we can see that each string of the language containing a and b whose power is greater or equal to 0 but the below language is not accepted by this DFA because some of the string of the below language does not contain a and b whose power is greater or equal to 0 or they might not follow the format of a and b i.e, there should not be any ‘a’ after ‘b’.

L2 = {ba, baa, bbaaa..............}

This language L2 is not accepted by this required DFA because it’s string contain ‘a’ after ‘b’.

The state transition diagram of the desired language will be like below:

In the above DFA, the state ‘X’ is the initial and final state which on getting ‘a’ as the input it remains in the state of itself and on getting ‘b’ as the input it transit to the final ‘Y’ which on getting ‘b’ as the input it remains in the state of itself and on getting ‘a’ as the input it transit to dead state ‘Z’.

The state ‘Z’ is called a dead state because it can not go to the final state on getting any input alphabet.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.

## Recommended Posts:

- Designing Deterministic Finite Automata (Set 9)
- Designing Deterministic Finite Automata (Set 3)
- Designing Deterministic Finite Automata (Set 8)
- Designing Non-Deterministic Finite Automata (Set 3)
- Designing Deterministic Finite Automata (Set 4)
- Designing Deterministic Finite Automata (Set 5)
- Designing Deterministic Finite Automata (Set 2)
- Designing Deterministic Finite Automata (Set 1)
- Designing Deterministic Finite Automata (Set 11)
- Designing Non-Deterministic Finite Automata (Set 5)
- Designing Non-Deterministic Finite Automata (Set 4)
- Designing Non-Deterministic Finite Automata (Set 1)
- Designing Deterministic Finite Automata (Set 7)
- Designing Deterministic Finite Automata (Set 10)
- Designing Finite Automata from Regular Expression (Set 2)
- Designing Finite Automata from Regular Expression (Set 3)
- Designing Finite Automata from Regular Expression (Set 8)
- Designing Finite Automata from Regular Expression (Set 7)
- Designing Finite Automata from Regular Expression (Set 5)
- Designing Finite Automata from Regular Expression (Set 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.