Arden’s theorem examples and Conversion of finite automata to regular expression

25366

How to convert finite automata to regular expression by using Arden’s theorem:

The following method is the utilization of the Arden’s theorem. This is used to find the regular expression recognized by a transition system.

  1. To get the regular expression from the automata we first create the equations for each state in presenting in the finite automata transition diagram.
    Note: Consider the incoming edges only to a state in transaction diagram to construct the equation of each state.

The state equation in the form of

q1 = q1w11 + q2w21 + … + qnwn1 + є (q1 is the initial state)
q2 = q1w12 + q2w22 + … + qnwn2
 ⋮           ⋮
qn = q1w1n + q2w2n + … + qnwnn
Where, wij is the regular expression representing the set of labels of edges from qi to qj.
Note: For parallel edges there will be that many expressions for that state in the expression.

  1. Then we solve these equations to get the equation for qi in terms of wij and that expression is the required solution, where qi is a final state.
  2. Repeatedly applying substitutions method and Arden’s theorem over the state equations and we can express qi in terms of wij’s.
  3. For getting the set of string recognized by the transition system, we have to take the ‘union’ of all Vi’s corresponding to final states.

Assumptions are made regarding the transition system:

  • The transition graph does not have ε-moves.
  • It has only one initial state q0.
  • Its vertices are represented as q1, q1, .. .. .. .. ,qn.
  • Qi the regular expression represents the set of string accepted by the system even though qi is a final state.

Also check: nfa applications

1. Arden’s theorem examples

Arden’s Theorem Example Transaction Diagram - 1
Arden’s Theorem Example Transaction Diagram – 1

Figure (1): Transaction Diagram

Consider the Transaction diagram (1), covert it to an equivalent regular expression using Arden’s Theorem.

We can directly apply the Arden’s procedure directly since the graph does not contain any ε-moves and there is only one initial state.

The three equations for q1, q2 and q3 can be written as;

q1 = q1a + q2b + ε                     —– (1)
q2 = q1a + q2b + q3a                 —– (2)
q3 = q2a                                     —– (3)

It is necessary to reduce the number of unknowns by repeated substitution. By substituting q3 in the q2-equation, we get by applying Arden’s Theorem:

q2 = q1a + q2b + q2aa
= q1a + q2 (b + aa)
= q1a (b + aa)*

Substituting q2 in q1, we get

q1 = q1a + q1a(b + aa)*b + ε
= q1 (a + a(b + aa)*b) + ε

Hence,
q1  = ε (a + a(b + aa)*b)*
q2  = (a + a(b + aa)*b)* a(b + aa)*
q3  = (a + a(b + aa)*b)* a(b + aa)*a

Since q3 is a final state, the set of strings recognized by the transaction graph is given by

            (a + a(b + aa)*b)* a(b + aa)*a

2. Arden’s theorem examples

Arden’s Theorem Example Transaction Diagram - 2
Arden’s Theorem Example Transaction Diagram – 2

Figure (2): Transaction Diagram

Consider the Transaction diagram (2), covert it to an equivalent regular expression using Arden’s Theorem.

We can directly apply the Arden’s procedure directly since the graph does not contain any ε-moves and there is only one initial state.

The three equations for q1, q2 and q3 can be written as;

q1 = q10 + ε                  —– (1)
q2 = q11 + q21               —– (2)
q3 = q20 + q3 (0+1)       —– (3)
By applying Arden’s Theorem to equation (1), we get
q1 = q10 + ε      =          ε0*
So,
q2 = q11 + q21 = 0*1 + q21
Therefore,
q2 = (0*1)1*
As the final states are q1 and q2, we need not solve for state q3:
q1 + q2 = 0* + 0*(11*) = 0*(ε + 11*) = 0*(1*) = 0*1*

Also check: cfg examples with solutions

3. Arden’s theorem examples

Arden’s Theorem Example Transaction Diagram - 3
Arden’s Theorem Example Transaction Diagram – 3

Figure (3): Transaction Diagram

Consider the Transaction diagram (3), covert it to an equivalent regular expression using Arden’s Theorem.

We can directly apply the Arden’s procedure directly since the graph does not contain any ε-moves and there is only one initial state.

The three equations for q1, q2 and q3 can be written as;

q1 = q10 + q30 + ε                     —– (1)
q2 = q11 + q21 + q30                 —– (2)
q3 = q20                                                —– (3)
So,
q2 = q11 + q21 + (q20)1
= q11 + q2 (1 + 01)
By applying Arden’s Theorem, we get
q2 = q11(1 + 01)*
Also,
q1 = q10 + q30 + ε
=  q10 + q200 + ε
= q10 + (q1 1(1 + 01)*)00 + ε
= q1 (0 + 1(1 + 01)*00) + ε

Once again applying Arden’s Theorem, we get;

q1 = ε (0 + 1(1 + 01)* 00)*
= ε (0 + 1(1 + 01)* 00)*

∵q1 is the only final state, the regular expression corresponding to the given diagram is (0 + 1(1 + 01)* 00)*.

4. Arden’s theorem examples

Arden’s Theorem Example Transaction Diagram - 4
Arden’s Theorem Example Transaction Diagram – 4

Figure (4): Transaction Diagram

Consider the Transaction diagram (4), covert it to an equivalent regular expression using Arden’s Theorem.

We can directly apply the Arden’s procedure directly since the graph does not contain any ε-moves and there is only one initial state.

The four equations for q1, q2 q3 and q4 can be written as;

q1 = q10 + q30 + q40 + ε           —– (1)
q2 = q11 + q21 + q41                 —– (2)
q3 = q20                                     —– (3)
q4 = q31                                     —– (4)

Now,

q4 = q31 = (q20)1 = q201                 —– (4)
Thus, we able to write q3, q4 in terms of q2. Using the equation (2), we get

q2 = q11 + q21 + q2011
= q11 + q2 (1 + 011)

By applying the Arden’s Theorem, we get

q2 = (q11)(1 + 011)*
= q1 (1(1 + 011)*)

From the equation (1), we get;

q1 = q10 + q200 + q2010 + ε                  —– (1)
= q10 + q2(00 + 010) + ε
= q10 + q11(1 + 011)*(00+010) + ε

Again, by applying Arden’s Theorem, we get

q4 = q201

= q11(1 + 011)*01
= (0+ 1(1 + 011)*(00+010))*(1(1+011)*01)

Previous QuizArden’s Theorem State, Proof and application
Next QuizC program to print a statement without using semicolon ‘;’

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.