Minimization of Finite Automata

Minimization of Finite Automata

The term minimization refers to the construction of finite automata with a minimum number of states, which is equivalent to the given finite automata. The number of states used in finite automata directly depend upon the size of the automata that we have used. So, it is important to reduce the number of states. We minimize the finite automata by detecting those states of automata whose presence or absence does not affect the language accepted by the finite automata.

Some important concepts used in the minimization of finite automata

  • Unreachable state
  • Dead State

Unreachable state: Unreachable state is that state in which finite automata never reaches during the transition from one state to another state.

Minimization of Finite Automata

In the above DFA, we have unreachable state E, because on any input from the initial state, we are unable to reach to that state. This state is useless in finite automata. So, the best solution is to eliminate these types of states to minimize the finite automata.

Dead State: It is a non-accepting state, which goes itself for every possible input symbol.

Minimization of Finite Automata

In the above DFA, we have q5, and q6 are dead states because every possible input symbol goes to itself.

Minimization of Deterministic Finite Automata

The following steps are used to minimize a Deterministic Finite Automata.

Step1: First of all, we detect the unreachable state.

Step2:  After detecting the unreachable state, in the second step, we eliminate the unreachable state (if found).

Step3: Identify the equivalent states and merge them.

  1. In this, we divide all the states into two groups:
  2. Group A: This group contains all accepting states of automata.
  3. Group B: This group contains all non-accepting states of automata.

This step is repeated for every group. Find group the input lead to if there are differences the partition the group into sets containing states which go to the same groups under the inputs.

  • The resulting final partition contains equivalent states now merge them into a single state.

Step4: In this step, we detect dead states.

Step5: After detecting the dead states, the last step is to eliminate dead states.

Example:  

Minimize the following DFA.

Minimization of Finite Automata

Solution

Step1: Detect unreachable states.

  • Start form initial state. Add q0 to temporary state (T)

T = {q0}

  • Now, for all states in temporary state set T, find transition from each state on each input symbol in ?. If resulting state is not in T add that state in T.
? (q0, a) = q1
 ? ( q0, b) = q2
 Now, T = {q0, q1, q2}
 Again
 ? ( q1, a) = q3
 ? ( q1, b) = q4
 Now, T = {q0, q1, q2, q3, q4}
 Again
 ? ( q2, a) = q3
 ? ( q2, b) = q5
 Now, T = {q0, q1, q2, q3, q4, q5}
 Again
 ? ( q3, a) = q3
 ? ( q3, b) = q1
 Now, change in T because q1, q3 are already in set T.
  T = {q0, q1, q2, q3, q4, q5} 
 Again
 ? ( q4, a) = q4
 ? ( q4, b) = q5
 Now, change in T because q4, q5 are already in set T
  T = {q0, q1, q2, q3, q4, q5}
 Again
 ? ( q5, a) = q5
 ? ( q5, b) = q4
 T = {q0, q1, q2, q3, q4, q5} 
  • Repeat previous step until T does not change

Finally we get T as:

T = {q0, q1, q2, q3, q4, q5}
  • Now we will find unreachable states
U = Q – T
 Q = {q0, q1, q2, q3, q4, q5, q6}
 U = {q0, q1, q2, q3, q4, q5, q6} – {q0, q1, q2, q3, q4, q5}
 U = {q6}, is the unreachable state 

Step2:  In this step, we eliminate the unreachable state found in first step.

Step3: Identify the equivalent steps and merge them.

  • First of all, divide the states into two groups

Group A – q3, q4,q5 (contains accepting state)

Group B – q0, q1,q2 (contains non-accepting state)

Check Group A for input a

? (q3, a) = q3

? (q4, a) = q4

? (q5, a) = q5

In Similar way, check group A for input b

? (q3, b) = q1

? (q4, b) = q5

? (q5, b) = q4

q1 belongs to group B for input b, and q4 and q5 belong to group A for input b. So, we partition group A as:

Group A1 - q3

Group A2 – q4, q5

Group B – q0, q1, q2

Now, we check Group B – q0, q1, q2 for both input symbols

For input a, we have:

? (q0, a) = q1

? (q1, a) = q3

? (q2, a) = q3

For input b, we have

? (q0, b) = q2

? (q1, b) = q4

? (q2, b) = q5

q2 belongs to group B and q4, q4 belongs to group A2 for input b. So, we partition group B as:

Group B1 – q0

Group B2 – q1, q2

Check Group A2 for input a

 ? (q4, a) = q4
 ? (q5, a) = q5 

Check Group A2 for input b

 ? (q4, b) = q5
 ? (q5, b) = q4 

As both belong to the same group, the further division is not possible.

Now, we check Group B2 for input a and b

?(q1, a) = q3

?(q2, a) = q3

?(q1, b) = q4

?(q2, b) = q5

