Automata Theory Tutorial on Arden's Theorem

in order to find out a regular expression of a finite automaton, we use arden’s theorem along with the properties of regular expressions.

statement

let p and q be two regular expressions.

if p does not contain null string, then r = q + rp has a unique solution that is r = qp*

proof

r = q + (q + rp)p [after putting the value r = q + rp]

= q + qp + rpp

when we put the value of r recursively again and again, we get the following equation −

r = q + qp + qp2 + qp3…..

r = q (ε + p + p2 + p3 + …. )

r = qp* [as p* represents (ε + p + p2 + p3 + ….) ]

hence, proved.

assumptions for applying arden’s theorem

  • the transition diagram must not have null transitions
  • it must have only one initial state

method

step 1 − create equations as the following form for all the states of the dfa having n states with initial state q1.

q1 = q1r11 + q2r21 + … + qnrn1 + ε

q2 = q1r12 + q2r22 + … + qnrn2

…………………………

…………………………

…………………………

…………………………

qn = q1r1n + q2r2n + … + qnrnn

rij represents the set of labels of edges from qi to qj, if no such edge exists, then rij = ∅

step 2 − solve these equations to get the equation for the final state in terms of rij

problem

construct a regular expression corresponding to the automata given below −

finite automata

solution

here the initial state and final state is q1.

the equations for the three states q1, q2, and q3 are as follows −

q1 = q1a + q3a + ε (ε move is because q1 is the initial state0

q2 = q1b + q2b + q3b

q3 = q2a

now, we will solve these three equations −

q2 = q1b + q2b + q3b

= q1b + q2b + (q2a)b (substituting value of q3)

= q1b + q2(b + ab)

= q1b (b + ab)* (applying arden’s theorem)

q1 = q1a + q3a + ε

= q1a + q2aa + ε (substituting value of q3)

= q1a + q1b(b + ab*)aa + ε (substituting value of q2)

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

= ε (a+ b(b + ab)*aa)*

= (a + b(b + ab)*aa)*

hence, the regular expression is (a + b(b + ab)*aa)*.

problem

construct a regular expression corresponding to the automata given below −

finite automata1

solution

here the initial state is q1 and the final state is q2

now we write down the equations −

q1 = q10 + ε

q2 = q11 + q20

q3 = q21 + q30 + q31

now, we will solve these three equations −

q1 = ε0* [as, εr = r]

so, q1 = 0*

q2 = 0*1 + q20

so, q2 = 0*1(0)* [by arden’s theorem]

hence, the regular expression is 0*10*.