You are on page 1of 19

1

Unit-2 Contents
UNIT-2 Fundamentals of Regular Languages
Introduction to Regular Expressions (RE)
Finite Automata and Regular Expressions
Regular Expressions Applications
Laws of Algebraic for Regular Expressions
The Arden‘s Theorem
Using Arden‘s theorem to construct RE from FA
Pumping Lemma for RLs
Pumping Lemma Applications
Uniformity of Two FAs
Uniformity of Two REs
Construction of Regular Grammar from RE
Constructing FA from Regular Grammar
Closure properties of RLs, Applications of REs and FAs

2
Equivalence of Two Different Regular Expressions

Two regular expressions are equivalent if languages generated by them are same.
For example, (a+b*)* and (a+b)* generate same language. Every string which is
generated by (a+b*)* is also generated by (a+b)* and vice versa.
Prerequisite required are Identity Rules
Example:- Prove (1+00*1)+(1+00*1)(0+10*1)*(0+10*1)= 0*1(0+10*1)*
Solution:
Given Expression (1+00*1)+(1+00*1)(0+10*1)*(0+10*1)
=(1+00*1)+(1+00*1)(0+10*1)*(0+10*1)
(Take (1+00*1) as common)
= (1+00*1)(∈+(0+10*1)*(0+10*1))
=(1+00*1)(∈+(0+10*1)*(0+10*1))

( ∈+ R* R)( The above Expression is in the form of


∈+R*R=∈+RR*=R* Identity Rule)
Here R*= 0+10*1)* and R= 0+10*1
=(1+00*1) (0+10*1)*

Now Take ‘1’ as common from the above


=(∈+00*)1(0+10*1)* (The selected expression is in the form of
∈+RR*=R* Identity Rule))
=(0*)1(0+10*1)* Hence proved
Example3:- Prove that ∈+a*(b)*(a*(b)*)*=(a+b)*
Solution:-
=∈+a*(b)*(a*(b)*)*

( ∈+ R R*)
Now the expression becomes
=(a*(b)*)* ( From the identity rule (P+Q)*=(P*Q*)*=(P*+Q*)*
Here P=a and Q=b it can be expressed as (P+Q)*
=(a+b)*
Example3:- Prove that ∈+a*(b)*(a*(b)*)*=(a+b)*
Solution:-
=∈+a*(b)*(a*(b)*)*

( ∈+ R R*)
Now the expression becomes
=(a*(b)*)* ( From the identity rule (P+Q)*=(P*Q*)*=(P*+Q*)*
Here P=a and Q=b it can be expressed as (P+Q)*
=(a+b)*
Relationship Between FA and RE

RE=a*
RE=∈ a* ∈
∈ a
q1 q2 q3


Problems on Construction of FA for a
RE
Example1:- Construct the ∈- NFA for the RE= b+ba*
Solution:-
RE= b+ba*
RE=R1+R2 where R1=b and R2=ba*
The FA diagram for R1 is
For R1 the NFA is b
For R2=ba*
R2=R3R4
R3=b and R4=a*
For R3

For R4= ∈ a* ∈
R2=R3.R4
=ba*

For R2 the ∈ -NFA


RE=R1+R2
=b+ba*
Example2:- Construct the ∈ -NFA for (0+1)*
Solution:-
Given RE=(0+1)*
R3=(R1+R2)*
R1=0
R2=1
RE=R3*
For R1=0

For R2=1
Now draw the diagram for R3=(∈ 0 ∈ + ∈ 1 ∈)*
Stay Home and Stay Safe
Health Tip

You might also like