# Designing Deterministic Finite Automata (Set 5)

Last Updated : 08 Jun, 2020

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 every ‘a’ is followed by a ‘bb’.
Explanation: The desired language will be like:

`L1 = {ε, abb, abbabb, bbbbabb, abbabbabbabbabbbb, ..............}`

Here as we can see that each string of the language containing ‘a’ is just followed by ‘bb’ but the below language is not accepted by this DFA because some of the string of the below language does not contain ‘a’ just followed by ‘bb’.

`L2 = {ba, baab, bbaba, ..............}`

The state transition diagram of the language containing ‘a’ just followed by ‘bb’ will be like:

In the above DFA, state ‘v’ is the initial and final state too which on getting ‘b’ as the input it remains in the state of itself and on getting ‘a’ as the input it transit to a normal state ‘W’ which on getting ‘a’ as the input it transit to the dead state ‘Z’ and getting ‘b’ as the input it transit to the normal state ‘X’ which on getting ‘b’ as input it transit to the final state ‘V’ and on getting ‘a’ as the input it transit to the same dead state ‘Z’. The state ‘Z’ is called dead state because on getting any input it can not transit to any of the final states ever.

Problem-2: Construction of a minimal DFA accepting set of strings over {a, b} in which every ‘a’ is never be followed by ‘bb’.
Explanation: The desired language will be like:

`L1 = {ε, a, aa, aabaa, b, bb, bbbbba, ..............}`

Here as we can see that each string of the language containing ‘a’ is never be followed by ‘bb’ but the below language is not accepted by this DFA because some of the string of the below language containing ‘a’ is followed by ‘bb’.

`L2 = {abb, babbabb, bbaba, ..............}`

The state transition diagram of the language containing ‘a’ never be followed by ‘bb’ will be like:

In the above DFA, the state ‘W’ is the initial and final state too which on getting ‘b’ as the input it remains in the state of itself and on getting ‘a’ as the input it transit to the final state ‘X’ which on getting ‘a’ as the input it remains in the state of ‘X’ and getting ‘b’ as the input it transit to the final state ‘Y’ which on getting ‘a’ as the input it transit to another final state ‘X’ and the final state ‘Y’ on getting ‘b’ as the input it transit to the dead state ‘Z’. The state ‘Z’ is called dead state because on getting any input it can not go to any of the final state ever.

Previous
Next