SlideShare a Scribd company logo
UNIT-2
REGULAR EXPRESSION
K LAKSHMI SRVANI
ASST PROFESSOR
SYLLABUS
Regular Expressions: Finite Automata and Regular Expressions,
Applications of Regular Expressions, Algebraic Laws for Regular
Expressions, Conversion of Finite Automata to Regular Expressions.
Pumping Lemma for Regular Languages, Statement of the pumping
lemma, Applications of the Pumping Lemma.
Closure Properties of Regular Languages: Closure properties of
Regular languages, Decision Properties of Regular Languages,
Equivalence and Minimization of Automata.
Regular Expressions.
● Regular expressions are used for representing certain
sets of strings in algebraic fashion.
● Any terminal symbol belongs to Σ including ɸ,ɛ are
RE
● The union of 2 RE is also RE
● The Concatenation of 2 RE is also RE
● The iteration or closure of RE is also RE
Regular Expressions Regular Set
(0 + 10*) L = { 0, 1, 10, 100, 1000, 10000, … }
(0*10*) L = {1, 01, 10, 010, 0010, …}
(0 + ε)(1 + ε) L = {ε, 0, 1, 01}
(a+b)* Set of strings of a’s and b’s of any length
including the null string. So L = { ε, a, b, aa
, ab , bb , ba, aaa…….}
(11)* Set consisting of even number of 1’s
including empty string, So L= {ε, 11, 1111,
111111, ……….}
(0+1)*011(0+1)* Sub string 011
Operators of RE
Operators used in regular expressions include:
• Union: If R1 and R2 are regular expressions, then R1 | R2 (also written as R1 U R2 or R1 +
R2) is also a regular expression.
L(R1|R2) = L(R1) U L(R2) or L(R1+R2)



• Concatenation: If R1 and R2 are regular expressions, then R1R2 (also written as R1.R2) is
also a regular expression.
L(R1R2) = L(R1) concatenated with L(R2).



• Kleene closure: If R1 is a regular expression, then R1* (the Kleene closure of R1) is also a
regular expression.
L(R1*) = epsilon U L(R1) U L(R1R1) U L(R1R1R1) U ...

