Unit 2 - (Regular Language
Unit 2 - (Regular Language
Faculty
School of Engineering & Technology(SOET)
K. R. Mangalam University
Unit 2
Regular Expression
Objective
Regular Language
Session Outlook
. Definition : A regular set over is any set that can be obtained by the finite
3. { } is a regular set
{0} , {1}
{0}{1},
{0}.{1}{0,1},
{0}*,
{}*
Definition : A regular expression over is a sequence of symbols obtained by the
2. The symbols and are regular expressions, representing the sets {} and {}
respectively.
regular expressions.
.
.
(a+b)*bbb(a+b)*
(ii) The set of all strings over {a, b} in which there are at least two occurrences of b
b* + (b + abb)*ab*
a*b(a*ba*b)*a*
(v) Set of all strings over {0, 1} having atmost one pair of 0’s or atmost
Regular Expression vs Regular Language
i.e., if L(r ) = L( r ).
1 2
Properties of Regular Expression
•It is a way of representing regular languages.
•They can define the same language that various forms of finite
automata can describe.
Answer (B)
The strings accepted by language are {a, b, aaa, bbb, aba, bab, ..}. All of these strings are
odd length palindromes.
2. Which one of the following languages over the alphabet {0,1} is described by the
regular expression: (0+1)*0(0+1)*0(0+1)*?
Answer (C)
The regular expression has two 0’s surrounded by (0+1)* which
means accepted strings must have at least 2 0’s.
Youtube Channels
• Theory of Computation THE GATEHUB
https://www.youtube.com/watch?v=p1oqDS0fayc&list=PL1QH9gyQXfgsUBfYUR0W
irJASgif4pHVX&index=1