2 IntroToAutomataTheory
2 IntroToAutomataTheory
Theory
Lecture 1
1
What is Automata Theory?
Study of abstract computing devices, or
“machines”
Automaton = an abstract computing device
2
(A pioneer of automata theory)
3
What is Automata Theory?
The word automata comes from the Greek word
αὐτόματος(automaton), which means "self-acting,
self-willed, self-moving".
Automata are abstract self-propelled computing
devices or machines that follow a predetermined
sequence of operations automatically.
An automaton with a finite number of states is called
a Finite Automaton (FA) or Finite-State Machine
(FSM).
4
Example of Automata
5
Theory of Computation: A
Historical Perspective
1930s • Alan Turing studies Turing machines
• Decidability
• Halting problem
1940-1950s • “Finite automata” machines studied
• Noam Chomsky proposes the
“Chomsky Hierarchy” for formal
languages
1969 Cook introduces “intractable” problems
or “NP-Hard” problems
1970- Modern computer science: compilers,
computational & complexity theory evolve
6
The Central Concepts of
Automata Theory
7
Symbol
A symbol is a user defined entity or it is a collection
of letters, digits, pictures and special characters.
8
Alphabet
An alphabet is a finite, non-empty set of symbols
We use the symbol ∑ (sigma) to denote an alphabet
Examples:
Binary: ∑ = {0,1}
…
9
Strings
A string or word is a finite sequence of symbols chosen
from ∑
Empty string is (“epsilon”)
∑* = ∑0 U ∑1 U ∑2 U …
∑ + = ∑1 U ∑ 2 U ∑ 3 U …
11
Languages
L is a said to be a language over alphabet ∑, only if L ∑*
this is because ∑* is the set of all strings (of all possible lengths
including 0) over the given alphabet ∑
Examples:
1. Let L be the language of all strings consisting of n 0’s followed
by n 1’s:
L = {, 01, 0011, 000111,…}
2. Let L be the language of all strings of with equal number of 0’s
and 1’s:
L = {, 01, 10, 0011, 1100, 0101, 1010, 1001,…}
13
Examples:
• Language of strings containing only 0’s:
L = { "0", "00", "000", ...}
• Language of strings containing only 1’s:
L = { "1", "11", "111", ...}
• Language of strings with an even number of 0’s:
L = {"", "00", "0000", "000000", ...}
• Language of strings with an odd number of 1’s:
L = {"1", "111", "11111", "1111111", ...}
• Language of strings with a repeating pattern "01":
L = {"01", "0101", "010101", "01010101", ...}
14
Examples:
1. Language of strings with at least two consecutive 1's:
2. Language of strings with at least one occurrence of "101":
3. Language of strings with the substring "010":
4. Language of strings with an equal number of 0's and 1’s:
15
Examples:
• Language of strings with at least two consecutive 1’s:
L = {"11", "111", "1111", "11111", "111111", ...}
• Language of strings with at least one occurrence of "101":
L = {"101", "0101", "10101", "1010101", ...}
• Language of strings with the substring "010":
L = {"010", "101010", "010101010", "101010101010", ...}
• Language of strings with an equal number of 0's and 1’s :
L = {"", "01", "0011", "000111", "1100", "0110", ...}
16
Examples:
Write a language with ∑ = {0, 1} accepts:
1. those string which starts with 1 and ends with 0.
2. the only input 101.
3. even number of 0's and even number of 1’s.
4. the set of all strings with three consecutive 0’s.
5. the strings with an even number of 0's followed by
single 1.
17
Examples:
• Language that accepts strings starting with 1 and ending with 0:
L = {"10", "110", "1110", "11110", ...}
• Language that only accepts the input "101":
L = {"101"}
• Language that accepts strings with an even number of 0's and an even
number of 1’s:
L = {"", "00", "000", "11", "1100", "0000", "1111", "001100", ...}
• Language that accepts all strings with three consecutive 0’s:
L = {"000", "1000", "01000", "11000", "101000", ...}
• Language that accepts strings with an even number of 0's followed by a
single 1:
L = {"1", "001", "0001", "1001", "00001", "1101", "000001", ...}
18
The Membership Problem
Given a string w ∑*and a language L over
∑, decide whether or not w L.
Example:
Let w = 100011
Q) Is w the language of strings with equal
number of 0s and 1s?
19
Finite Automata : Examples
action
On/Off switch state