Precedence
● Closure > Concatenation > Union
● (01*+1)
Applications of RE
● RE in unix
• [ :digit:][0-9]
• [:alpha:]a-z A-Z
• [:Alnum:] [A-Z a-z 0-9]
● Lexical Analysis
● Finding Patterns in Text
● Grep utility in unix.
Algebraic Laws of RE
● COMMUTATIVITY
● ASSOCIATIVITY
● IDENTITIES
● ANNIHILATOR
● DISTRIBUTIVE
● IDEMPOTENT
COMMUTATIVITY
● For regular expressions, we have:
● L + M = M + L
● Commutative law for union: we may make the union of two
languages in either order
● Clearly the law L.M = M.L is FALSE (Commutative law for
concatenation)
ASSOCIATIVITY
● (L + M) + N = L + ( M + N) Associative law for union: we
may take the union of three languages either by taking the
union of the first two initially, or taking the union of the last
two initially. Together with the commutative law we can take
the union of any collection of languages with any order and
grouping, and the result will be the same. Intuitively, a string
is in L1 ∪ L2 . . . ∪ Lk iff it is in one or more of the Li s.
● (L.M).N = L.(M.N) Associative law for concatenation: we
can concatenate three-languages by concatenating either the
first two or the last two initially
IDENTITIES
● An identity for an operator is a value that when the
operator is applied to the identity and some other value, the
result is the other value.
● ∅ + L = L + ∅ = L
● e.L = L.e = L
ANNIHILATOR
● An annihilator for an operator is value that when the
operator is applied to the annihilator and some other
value, the result is the annihilator.
● ∅.L = L. ∅ = ∅
DISTRIBUTIVE
● For regular expressions we have:
● Left distributivity: L.(M + N) = LM + LN
● Right distributivity: (M + N).L = ML + NL
IDEMPOTENT
● An operator is idempotent if the result of applying it to two
of
● the same values as arguments is that value.
● Idempotent Law for union:
● L + L = L
● If we take the union of two identical expressions, we can
replace them by one copy of the expression.
Identities Related to Regular Expressions l={0,1}{l2}
Given R, P, L, Q as regular expressions, the following
identities hold −
• ∅* = ε
• ε* = ε
• RR* = R*R=R+
• R*R* = R*
• (R*)* = R*
• (PQ)*P =P(QP)*
• (a+b)* = (a*b*)* = (a*+b*)* = (a+b*)* = a*(ba*)*
• R + ∅ = ∅ + R = R (The identity for union)
• R ε = ε R = R (The identity for concatenation)
• ∅ L = L ∅ = ∅ (The annihilator for concatenation)
• R + R = R (Idempotent law)
• L (M + N) = LM + LN (Left distributive law)
• (M + N) L = ML + NL (Right distributive law)
• ε + RR* = ε + R*R = R*
Arden’s Theorem
In order to find out a regular expression of a Finite Automaton, we
use Arden’s Theorem along with the properties of regular
expressions.
Statement −
Let P and Q be two regular expressions.
If P does not contain null string, then R = Q + RP has a unique
solution that is R = QP*
Proof −
R = Q + (Q + RP)P [After putting the value R = Q + RP]
= Q + QP + RPP
When we put the value of R recursively again and again, we get the
following equation −
R = Q + QP + QP2 + QP3…..
R = Q (ε + P + P2 + P3 + …. )
R = QP* [As P* represents (ε + P + P2 + P3 + ….) ]
Hence, proved.
FA & RE
From DFA to RE
● Arden’s Theorem Steps:
● 1) Build RE for each state
● 2) Solve final states equations first
● State Elimination Method Steps
● 1) The start state of DFA must not have any incoming edges. If there exists any
incoming edge to start state ,then create a new state having no income edges.
● 2)There must be only one final state in DFA, If DFA contain more final states,
then create a new final state and all other final states to non final states
● 3) The final state of DFA doesn’t contain any out going edges, then create new
final state without any out going edges
● 4) Now start elimination intermediate states in any order. Finally we have
initial state going to final state.
● Question 1:
Question 2
RE to FA
Limitation of FA
● It have finite number of states.
● Finite amount of memory so doesn’t remember
previous state outcome.
● So in above scenarios we use pumping lemma.
Pumping Lemma
Theorem
Let L be a regular language. Then there exists a
constant ‘n’ such that for every string w in L −
|w| ≥ n
We can break w into three strings, w = xyz, such that −
• |y| = ε
• |xy| ≤ n
• For all k ≥ 0, the string xykz is also in L.
Applications of Pumping Lemma
Pumping Lemma is to be applied to show that certain
languages are not regular. It should never be used to show a
language is regular.
• If L is regular, it satisfies Pumping Lemma.

• If L does not satisfy Pumping Lemma, it is non-regular.

