100% found this document useful (1 vote)
895 views25 pages

Minimization of DFA

The document discusses the process of minimizing a deterministic finite automaton (DFA). It involves 7 steps: 1) remove unreachable states, 2) create a transition table, 3) split the table into final and non-final states, 4) find similar rows and remove redundant states, 5) repeat step 4 until no similar rows remain, 6) repeat for the other table, 7) combine the minimized tables. An example application of the process is also provided.

Uploaded by

Nabonita Halder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
895 views25 pages

Minimization of DFA

The document discusses the process of minimizing a deterministic finite automaton (DFA). It involves 7 steps: 1) remove unreachable states, 2) create a transition table, 3) split the table into final and non-final states, 4) find similar rows and remove redundant states, 5) repeat step 4 until no similar rows remain, 6) repeat for the other table, 7) combine the minimized tables. An example application of the process is also provided.

Uploaded by

Nabonita Halder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Minimization of DFA

Minimization of DFA means reducing the number of states from given FA. Thus, we get
the FSM(finite state machine) with redundant states after minimizing the FSM.
We have to follow the various steps to minimize the DFA. These are as follows:

• Step 1: Remove all the states that are unreachable from the initial state via any set
of the transition of DFA.
• Step 2: Draw the transition table for all pair of states.
• Step 3: Now split the transition table into two tables T1 and T2. T1 contains all final
states, and T2 contains non-final states.
• Step 4: Find similar rows from T1 such that:
• 1. δ (q, a) = p  
• 2. δ (r, a) = p  
• That means, find the two states which have the same value of a and b and remove
one of them.
• Step 5: Repeat step 3 until we find no similar rows available in the transition table
T1.
• Step 6: Repeat step 3 and step 4 for table T2 also.
• Step 7: Now combine the reduced T1 and T2 tables. The combined transition table is
the transition table of minimized DFA.
example
Solution:
• Step 1: In the given DFA, q2 and q4 are the
unreachable states so remove them.
• Step 2: Draw the transition table for the rest of
the states.

State 0 1

→q0 q1 q3

q1 q0 q3

*q3 q5 q5

*q5 q5 q5
• Step 3: Now divide rows of transition table
into two sets as:
• 1. One set contains those rows, which start
from non-final states:
State 0 1

q0 q1 q3

q1 q0 q3
• 2. Another set contains those rows, which
starts from final states.

State 0 1
q3 q5 q5
q5 q5 q5
• Step 4: Set 1 has no similar rows so set 1 will
be the same.
Step 5: In set 2, row 1 and row 2 are similar
since q3 and q5 transit to the same state on 0
and 1. So skip q5 and then replace q5 by q3 in
the rest.

State 0 1

q3 q3 q3
• Step 6: Now combine set 1 and set 2 as:
State 0 1

→q0 q1 q3

q1 q0 q3

*q3 q3 q3
• Now it is the transition table of minimized
DFA.
Regular Expression

• The language accepted by finite automata can be easily


described by simple expressions called Regular Expressions.
It is the most effective way to represent any language.
• The languages accepted by some regular expression are
referred to as Regular languages.
• A regular expression can also be described as a sequence of
pattern that defines a string.
• Regular expressions are used to match character
combinations in strings. String searching algorithm used
this pattern to find the operations on a string.
• For instance:
• In a regular expression, x* means zero or more
occurrence of x. It can generate {e, x, xx, xxx,
xxxx, .....}
• In a regular expression, x+ means one or more
occurrence of x. It can generate {x, xx, xxx,
xxxx, .....}
Operations on Regular Language
•The various operations on regular language are:

Union: If L and M are two regular languages then their union L U


M is also a union.

L U M = {s | s is in L or s is in M}  

Intersection: If L and M are two regular languages then their


intersection is also an intersection.
 L ⋂ M = {st | s is in L and t is in M}  

Kleen closure: If L is a regular language then its Kleen closure


L1* will also be a regular language.
 L* = Zero or more occurrence of language L.  
Example 1:
• Write the regular expression for the language accepting
all combinations of a's, over the set ∑ = {a}
• Solution:
• All combinations of a's means a may be zero, single,
double and so on. If a is appearing zero times, that
means a null string. That is we expect the set of {ε, a, aa,
aaa, ....}. So we give a regular expression for this as:
R = a*  
That is Kleen closure of a.
• Example 2:
• Write the regular expression for the language accepting
all combinations of a's except the null string, over the set
∑ = {a}
• Solution:
• The regular expression has to be built for the language
• L = {a, aa, aaa, ....}  
• This set indicates that there is no null string. So we can
denote regular expression as:
• R = a+
• Example 3:
• Write the regular expression for the language accepting
all the string containing any number of a's and b's.
• The regular expression will be:
• r.e. = (a + b)*  
• This will give the set as L = {ε, a, aa, b, bb, ab, ba, aba,
bab, .....}, any combination of a and b.
• The (a + b)* shows any combination with a and b even a
null string.
• Example 1:
• Write the regular expression for the language
accepting all the string which are starting with 1
and ending with 0, over ∑ = {0, 1}.
• Solution:
• In a regular expression, the first symbol should be
1, and the last symbol should be 0. The r.e. is as
follows:
• R = 1 (0+1)* 0  
• Example 2:
• Write the regular expression for the language
starting and ending with a and having any
combination of b's in between.
• Solution:
• The regular expression will be:
• R = a b* b  
• Example 3:
• Write the regular expression for the language
starting with a but not having consecutive b's.
• Solution: The regular expression has to be built
for the language:
• L = {a, aba, aab, aba, aaa, abab, .....}  
• The regular expression for the above language is:
• R = {a + ab}*
• Example 4:
• Write the regular expression for the language accepting
all the string in which any number of a's is followed by
any number of b's is followed by any number of c's.
• Solution: As we know, any number of a's means a* any
number of b's means b*, any number of c's means c*.
Since as given in problem statement, b's appear after
a's and c's appear after b's. So the regular expression
could be:
• R = a* b* c* 
Conversion of RE to FA

• To convert the RE to FA, we are going to use a


method called the subset method. This method is
used to obtain FA from the given regular
expression. This method is given below:
• Step 1: Design a transition diagram for given
regular expression, using NFA with ε moves.
• Step 2: Convert this NFA with ε to NFA without ε.
• Step 3: Convert the obtained NFA to equivalent
DFA.
• Design a FA from given regular expression 10 +
(0 + 11)0* 1.
Solution: First we will construct the transition
diagram for a given regular expression.
• Step 1:
• Now we have got NFA without ε. Now we will
convert it into required DFA for that, we will
first write a transition table for this NFA.
State 0 1
→q0 q3 {q1, q2}
q1 qf ϕ
q2 ϕ q3
q3 q3 qf
*qf ϕ ϕ
The equivalent DFA will be:

State 0 1

→[q0] [q3] [q1, q2]

[q1] [qf] ϕ

[q2] ϕ [q3]

[q3] [q3] [qf]

[q1, q2] [qf] [qf]

*[qf] ϕ ϕ

You might also like