0% found this document useful (0 votes)
11 views

Regular Expression

The document discusses regular expressions and their relationship to finite automata. It defines regular expressions, gives rules for constructing regular expressions, and shows how to convert between regular expressions and finite automata using theorems like Arden's Theorem.

Uploaded by

Md. Emon Hasan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Regular Expression

The document discusses regular expressions and their relationship to finite automata. It defines regular expressions, gives rules for constructing regular expressions, and shows how to convert between regular expressions and finite automata using theorems like Arden's Theorem.

Uploaded by

Md. Emon Hasan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Regular Expression

Course Title : Theory of Computation


Course code : ICT-3107

Presented By :
Sagor Roy
IT-21044
Dept of ICT,MBSTU
Objectives

 What is Regular Expression


 Why we need Regular Expression
 Rules of Regular Expression
 Regular Expression of a Language
 Conversion of finite Automata to Regular Expression
 Conversion of Regular Expression to Finite Automata
 Q&A

2
What is Regular Expression

The language accepted by finite automata can be easily described by simple expressions
called Regular Expressions. It is the most effective way to represent any language.

 In a regular expression, a* means zero or more occurrence of a. It can generate {e, a,


aa, aaa, aaaa, .....}

 In a regular expression, a+ means zero or more occurrence of a. It can generate { a, aa,


aaa, aaaa, .....}

3
Rules of Regular Expression

 Union: If R1 and R2 are two regular languages then their union R1 U R2 is also
Regular.
 Intersection: If R1 and R2 are two regular languages then their intersection is also a
regular language.
 Kleen closure: If R1 is a regular language then its Kleen closure R1* will also be a
regular language.

4
Regular Expression of a Language

1. Write the regular Expression for the following languages over {a,b}
 language that accepts all string of length exactly 2
the possible set which accepted by this Finite automata will be {aa,ab,ba,bb}
then the regular expression simply will be the union of this elements
r.e.= aa + ab + ba + bb
= a(a+b) +b(a+b)
=(a+b)(a+b)

 Then what is the Regular expression that accepts all string of length atleast 2
 Language that accepts all string of length atmost 2

5
Conversion of Finite Automata to Regular Expression

 Design a Finite Automata for the following Regular Expression


1. ab*a
2. (a+b)c
3. a(bc)*

1. For AND we add states and for OR we divide this inputs and for Kleen closure we have
to loop on the state. So the finite automata of ab*a will be :

A a b B a C

6
Conversion of Regular Expression to Finite Automata

a 1. We have to build a equation using incoming transitions for


Q R each state and then we have to solve the final state equation
b using the equation of other states.
2. By using Arden’s Theorem ,
b a a for R=Q+RP
R = QP*
where R is state and Q and P are regular Expression
S T
b a,b

7
Conversion of Regular Expression to Finite
Automata(cont..)
1. Q = e + aS + bR
2. R= aQ
3. S=bQ
4. T= aR+bS+aT+bT
Which is the Regular Expression of the given
Putting 2 and 3 in eqn 1 then Deterministic Finite Automata .
Q= e+a(bQ) + b(aQ) And The Regular Expression is
Q=e + Q(ab+ba)* r.e.= (ab+ba)*

By Arden’s Theorem
Q=e(ab+ba)*
Q=(ab+ba)*
8
Q&A

9
THANK YOU

10

You might also like