Applications of PL
Properties of Regular Sets/ Closure Properties
Property 1. The union of two regular set is regular.
Proof −
Let us take two regular expressions
RE1 = a(aa)* and RE2 = (aa)*
So, L1 = {a, aaa, aaaaa,.....} (Strings of odd length
excluding Null)
and L2 ={ ε, aa, aaaa, aaaaaa,.......} (Strings of even
length including Null)
L1 ∪ L2 = { ε, a, aa, aaa, aaaa, aaaaa, aaaaaa,.......}
(Strings of all possible lengths including Null)
RE (L1 ∪ L2) = a* (which is a regular expression itself)
Hence, proved.
Property 2. The intersection of two regular set is regular.
Proof −
Let us take two regular expressions
RE1 = a(a*) and RE2 = (aa)*
So, L1 = { a,aa, aaa, aaaa, ....} (Strings of all possible lengths
excluding Null)
L2 = { ε, aa, aaaa, aaaaaa,.......} (Strings of even length
including Null)
L1 ∩ L2 = { aa, aaaa, aaaaaa,.......} (Strings of even length
excluding Null)
RE (L1 ∩ L2) = aa(aa)* which is a regular expression itself.
Hence, proved.
Property 3. The complement of a regular set is regular.
Proof −
Let us take a regular expression −
RE = (aa)*
So, L = {ε, aa, aaaa, aaaaaa, .......} (Strings of even length
including Null)
Complement of L is all the strings that is not in L.
So, L’ = {a, aaa, aaaaa, .....} (Strings of odd length
excluding Null)
RE (L’) = a(aa)* which is a regular expression itself.
Hence, proved.
Property 4. The difference of two regular set is regular.
Proof −
Let us take two regular expressions −
RE1 = a (a*) and RE2 = (aa)*
So, L1 = {a, aa, aaa, aaaa, ....} (Strings of all possible
lengths excluding Null)
L2 = { ε, aa, aaaa, aaaaaa,.......} (Strings of even length
including Null)
L1 – L2 = {a, aaa, aaaaa, aaaaaaa, ....}
(Strings of all odd lengths excluding Null)
RE (L1 – L2) = a (aa)* which is a regular expression.
Hence, proved.
Property 5. The reversal of a regular set is regular.
Proof −
We have to prove LR is also regular if L is a regular
set.
Let, L = {01, 10, 11, 10}
RE (L) = 01 + 10 + 11 + 10
LR = {10, 01, 11, 01}
RE (LR) = 01 + 10 + 11 + 10 which is regular
Hence, proved.
Property 6. The closure of a regular set is regular.
Proof −
If L = {a, aaa, aaaaa, .......} (Strings of odd length
excluding Null)
i.e., RE (L) = a (aa)*
L* = {a, aa, aaa, aaaa , aaaaa,……………} (Strings of
all lengths excluding Null)
RE (L*) = a (a)*
Hence, proved.
Property 7. The concatenation of two regular sets is
regular.
Proof −
Let RE1 = (0+1)*0 and RE2 = 01(0+1)*
Here, L1 = {0, 00, 10, 000, 010, ......} (Set of strings
ending in 0)
and L2 = {01, 010,011,.....} (Set of strings beginning
with 01)
Then, L1 L2 =
{001,0010,0011,0001,00010,00011,1001,10010,..........
...}
Set of strings containing 001 as a substring which can
be represented by an RE − (0 + 1)*001(0 + 1)*
Hence, proved.
Decision Properties of Regular Languages
● Membership
L={ends with 00|{0,1}}
w={1100,00,100,0100,00100….}
● Emptiness
● Equivalence
Equivalence and Minimisation of Automata
● Refer unit 1 ppt.
● Slides 42-50

More Related Content

PPT
Lecture 7
shah zeb
 
PDF
Formal Languages and Automata Theory Unit 1
Srimatre K
 
PDF
Language
Mobeen Mustafa
 
PPTX
Regular expressions
Shiraz316
 
PPTX
Theory of Computation Unit 1
Jena Catherine Bel D
 
PDF
Ch3 4 regular expression and grammar
meresie tesfay
 
PPT
Lecture 3,4
shah zeb
 
PPTX
Regular expressions
Ratnakar Mikkili
 
Lecture 7
shah zeb
 
Formal Languages and Automata Theory Unit 1
Srimatre K
 
Language
Mobeen Mustafa
 
Regular expressions
Shiraz316
 
Theory of Computation Unit 1
Jena Catherine Bel D
 
Ch3 4 regular expression and grammar
meresie tesfay
 
Lecture 3,4
shah zeb
 
Regular expressions
Ratnakar Mikkili
 

What's hot (20)

PDF
TOC 3 | Different Operations on DFA
Mohammad Imam Hossain
 
PPT
Theory of Automata
Farooq Mian
 
PPT
Lecture 8
shah zeb
 
PPTX
Pumping lemma Theory Of Automata
hafizhamza0322
 
DOC
Chapter 1 1
bolovv
 
PDF
Formal Languages and Automata Theory unit 3
Srimatre K
 
PPT
Chapter 5 -Syntax Directed Translation - Copy.ppt
FamiDan
 
