0% found this document useful (0 votes)
64 views26 pages

Introduction to Automata Theory

The document introduces the concepts of automata theory and formal languages. It discusses that automata theory studies abstract machines and the computational problems that can be solved with them. An automaton is a mathematical object that accepts or rejects input words. The set of accepted words forms the automaton's language. The document will focus on three models of computation: finite automata and regular languages, pushdown automata and context-free languages, and Turing machines and recursively enumerable languages.

Uploaded by

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

Introduction to Automata Theory

The document introduces the concepts of automata theory and formal languages. It discusses that automata theory studies abstract machines and the computational problems that can be solved with them. An automaton is a mathematical object that accepts or rejects input words. The set of accepted words forms the automaton's language. The document will focus on three models of computation: finite automata and regular languages, pushdown automata and context-free languages, and Turing machines and recursively enumerable languages.

Uploaded by

Shakeel Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Welcome to !

Lecture 1
Theory Of Automata

1
Course Information
 Course information and updates will be posted on Google
Classroom
 Schedule
 News and announcements
 Lecture Slides
 Assignments
 etc.

 Email: [Link]@[Link]
Textbooks

 Introduction to Computer Theory


by Daniel Cohen
Grading Scheme

 Midterm 30%
 Sessional 30%
 Final 40%
Introduction – Automata
Theory
Automata theory is the study of abstract machines and
automata, as well as the computational problems that can be
solved using them
 Abstract Machine: Is a theoretical model of a computer hardware
or software
 Automata: It comes from the Greek word αὐτόματα meaning
"self-acting". So it refers to a self-operating machine.

Automata play a major role in theory of computation, compiler


design, artificial intelligence, parsing and formal verification.
Introduction – Automata
Theory
 Automaton:
 Its singular of automata.
 An automaton is a mathematical object that takes a word as input
and decides either to accept it or reject it.

 The set of words accepted by an automaton is called its


language.
Introduction – Formal
language theory

 Automata theory is also closely related to formal language


theory.

 Formal Language: In mathematics, computer science,


and linguistics, a formal language is
a set of strings of symbols that may be forced by rules that are
specific to it.

 An automaton is a finite representation of a formal language


that may be an infinite set.
Introduction – Our focus

Many computation models exist.


 Can’t cover them all.
Will concentrate on 3 groups of models:
1. Regular languages & Finite automata
2. Context-free languages & Push-down automata
3. Recursively-enumerable languages & Turing machines
A simple example computer

BATTERY

input: switch
output: light bulb
actions: flip switch
states: on, off
A simple “computer”

BATTERY start off on

input: switch
output: light bulb
actions: f for “flip switch”
states: on, off
A simple “computer”

BATTERY start off on

input: switch
output: light bulb bulb is on if and only if
there was an odd number
actions: f for “flip switch” of flips
states: on, off
Another “computer”

BATTERY

inputs: switches 1 and 2


actions: 1 for “flip switch 1”
actions: 2 for “flip switch 2”
states: on, off
Another “computer”
1
1 start off off
1

2 2 2 2
BATTERY
1
2
off on
1

inputs: switches 1 and 2


actions: 1 for “flip switch 1”
actions: 2 for “flip switch 2”
states: on, off
Another “computer”
1
1 start off off
1

2 2 2 2
BATTERY
1
2
off on
1

inputs: switches 1 and 2


actions: 1 for “flip switch 1” bulb is on if and only if
actions: 2 for “flip switch 2” both switches were flipped
an odd number of times
states: on, off
Introduction to languages

Kinds of languages:

 Talking language
 Programming language
 Formal Languages
Alphabets

 Definition:
A finite non-empty set of symbols (letters), is called an
alphabet. It is denoted by Σ ( Greek letter sigma).
 Example:
Σ={a,b}
Σ={0,1} //important as this is the language
//which the computer understands.
Σ={i,j,k}

16
NOTE:

 A certain version of language ALGOL has 113 letters

17
Strings

 Definition:
Concatenation of finite symbols from the alphabet is called a
string.

 Example:
If Σ= {a,b} then
a, abab, aaabb, ababababababababab

18
NOTE:

EMPTY STRING or NULL STRING


 Sometimes a string with no symbol at all is used, denoted by
(Small Greek letter Lambda) λ or (Capital Greek letter
Lambda) Λ, is called an empty string or null string.
 The capital lambda will mostly be used to denote the empty
string, in further discussion.

19
Words

 Definition:
Words are strings belonging to some language.

Example:
If Σ= {x} then a language L can be defined as
L={xn : n=1,2,3,…..} or L={x,xx,xxx,….}
Here x,xx,… are the words of L

20
NOTE:

 All words are strings, but not all strings are words.

21
Valid/In-valid alphabets

 While defining an alphabet, an alphabet may contain letters


consisting of group of symbols for example Σ1= {B, aB, bab, d}.

 Now consider an alphabet


Σ2= {B, Ba, bab, d} and a string BababB.

22
This string can be tokenized in two different ways
 (Ba), (bab), (B)
 (B), (abab), (B)
Which shows that the second group cannot be identified as a
string, defined over
Σ = {a, b}.

23
 As when this string is scanned by the compiler (Lexical
Analyzer), first symbol B is identified as a letter belonging to Σ,
while for the second letter the lexical analyzer would not be
able to identify, so while defining an alphabet it should be kept
in mind that ambiguity should not be created.

24
Remarks:

 While defining an alphabet of letters consisting of more than


one symbols, no letter should be started with the letter of the
same alphabet i.e. one letter should not be the prefix of
another. However, a letter may be ended in the letter of same
alphabet i.e. one letter may be the suffix of another.

25
Conclusion
 Σ1= {B, aB, bab, d}
 Σ2= {B, Ba, bab, d}

Σ1 is a valid alphabet while Σ2 is an in-valid alphabet.

26

You might also like