q4 and q5 belong to group A2 for input b. So no further partitioning is possible. Finally, the following groups are formed:

Group A1 – q3

Group A2 – q4, q5

Group B1 – q0

Group B2 – q1, q2

The resulting automata is given below:

Step4: In this step, we detected dead states. There are no dead states in the above DFA; hence it is minimized.


Related Topics

Recursive Language and Recursive Enumerable Language

Recursive Language and Recursive Enumerable Language Before discussing Recursive language and Recursive Enumerable language, let us see what Turing machine responds for some input string. If we have the Turing machine T...

4 minutes read.

Automata Chomsky Hierarchy

Chomsky Hierarchy Formal languages: A language with precise syntax and semantics are called formal languages. Noam Chomsky has defined the Chomsky hierarchy in 1956. He is an American scientist and philosopher, and...

3 minutes read.

Non-deterministic Turing Machine - Automata

A non-deterministic Turing machine (NTM) is a theoretical machine used in computability theory to study the extent to which a machine can "guess" at a solution and yet still be...

4 minutes read.

Closure Properties of Regular Languages -Automata

Closure Properties of Regular Languages We use the term “Closure” when we talk about sets of things. If we have two regular languages L1 and L2, and L is obtained by...

3 minutes read.

Ambiguity in Context Free Grammar - Automata

Ambiguity in Context Free Grammar? Context Free Grammar Context Free Grammar has one condition for production rules, which is, on the left-hand side of each rule, there must be only single variable,...

4 minutes read.

Conversion from Moore Machine to Mealy Machine

Conversion from Moore Machine to Mealy Machine Moore Machine The output of Moore machine depends only on the present state. In this, if machine has N number of states, then it will...

6 minutes read.

Undecidable Problem of Turing Machine

Automata Undecidable Problem of Turing Machine Undecidable problems areproblems which cannot be solved by any Turing machine. Example: Post Correspondence Problem is the type of undecidable Problem. Post Correspondence Problem Post Correspondence problem is...

7 minutes read.

Converting Finite Automata to Regular Expression using Arden’s Theorem

Converting Finite Automata to Regular Expression using Arden’s Theorem The Arden’s Theorem can be applied to find the regular expression recognized by the given transition diagram. This theorem can be applied...

4 minutes read.

What is Automata Theory?

What is Automata Theory? Automata theory is used to study the abstract machine and automata (the self-acting machine).  Abstract machine is a theoretical model of a computer used in Automata theory. Automata...

4 minutes read.

Derivation Tree of Context Free Grammar - Automata

Derivation Tree of Context Free Grammar Derivation tree gives a way to show how a string can be derived from context free grammar. It is also called as parse tree, production...

3 minutes read.

Minimization of Finite Automata with Output

Minimization of Finite Automata with Output The method to minimize the Moore and Mealy machine is very much similar to the method that we have used to minimize the DFA. Methods to...

3 minutes read.

Equivalence of Regular Grammar and Finite Automata

Equivalence of Regular Grammar and Finite Automata Regular Grammar / type -3 grammar A regular grammar or type-3 defines the language called regular language that is accepted by finite Automata.A Regular Grammar...

3 minutes read.

Finite Automata with Output

Finite Automata with Output The Finite State machine is similar to Finite Automata, except that it has the additional capacity of producing output. Finite State machine = Finite Automata + Output Capabilities Types...

3 minutes read.

Conversion from Mealy Machine to Moore Machine

Conversion from Mealy Machine to Moore Machine In this topic, we will see different ways that are used for the conversion of Mealy Machine to Moore Machine. Moore Machine The output of Moore...

4 minutes read.

Pumping Lemma for Regular Languages - Automata

Pumping Lemma for Regular Languages The language accepted by the finite automata is called Regular Language. If we are given a language L and asked whether it is regular or not?...

4 minutes read.

Push down Automata Acceptance

Acceptance of Language by Push down Automata Push down Automata accepts the language, which is called context free language. Push down Automata = Finite Automata + Auxiliary Memory (Stack) Auxiliary Memory helps Push...

3 minutes read.

Automata Tutorial

What is Automata? Automata is a mathematical model and abstract model, which is used to detect string in various languages. In Automata, Regular language is recognized by Finite state AutomataContext Free language...

4 minutes read.

Conversion of DFA to Regular expression

Conversion of DFA to Regular expression To convert the DFA to Regular Expression (RE), we are going to use a method called converting DFA to regular expression by eliminating states. This...

3 minutes read.

Context Free Grammar - Automata

Context Free Grammar Grammar defines a set of rules, and with the help of these rules valid sentences in a language are constructed. A grammar consists of collection of substitution rules,...

3 minutes read.

Chomsky's Normal Form - Automata

Chomsky's Normal Form (CNF) In context free grammar, the left-hand side of production rules contains only one variable, and right side may contain any number of variables or terminals in production...

4 minutes read.