PPT
Regular Languages
parmeet834
 
PPTX
NFA Non Deterministic Finite Automata by Mudasir khushik
MudsaraliKhushik
 
PPTX
Regular Expression Examples.pptx
GhulamRabani9
 
PPTX
Chomsky classification of Language
Dipankar Boruah
 
PDF
Automata
Gaditek
 
PPT
Lecture 04 syntax analysis
Iffat Anjum
 
PPTX
Automata theory - NFA ε to DFA Conversion
Akila Krishnamoorthy
 
PPTX
Undecidability.pptx
PEzhumalai
 
PPT
Lesson 08
University of Haripur
 
PDF
Syntax analysis
Akshaya Arunan
 
PPTX
Turing machine
HimanshuSirohi6
 
PDF
TOC 5 | Regular Expressions
Mohammad Imam Hossain
 
PDF
Lecture: Automata
Marina Santini
 
TOC 3 | Different Operations on DFA
Mohammad Imam Hossain
 
Theory of Automata
Farooq Mian
 
Lecture 8
shah zeb
 
Pumping lemma Theory Of Automata
hafizhamza0322
 
Chapter 1 1
bolovv
 
Formal Languages and Automata Theory unit 3
Srimatre K
 
Chapter 5 -Syntax Directed Translation - Copy.ppt
FamiDan
 
Regular Languages
parmeet834
 
NFA Non Deterministic Finite Automata by Mudasir khushik
MudsaraliKhushik
 
Regular Expression Examples.pptx
GhulamRabani9
 
Chomsky classification of Language
Dipankar Boruah
 
Automata
Gaditek
 
Lecture 04 syntax analysis
Iffat Anjum
 
Automata theory - NFA ε to DFA Conversion
Akila Krishnamoorthy
 
Undecidability.pptx
PEzhumalai
 
Syntax analysis
Akshaya Arunan
 
Turing machine
HimanshuSirohi6
 
TOC 5 | Regular Expressions
Mohammad Imam Hossain
 
Lecture: Automata
Marina Santini
 
Ad

Similar to Formal Languages and Automata Theory unit 2 (20)

PDF
Flat unit 2
VenkataRaoS1
 
PDF
FLAT.pdf
AtharvaJoshi930911
 
PPTX
fullunit2-220307090026 (1) theory of computation.pptx
yuvaraniit
 
PPTX
regular expression
RohitKumar596173
 
PDF
Unit ii
TPLatchoumi
 
PPT
Regular expressions-Theory of computation
Bipul Roy Bpl
 
DOCX
UNIT_-_II.docx
karthikeyan Muthusamy
 
PPTX
Chapter 4_Regular Expressions in Automata.pptx
KrishnenduRarhi
 
PPTX
Regular expression
MONIRUL ISLAM
 
PPT
Formal Languages and regular langugaes IN FLAG
interestingfacts10
 
PPT
regular expression smmlmmmmmmmmmmmmm.ppt
rishabhsrivastava518345
 
PPT
Re1 (3)
pepe3059
 
PPT
re1.ppt
PEzhumalai
 
PPT
RegularExpressions-theory of computation and formal language
mohdfareeduddin5
 
PPT
re1.ppt
Sarvesh Warjurkar
 
PDF
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Rushabh2428
 
DOCX
Regular Expression .docx
SUNEEL37
 
PPTX
Unit2 Toc.pptx
viswanath kani
 
PDF
RegularExpressions.pdf
ImranBhatti58
 
Flat unit 2
VenkataRaoS1
 
fullunit2-220307090026 (1) theory of computation.pptx
yuvaraniit
 
regular expression
RohitKumar596173
 
Unit ii
TPLatchoumi
 
Regular expressions-Theory of computation
Bipul Roy Bpl
 
UNIT_-_II.docx
karthikeyan Muthusamy
 
Chapter 4_Regular Expressions in Automata.pptx
KrishnenduRarhi
 
Regular expression
MONIRUL ISLAM
 
Formal Languages and regular langugaes IN FLAG
interestingfacts10
 
