Unit-2 TOC
Unit-2 TOC
Closure properties:
L +:
It is a Positive Closure that represents a set of all strings except Null or ε-strings.
It represents the occurrence of certain alphabets for given language alphabets from one to infinite
number of times.
L *:
It is “Kleene Closure “that represents the occurrence of certain alphabets for given language
alphabets from zero to infinite number of times in which ε-string is also included.
L* = εL+
Regular Expression:
Regular expressions are used for representing certain sets of strings in an algebraic fashion.
Regular Language:
A language is regular if it can be expressed in terms of regular expression.
Union : If L1 and If L2 are two regular languages, their union L1 ∪ L2 will also be regular.
Intersection: If L1 and If L2 are two regular languages, their intersection L1 ∩ L2 will also be
regular.
For example,
L1= {𝑎 𝑏 , n ≥ 0 and m ≥ 0} and L2= {𝑎 𝑏 ∪ 𝑏 𝑎 ,n ≥ 0 and m ≥ 0}
L3 = L1 ∩ L2 = {𝑎 𝑏 , n ≥ 0 and m ≥ 0} is also regular.
Concatenation: If L1 and If L2 are two regular languages, their concatenation L1.L2 will also be
regular.
For example,
L1 = {𝑎 , n ≥ 0} and L2 = {𝑏 ,n ≥ 0}
L3 = L1.L2 = {𝑎 𝑏 , m ≥ 0 and n ≥ 0} is also regular.
Kleene Closure: If L1 is a regular language, its Kleene closure L1* will also be regular.
For example,
L1 = (a ∪ b)
L1* = (a ∪ b)*
Complement: If L(G) is regular language, its complement L’(G) will also be regular. Complement of
a language can be found by subtracting strings which are in L(G) from all possible strings.
For example,
L(G) = {𝑎 | n > 3}
L’(G) = {𝑎 | n <= 3}
Exercise :
Write a regular expression and give the corresponding automata for each of the following sets of
binary strings. Use only the basic operations.
1. 0 or 11 or 101
0 | 11 | 101
2. 0 or 1
0|1
3. only 0s
0*
4. only 1s
1*
8. ends with 00
(0|1)*00
9. starts with 10
10(0|1)*
Write a regular expression and give the corresponding automata for each of the following from
alphabet ∑(a,b).