0% found this document useful (0 votes)
98 views73 pages

Module-1 - Introduction To Automata Theory

The document discusses automata theory and computational models. It introduces different types of automata - finite automata, pushdown automata, and Turing machines - which differ in the type of memory they use. Finite automata have no temporary memory, pushdown automata use a stack, and Turing machines use random access memory. The power of the automata increases from finite to pushdown to Turing machines. The document also discusses concepts like alphabets, strings, languages, and operations on languages that are important to automata theory.

Uploaded by

Sindhu P
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views73 pages

Module-1 - Introduction To Automata Theory

The document discusses automata theory and computational models. It introduces different types of automata - finite automata, pushdown automata, and Turing machines - which differ in the type of memory they use. Finite automata have no temporary memory, pushdown automata use a stack, and Turing machines use random access memory. The power of the automata increases from finite to pushdown to Turing machines. The document also discusses concepts like alphabets, strings, languages, and operations on languages that are important to automata theory.

Uploaded by

Sindhu P
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 73

Module-1

Introduction to Automata
Theory

09/01/2022
1
Models of Computation

09/01/2022 2
Computation

CPU memory

09/01/2022 3
temporary memory

input memory
CPU
output memory

Program memory

09/01/2022 4
3
Example: f ( x)  x

temporary memory

input memory
CPU
output memory
Program memory
compute xx
2
09/01/2022
compute x x 5
3
f ( x)  x

temporary memory
input memory
x2
CPU
output memory
Program memory
compute xx
2
09/01/2022
compute x x 6
3
temporary memory f ( x)  x
z  2*2  4
f ( x)  z * 2  8
input memory
x2
CPU
output memory
Program memory
compute xx
2
09/01/2022
compute x x 7
3
temporary memory f ( x)  x
z  2*2  4
f ( x)  z * 2  8
input memory
x2
CPU
f ( x)  8
Program memory output memory
compute xx
2
09/01/2022
compute x x 8
Automata theory is the study of
abstract machines and automata.
The computational problems can be
solved using them.
It is a theory in theoretical computer
science and discrete mathematics

09/01/2022 9
Automaton
temporary memory

Automaton
input memory
CPU
output memory

Program memory

09/01/2022 10
Different Kinds of Automata
Automata are distinguished by the temporary memory

• Finite Automata: no temporary memory

• Pushdown Automata: stack

• Turing Machines: random access memory

09/01/2022 11
Finite Automaton

temporary memory

Finite input memory


Automaton
output memory

Example: Vending Machines (small computing power)

09/01/2022 12
Pushdown Automaton
Stack Push, Pop

Pushdown input memory


Automaton output memory

Example: Compilers for Programming Languages


(medium computing power)

09/01/2022 13
Turing Machine

Random Access Memory

input memory
Turing
Machine output memory

Examples: Any Algorithm (highest computing power)

09/01/2022 14
Power of Automata

Finite Pushdown Turing


Automata Automata Machine

Less power Solve more More power


computational problems

09/01/2022 15
Applications of finite automata
 For the designing of lexical analysis of a compiler which breaks the
input text into logical units like identifiers, keywords etc.
 For recognizing the pattern using regular expressions.
 For the designing of the combination and sequential circuits.
 Software for designing and checking the behavior of digital circuits.
 Used in text editors.
 For the implementation of spell checkers.
 Software for scanning large bodies of text like web pages to find
occurrence of words, phrases and other patterns.
 Software to verify all types that have finite number of distinct
states such as communications protocols for secure exchange of
information.

09/01/2022 16
Applications of Push Down Automata

 For designing the parsing phase of a compiler (Syntax


Analysis).
 For implementation of stack applications.
 For evaluating the arithmetic expressions.
 For solving the Tower of Hanoi Problem.

09/01/2022 17
Applications of Turing machine
 For solving any recursively enumerable problem.
 For understanding complexity theory.
 For implementation of neural networks.
 For implementation of Robotics Applications.
 For implementation of artificial intelligence.

09/01/2022 18
General Concepts of Automata Theory
• Alphabet
• Strings
• Empty Strings
• Length of the string
• Power of an Alphabet
• Concatenation of two strings
• Languages

09/01/2022
19
Alphabets and Strings
• We will use small alphabets:   a, b
• Strings
a
ab u  ab
abba
v  bbbaaa
baba
aaabbbaabab w  abba

09/01/2022
20
String Operations

w  a1a2  an abba
v  b1b2 bm bbbaaa

1. Concatenation

wv  a1a2  anb1b2 bm abbabbbaaa

09/01/2022
21
2.Reverse
w  a1a2  an ababaaabbb
w R  an  a2 a1 bbbaaababa
3. String Length
w  a1a2  an Examples:
abba  4
Length: w n aa  2
a 1

09/01/2022 22
4. Length of Concatenation
uv  u  v
• Example: u  aab, u 3
v  abaab, v 5

uv  aababaab  8
uv  u  v  3  5  8

09/01/2022
23
5. Empty String
• A string with no letters:  or ϵ

• Observations:
  0

w  w  w

abba  abba  abba

09/01/2022
24
6. Substring
• Substring of string:
• a subsequence of consecutive characters
String Substring
abbab ab
abbab abba
abbab b
abbab bbab

09/01/2022
25
7. Prefix and Suffix
abbab

 abbab w  uv
Prefixes Suffixes
a bbab
ab bab prefix
abb ab suffix
abba b
abbab 

09/01/2022
26
8. Another Operation
n
w  ww
 
w
n
2
• Example: abba   abbaabba

• Definition: w0  
abba 0  

