![]() |
VOOZH | about |
Prerequisite β Designing finite automata
Reversal: We define the reversed language to be the language , where
Steps to Reversal:
Note :
Reversing deterministic finite automaton results in a non-deterministic finite automaton. This can then be converted to a deterministic finite automaton by the conversion algorithm.
The reversal process goes like this:
π ImageLetβs understand the Reversal process in Deterministic Finite Automata (DFA) with the help of the example below.
Example 1:
We propose a deterministic finite automaton for the language of words consisting of exactly one 'a' followed by zero or more 'b's':
We can construct the following state transition diagram:
We now want to construct the finite automaton that will accept the reverse of this language, .
First, we add a new single accepting state. This is because eventually we will need to swap the accepting and initial states, and there can only be a single initial state.
π ImageThen, switch the initial and accepting states:
π ImageInvert the transition function into a transition relation:
π ImageWhilst this is a valid solution, the node marked as C is dangling since it has no incident edges. Therefore it can be removed to give a clean, final result:
π ImageThis resulting finite automaton is a non-deterministic finite automaton. Therefore the resulting reversed language is regular.
Explanation:
Example-2:
Designing a DFA for the set of strings over {a, b} such that string of the language contains an even number of 'a'. The desired language will be formed:
L1 = {, aa, aab, aba, aab, aababa, .......}
In L1, each string has an even number of elements a.
State Transition Diagram for the language L1:
This DFA accepts all the strings containing an even number of elements a. Here, State A is the initial state, and state A is the final state. Now, Reversing the L1 language which gives the final result of the language L2.
State Transition Diagram of L2 (reverse of L1):
Thus as we see that L2 has been obtained through the reversal process and this final DFA accepts all the strings containing an even number of element a which is the same as the original language.
L2 = {, aa, aab, aba, aab, aababa, .......}
Explanation: