Professional Documents
Culture Documents
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*)
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=1
Now draw the diagram for R3=(∈ 0 ∈ + ∈ 1 ∈)*
Stay Home and Stay Safe
Health Tip