regular expression smmlmmmmmmmmmmmmm.ppt
rishabhsrivastava518345
 
Re1 (3)
pepe3059
 
re1.ppt
PEzhumalai
 
RegularExpressions-theory of computation and formal language
mohdfareeduddin5
 
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Rushabh2428
 
Regular Expression .docx
SUNEEL37
 
Unit2 Toc.pptx
viswanath kani
 
RegularExpressions.pdf
ImranBhatti58
 
Ad

More from Srimatre K (8)

PPTX
ML_ Unit 2_Part_B
Srimatre K
 
PPTX
ML_Unit_2_Part_A
Srimatre K
 
PPTX
ML_Unit_1_Part_C
Srimatre K
 
PPTX
ML_Unit_1_Part_B
Srimatre K
 
DOCX
Internet of things unit-1
Srimatre K
 
PPTX
ML_ Unit_1_PART_A
Srimatre K
 
PDF
Formal Languages and Automata Theory unit 5
Srimatre K
 
PDF
Formal Languages and Automata Theory unit 4
Srimatre K
 
ML_ Unit 2_Part_B
Srimatre K
 
ML_Unit_2_Part_A
Srimatre K
 
ML_Unit_1_Part_C
Srimatre K
 
ML_Unit_1_Part_B
Srimatre K
 
Internet of things unit-1
Srimatre K
 
ML_ Unit_1_PART_A
Srimatre K
 
Formal Languages and Automata Theory unit 5
Srimatre K
 
Formal Languages and Automata Theory unit 4
Srimatre K
 

Recently uploaded (20)

PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
CDH. pptx
AneetaSharma15
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 

