Theory of Computation: Delhi Technological University, Delhi
Theory of Computation: Delhi Technological University, Delhi
By
Prof. Sanjay Patidar (Assistant Professor)
Department of Computer Science &
Engineering,
Delhi Technological University ,Delhi
Theory of Computation, By Sanjay Patidar, CSE ,DTU, Delhi
A presentation on
• Contents:
Introduction
Chomsky Classification of grammar
Relationship between languages & machines
Regular Expression
DFA and NFA
Design of DFA and NFA
Design of FA from regular expression
Closure Properties of Regular language
Theory of Computation,
Automata theory
• Introduction:
The theory of computation is the subject that
deals with language processes.
Compiler is a language acceptor and translator.
01
Theory of Computation,
Automata theory
• Definition:
A grammar G is defined as a quadruple.
G= (V, T, S, P)
Where
V= Finite set of variables (non-terminal)
T= Finite set of terminal symbol
S=S is the start variable
P= Set of productions.
02
Theory of Computation,
Automata theory
• Example 1:
S AB
A aA/a
B bB/b
It is also known as production rule of the
grammar.
Terminal symbols are the part of strings
03
Theory of Computation,
Automata theory
04
Theory of Computation,
Automata theory
• Example 2:
S aSb/ λ
L= { λ ,ab ,aabb , aaabbb ……. anbn }
L= { anbn :n >0}
Equal no. of a’s and b’s.
05
Theory of Computation,
Automata theory
06
Theory of Computation,
Automata theory
(Variables) i. e (v U t )*
There is no restriction on , and
Example:
aA Bb ,
AaAb
07
Theory of Computation,
Automata theory
(Variables) i. e (v U t )*
Left hand side should contain at least one
non-terminal.
Example:
aA Bb ,
AaAb (not allowed)
08
Theory of Computation,
Automata theory
only.
are set of terminal and non-terminal
(Variables) i. e (v U t )*
Example:
AAaB ,
AaB (not allowed)
09
Theory of Computation, NTUEE
Automata theory
A a
AaB or ABa
Aaa
There is restriction on both side of
production. 10
Theory of Computation,
Automata theory
Recursive
Recursively Enumerable
11
Theory of Computation,
Automata theory
TM >LBA>PDA>DFA
12
Theory of Computation,
Automata theory
• Regular Expression
For representation of Regular grammar and
regular languages we use regular expression
a* = {λ ,a , aa,aaa….. } where * =
{ 0,1,2….infinite}
a+ = {a , aa,aaa……...} where + =
{ 1,2…….infinite}
is a regular expression which represent
empty set. Or null set.
={ }
(a+ b) or (aUb)= {a,b} or either a or b.
(a+ b) (a+ b): L= {aa, ab, ba, bb}.
13
Theory of Computation,
Automata theory
• Regular Expression
(a+b)*
L= {λ ,a , ab, ba…..}
Represent all strings of a and b.
(a*b*)
14
Theory of Computation,
Automata theory
• Regular Expression
Example1 :
L2= an bn
No regular expression possible.
15
Theory of Computation,
Automata theory
16
Theory of Computation,
Automata theory
• Automata
An automata contains a finite set of states. At
17
Theory of Computation,
Automata theory
18
Theory of Computation,
Automata theory
19
Theory of Computation,
Automata theory
input alphabet.
When the end of the string is reached, the
20
Theory of Computation,
Automata theory
21
Theory of Computation,
Automata theory
22
Theory of Computation,
Automata theory
23
Theory of Computation,
Automata theory
24
Theory of Computation,
Automata theory
25
Theory of Computation, NTUEE
Automata theory
26
Theory of Computation,
Automata theory
27
Theory of Computation,
Automata theory
28
Theory of Computation,
Automata theory
29
Theory of Computation,
Automata theory
30
Theory of Computation,
Automata theory
• DFA Vs NFA
All the properties of NFA are same as that of DFA
except
31
Theory of Computation,
Automata theory
32
Theory of Computation,
Automata theory
33
Theory of Computation, NTUEE
Automata theory
Intersection
L1∩L2= a* + b*
So regular language are closed under
intersection.
34
Theory of Computation,
Automata theory
Complement
L=(a + b)* then L’=
L= , then L’=(a + b)*
So regular language are closed under
complement.
35
Theory of Computation,
Automata theory
Reg
(0 3 ) * 00 { 0 n | n mod 3 2 }
{ a n b n | n 0} C
F
CS l
a b
L {an bn cn | n 0 } i d l e
e c ab
D er
m
algorithm to answer " x L ?" eEnu
b ly le
ta b
pu m er a
LH Co
Halting Problem
m
Enu
b l y
u t a
LH omp
n -C
No 36
Theory of Computation,
Automata theory
Thanks
37
Theory of Computation,