Unit 2 TOC 3
Unit 2 TOC 3
• R + R = R (Idempotent law)
• ε + RR* = ε + R*R = R*
Arden’s Theorem
•
C = Ba C = Aa(b + ab)*a C = (a + a(b + ab)*b)* a (b + ab)* a
• Problem : Derive a regular expression to represent a language having even
no. of a’s
• For this case, it’s difficult to arrive at a regular expression with just trial
and error methodology.
We might come across sample solutions like :-
• ( aa + b )*
• ( b*ab* )*
• (b*ab*ab*)*
• which might satisfy some cases, but also leads to unwanted cases and
missing cases with alternate a’s and b’s.
The best way to solve this problem is to first draw a finite state machine
for the same, and then derive the regular expression from the same.
The DFA for the provided problem
• Now that we have the DFA, let’s solve it using Arden’s Theorem of
Individual State Equations.
• We see that on state A, there is a self loop with input b and transition
from B with input a
•
A = ε + Ab + Ba We see that on state B, there is a self loop on input b and
transition from A when input is a.
• B = Aa + Bb
• Taking equation for B, we can apply Arden’s
theorem
• B = Aa + Bb B = Aab* Substituting the value of B in
A we get
• A = ε + Ab + Ba
• A = ε + Ab + (Aab*)a
• A = ε ( b + ab*a )*
• A = ( b + ab*a )* Hence, the regular expression for
the provided problem is RE : ( b + ab*a )*
Try this
Two-Way Finite Automata