Formal Languages and Automata Theory unit 2

  • 1. UNIT-2 REGULAR EXPRESSION K LAKSHMI SRVANI ASST PROFESSOR
  • 2. SYLLABUS Regular Expressions: Finite Automata and Regular Expressions, Applications of Regular Expressions, Algebraic Laws for Regular Expressions, Conversion of Finite Automata to Regular Expressions. Pumping Lemma for Regular Languages, Statement of the pumping lemma, Applications of the Pumping Lemma. Closure Properties of Regular Languages: Closure properties of Regular languages, Decision Properties of Regular Languages, Equivalence and Minimization of Automata.
  • 3. Regular Expressions. ● Regular expressions are used for representing certain sets of strings in algebraic fashion. ● Any terminal symbol belongs to Σ including ɸ,ɛ are RE ● The union of 2 RE is also RE ● The Concatenation of 2 RE is also RE ● The iteration or closure of RE is also RE
  • 4. Regular Expressions Regular Set (0 + 10*) L = { 0, 1, 10, 100, 1000, 10000, … } (0*10*) L = {1, 01, 10, 010, 0010, …} (0 + ε)(1 + ε) L = {ε, 0, 1, 01} (a+b)* Set of strings of a’s and b’s of any length including the null string. So L = { ε, a, b, aa , ab , bb , ba, aaa…….} (11)* Set consisting of even number of 1’s including empty string, So L= {ε, 11, 1111, 111111, ……….} (0+1)*011(0+1)* Sub string 011
  • 5. Operators of RE Operators used in regular expressions include: • Union: If R1 and R2 are regular expressions, then R1 | R2 (also written as R1 U R2 or R1 + R2) is also a regular expression. L(R1|R2) = L(R1) U L(R2) or L(R1+R2)
 
 • Concatenation: If R1 and R2 are regular expressions, then R1R2 (also written as R1.R2) is also a regular expression. L(R1R2) = L(R1) concatenated with L(R2).
 
 • Kleene closure: If R1 is a regular expression, then R1* (the Kleene closure of R1) is also a regular expression. L(R1*) = epsilon U L(R1) U L(R1R1) U L(R1R1R1) U ...

  • 6. Precedence ● Closure > Concatenation > Union ● (01*+1)
  • 7. Applications of RE ● RE in unix • [ :digit:][0-9] • [:alpha:]a-z A-Z • [:Alnum:] [A-Z a-z 0-9] ● Lexical Analysis ● Finding Patterns in Text ● Grep utility in unix.
  • 8. Algebraic Laws of RE ● COMMUTATIVITY ● ASSOCIATIVITY ● IDENTITIES ● ANNIHILATOR ● DISTRIBUTIVE ● IDEMPOTENT
  • 9. COMMUTATIVITY ● For regular expressions, we have: ● L + M = M + L ● Commutative law for union: we may make the union of two languages in either order ● Clearly the law L.M = M.L is FALSE (Commutative law for concatenation)
  • 10. ASSOCIATIVITY ● (L + M) + N = L + ( M + N) Associative law for union: we may take the union of three languages either by taking the union of the first two initially, or taking the union of the last two initially. Together with the commutative law we can take the union of any collection of languages with any order and grouping, and the result will be the same. Intuitively, a string is in L1 ∪ L2 . . . ∪ Lk iff it is in one or more of the Li s. ● (L.M).N = L.(M.N) Associative law for concatenation: we can concatenate three-languages by concatenating either the first two or the last two initially
  • 11. IDENTITIES ● An identity for an operator is a value that when the operator is applied to the identity and some other value, the result is the other value. ● ∅ + L = L + ∅ = L ● e.L = L.e = L
  • 12. ANNIHILATOR ● An annihilator for an operator is value that when the operator is applied to the annihilator and some other value, the result is the annihilator. ● ∅.L = L. ∅ = ∅
  • 13. DISTRIBUTIVE ● For regular expressions we have: ● Left distributivity: L.(M + N) = LM + LN ● Right distributivity: (M + N).L = ML + NL
  • 14. IDEMPOTENT ● An operator is idempotent if the result of applying it to two of ● the same values as arguments is that value. ● Idempotent Law for union: ● L + L = L ● If we take the union of two identical expressions, we can replace them by one copy of the expression.
  • 15. Identities Related to Regular Expressions l={0,1}{l2} Given R, P, L, Q as regular expressions, the following identities hold − • ∅* = ε • ε* = ε • RR* = R*R=R+ • R*R* = R* • (R*)* = R* • (PQ)*P =P(QP)* • (a+b)* = (a*b*)* = (a*+b*)* = (a+b*)* = a*(ba*)* • R + ∅ = ∅ + R = R (The identity for union) • R ε = ε R = R (The identity for concatenation) • ∅ L = L ∅ = ∅ (The annihilator for concatenation) • R + R = R (Idempotent law) • L (M + N) = LM + LN (Left distributive law) • (M + N) L = ML + NL (Right distributive law) • ε + RR* = ε + R*R = R*
  • 16. Arden’s Theorem In order to find out a regular expression of a Finite Automaton, we use Arden’s Theorem along with the properties of regular expressions. Statement − Let P and Q be two regular expressions. If P does not contain null string, then R = Q + RP has a unique solution that is R = QP* Proof − R = Q + (Q + RP)P [After putting the value R = Q + RP] = Q + QP + RPP When we put the value of R recursively again and again, we get the following equation − R = Q + QP + QP2 + QP3….. R = Q (ε + P + P2 + P3 + …. ) R = QP* [As P* represents (ε + P + P2 + P3 + ….) ] Hence, proved.
  • 18. From DFA to RE ● Arden’s Theorem Steps: ● 1) Build RE for each state ● 2) Solve final states equations first ● State Elimination Method Steps ● 1) The start state of DFA must not have any incoming edges. If there exists any incoming edge to start state ,then create a new state having no income edges. ● 2)There must be only one final state in DFA, If DFA contain more final states, then create a new final state and all other final states to non final states ● 3) The final state of DFA doesn’t contain any out going edges, then create new final state without any out going edges ● 4) Now start elimination intermediate states in any order. Finally we have initial state going to final state.
  • 22. Limitation of FA ● It have finite number of states. ● Finite amount of memory so doesn’t remember previous state outcome. ● So in above scenarios we use pumping lemma.
  • 23. Pumping Lemma Theorem Let L be a regular language. Then there exists a constant ‘n’ such that for every string w in L − |w| ≥ n We can break w into three strings, w = xyz, such that − • |y| = ε • |xy| ≤ n • For all k ≥ 0, the string xykz is also in L. Applications of Pumping Lemma Pumping Lemma is to be applied to show that certain languages are not regular. It should never be used to show a language is regular. • If L is regular, it satisfies Pumping Lemma.
 • If L does not satisfy Pumping Lemma, it is non-regular.

  • 25. Properties of Regular Sets/ Closure Properties Property 1. The union of two regular set is regular. Proof − Let us take two regular expressions RE1 = a(aa)* and RE2 = (aa)* So, L1 = {a, aaa, aaaaa,.....} (Strings of odd length excluding Null) and L2 ={ ε, aa, aaaa, aaaaaa,.......} (Strings of even length including Null) L1 ∪ L2 = { ε, a, aa, aaa, aaaa, aaaaa, aaaaaa,.......} (Strings of all possible lengths including Null) RE (L1 ∪ L2) = a* (which is a regular expression itself) Hence, proved.
  • 26. Property 2. The intersection of two regular set is regular. Proof − Let us take two regular expressions RE1 = a(a*) and RE2 = (aa)* So, L1 = { a,aa, aaa, aaaa, ....} (Strings of all possible lengths excluding Null) L2 = { ε, aa, aaaa, aaaaaa,.......} (Strings of even length including Null) L1 ∩ L2 = { aa, aaaa, aaaaaa,.......} (Strings of even length excluding Null) RE (L1 ∩ L2) = aa(aa)* which is a regular expression itself. Hence, proved.
  • 27. Property 3. The complement of a regular set is regular. Proof − Let us take a regular expression − RE = (aa)* So, L = {ε, aa, aaaa, aaaaaa, .......} (Strings of even length including Null) Complement of L is all the strings that is not in L. So, L’ = {a, aaa, aaaaa, .....} (Strings of odd length excluding Null) RE (L’) = a(aa)* which is a regular expression itself. Hence, proved.
  • 28. Property 4. The difference of two regular set is regular. Proof − Let us take two regular expressions − RE1 = a (a*) and RE2 = (aa)* So, L1 = {a, aa, aaa, aaaa, ....} (Strings of all possible lengths excluding Null) L2 = { ε, aa, aaaa, aaaaaa,.......} (Strings of even length including Null) L1 – L2 = {a, aaa, aaaaa, aaaaaaa, ....} (Strings of all odd lengths excluding Null) RE (L1 – L2) = a (aa)* which is a regular expression. Hence, proved.
  • 29. Property 5. The reversal of a regular set is regular. Proof − We have to prove LR is also regular if L is a regular set. Let, L = {01, 10, 11, 10} RE (L) = 01 + 10 + 11 + 10 LR = {10, 01, 11, 01} RE (LR) = 01 + 10 + 11 + 10 which is regular Hence, proved.
  • 30. Property 6. The closure of a regular set is regular. Proof − If L = {a, aaa, aaaaa, .......} (Strings of odd length excluding Null) i.e., RE (L) = a (aa)* L* = {a, aa, aaa, aaaa , aaaaa,……………} (Strings of all lengths excluding Null) RE (L*) = a (a)* Hence, proved.
  • 31. Property 7. The concatenation of two regular sets is regular. Proof − Let RE1 = (0+1)*0 and RE2 = 01(0+1)* Here, L1 = {0, 00, 10, 000, 010, ......} (Set of strings ending in 0) and L2 = {01, 010,011,.....} (Set of strings beginning with 01) Then, L1 L2 = {001,0010,0011,0001,00010,00011,1001,10010,.......... ...} Set of strings containing 001 as a substring which can be represented by an RE − (0 + 1)*001(0 + 1)* Hence, proved.
  • 32. Decision Properties of Regular Languages ● Membership L={ends with 00|{0,1}} w={1100,00,100,0100,00100….} ● Emptiness ● Equivalence
  • 33. Equivalence and Minimisation of Automata ● Refer unit 1 ppt. ● Slides 42-50