09/01/2022
27
9. The * Operation

 * the set of all possible strings from  alphabet


  a, b
*   , a, b, aa, ab, ba, bb, aaa, aab,

09/01/2022
28
10. The + Operation
 : the set of all possible strings from

alphabet  except 

  a, b
*   , a, b, aa, ab, ba, bb, aaa, aab,

   * 

  a, b, aa, ab, ba, bb, aaa, aab,

09/01/2022 29
Languages
• A language is a set of strings

• String: A sequence of letters


• Examples: “cat”, “dog”, “house”, …

• Defined over an alphabet:


  a, b, c, , z

09/01/2022
30
• A language is any subset of  *

• Example:
  a, b
*   , a, b, aa, ab, ba, bb, aaa,
• Languages:
 
a, aa, aab
{ , abba, baba, aa, ab, aaaaaa}

09/01/2022
31
Note that

Sets   { }  {}
Set size {}    0
Set size {}  1
String length  0

09/01/2022 32
Another Example
An infinite language n n
L  {a b : n  0}

ab
L abb  L
aabb
aaaaabbbbb

09/01/2022
33
Operations on Languages
1. The usual set operations
a, ab, aaaabb, ab  {a, ab, bb, aaaa}
a, ab, aaaabb, ab  {ab}
a, ab, aaaa bb, ab  a, aaaa
Complement: L   * L
a, ba   , b, aa, ab, bb, aaa,

09/01/2022
34
• L1= { ab,abb}
• L2= { abb,ba}
• Find L1U L2 = { ab,abb,ba}
• L1 –L2 = { ab}
• L1 = { abb}

09/01/2022
35
2. Reverse
Definition:
R R
L  {w : w  L}

R
Examples:
ab, aab, baba  ba, baa, abab
n n
L  {a b : n  0}

LR  {b n a n : n  0}

09/01/2022
36
• L = { baa, ab,bb,aba }
• Find

09/01/2022
37
3.Concatenation

• Definition: L1L2  xy : x  L1, y  L2 

• Example: a, ab, bab, aa

 ab, aaa, abb, abaa, bab, baaa

09/01/2022
38
4. Another Operation
• Definition: Ln  LLL
n

3
a, b  a, ba, ba, b 
aaa, aab, aba, abb, baa, bab, bba, bbb
L0  
• Special case:
a , bba , aaa 0  

09/01/2022
39
More Examples

n n
L  {a b : n  0}

2 n n m m
L  {a b a b : n, m  0}
2
aabbaaabbb L

09/01/2022
40
5. Star-Closure (Kleene *)
Definition: 0 1 2
L*  L  L  L 

 , 
• Example:
a, bb, 
 
a, bb*   
 aa , abb, bba , bbbb, 
aaa, aabb, abba, abbbb,

09/01/2022
41
6. Positive Closure

 1 2
L  L  L 
Definition:
 L *  
a, bb, 
  
a, bb  aa, abb, bba, bbbb, 
aaa, aabb, abba, abbbb,
 
09/01/2022
42
Language Recognizers : An example of Finite
Automata

An automaton is an abstract model of a


digital computer.

Finite Automata(FA) is the simplest machine


to recognize patterns.

09/01/2022 43
Finite Automaton

Input
String
Output
“Accept”
Finite or
Automaton “Reject”

09/01/2022
44
Representation of Finite Automata

Finite Automata is represented by –

1. Transition Graph
2. Transition Table
3. Regular Expression

09/01/2022 45
Transition Graph
a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

initial accepting
state state state
transition

09/01/2022
46
Initial Configuration
Input String
a b b a

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022
47
Reading the Input

a b b a

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022
48
a b b a

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022
49
a b b a

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022
50
a b b a

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022
51
Input finished

a b b a

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4
accept
09/01/2022 52
Rejection

a b a

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022
53
a b a

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022
54
a b a

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022
55
a b a

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022
56
Input finished

a b a

a, b

reject
q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022 57
Another Rejection

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

09/01/2022
58

a, b

q5
a, b
b a a b
q0 a q1 b q2 b q3 a q4

reject
09/01/2022
59
Another Example

a a b

a a, b

b a, b
q0 q1 q2

09/01/2022 60
a a b

a a, b

b a, b
q0 q1 q2

09/01/2022 61
a a b

a a, b

b a, b
q0 q1 q2

09/01/2022 62
a a b

a a, b

b a, b
q0 q1 q2

09/01/2022 63
Input finished

a a b

a a, b
accept

b a, b
q0 q1 q2

09/01/2022 64
Rejection Example

b a b

a a, b

b a, b
q0 q1 q2

09/01/2022 65
b a b

a a, b

b a, b
q0 q1 q2

09/01/2022 66
b a b

a a, b

b a, b
q0 q1 q2

09/01/2022 67
b a b

a a, b

b a, b
q0 q1 q2

09/01/2022 68
Input finished

b a b

a a, b

b a, b
q0 q1 q2

reject
09/01/2022 69
Languages Accepted by FAs
Definition:

The language LM  contains


all input strings accepted by M

LM  = { strings that bring M


to an accepting state}

09/01/2022
70
Example
LM   abba M

a, b

q5
a a, b
b a b
q0 a q1 b q2 b q3 a q4
accept
09/01/2022
71
Example
LM    , ab, abba M

a, b

q5
b a a a, b
b
q0 a q1 b q2 b q3 a q4
accept accept accept
09/01/2022
72
Example

n
LM   {a b : n  0}

a a, b

b a, b
q0 q1 q2

accept trap state/


dead state
09/01/2022
73

You might also like