You are on page 1of 8

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
Introduction to Regular Expressions(RE)

Def:-An expression which is constructed over the alphabet ∑ using the operator
*, . , ε is called Regular Expression(RE).
The RE describes the language accepted by finite state automata.
The basic operations performed on Regular Expressions are Union(3),
Concatenation(2) and Kleen Closure(1).
Union of two RE’s R1 and R2 is a Regular Expression R
Example : If R1=a and R2= b then Union of R1 and R2 is R=a+b
Concatenation of two RE’s R1 and R2 is a Regular Expression R
Example : If R1=a and R2= b then Concatenation of R1 and R2 is R=ab
Iteration(Kleen Closure) of Regular Expression R written as R* is also a regular
expression.
Sample Examples of RE and FA

Regular Expression FA

a
a*

a
q0

a*b
b
q0 q1

(ab)*
a
q0 q1
b
Construction of Regular Expressions

1)Construct the Regular Expression for the following


a) Starts with ab
b) Ends with ab
c) Contains the substring aba
2) Construct the Regular Expression over ∑={0,1} for the following
a) Start and end with 0
b) Starting and ending with same symbol
c) Starting and ending with different symbol
d) L={(01)n | 0<=n<=2}
3) Construct the RE that generates all the strings 0’s and 1’s where
a)The 3rd symbol from the left end is 1
b) The 4th symbol from right end is 0
Construction of Regular Expressions
4)Construct the Regular Expression over ∑={0,1} for the following
where the length of the input string is
a) Exactly 3
b) Atmost 3
c) Atleast 3
d)Divisible by 3
5) Construct the Regular Expression over ∑={0,1} for the following
a) The length is Even
b) Length is Odd
c) The string starts with 0 but length of the string is even.
d) String starts with 1 but length of the string is odd.
6) Construct the Regular Expression over ∑={0,1} for the following
a) L= {om1n | m+n is even}
b)L= {om1n | m+n is odd}
Stay Safe and Stay Safe
Health Tip and General Awareness

You might also like