0% found this document useful (0 votes)
42 views23 pages

Automata Theory-Introduction MAIT TOC GGSIPU

Automata Theory is the study of abstract computing devices and their capabilities, focusing on what different models of machines can and cannot do. It involves formal languages, which are sets of strings from a finite alphabet, and various types of automata, such as finite automata and Turing machines. The theory has applications in areas like text editing, pattern recognition, and compiler design.

Uploaded by

animeshlego5
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)
42 views23 pages

Automata Theory-Introduction MAIT TOC GGSIPU

Automata Theory is the study of abstract computing devices and their capabilities, focusing on what different models of machines can and cannot do. It involves formal languages, which are sets of strings from a finite alphabet, and various types of automata, such as finite automata and Turing machines. The theory has applications in areas like text editing, pattern recognition, and compiler design.

Uploaded by

animeshlego5
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
You are on page 1/ 23

Introduction to Automata

Theory

1
What is Automata Theory?
• Study of abstract computing devices, or “machines”
• Automaton = an abstract computing device

• A fundamental question in computer science:


– To find out what different models of machines can do and
what they cannot do
• The theory of computation

2
Alan Turing (1912-1954)
(A pioneer of automata theory)

• Father of Modern Computer Science


• English mathematician
• Studied abstract machines called Turing
machines even before computers existed

• Heard of the Turing test?

3
Formal Language and Automata
• Formal language
– a subset of the set of all possible strings from a set of
symbols
– example: the set of all syntactically correct C programs
• Automata
– abstract, mathematical model of computer
– examples: finite automata, pushdown automata Turing
machine, many others
• Let’s consider each of these in turn
Formal language
Alphabet = finite set of symbols or characters
examples: S = {a,b}, binary, ASCII

String = finite sequence of symbols from an alphabet


examples: aab, bbaba, also computer programs

A formal language is a set of strings over an alphabet


Examples of formal languages over alphabet S = {a, b}:

L1 = {aa, aba, aababa, aa}


L2 = {all strings containing just two a’s and any number of
b’s}

A formal language can be finite or infinite.


Alphabets

• An alphabet is a finite set of symbols.


• Usually, use S to represent an alphabet.
• Examples:
S = {0,1}, the set of binary digits.
S = {a, b, … , z}, the set of all lower-case letters.
S = {(, )}, the set of open and close parentheses.
Strings
• A string is a finite sequence of symbols from
an alphabet.
• Examples:
– 0011 and 11 are strings from S = {0,1}
– abc and bbb are strings from S = {a, b, … , z}
– (()(())) and )(() are strings from S = {(, )}
Strings
• Empty string: 
• Length of string: |0010| = 4, |aa| = 2, ||=0
• Prefix of string: aaabc, aaabc, aaabc
• Suffix of string: aaabc, aaabc, aaabc
• Substring of string: aaabc, aaabc, aaabc
Strings

• Concatenation: =abd, =ce, =abdce


• Exponentiation: =abd, 3=abdabdabd, 0=
• Reversal: =abd, R = dba
• Sk = set of all k-length strings formed by the
symbols in S
e.g., S={a,b}, S2={ab, ba, aa, bb}, S0={}
Strings

• Kleene Closure S* = S0S1S2… = k0 Sk


e.g., S={a, b}, S* = {, a, b, ab, aa, ba, bb, aaa,
aab, abb, … } is the set of all strings formed
by a’s and b’s.
• S+ = S1S2S3… = k>0 Sk
i.e., S* without the empty string.
• S+ = S* - {}
Strings (continued)
We often use string variables; u = aab, v = bbaba

Operations on strings:
length: |u| = 3
reversal: uR = baa
concatenation: uv = aabbbaba

The empty string, denoted  (or  somewhere)


has some special properties:
||=0
w=w =w
Strings (continued)
If w is a string, then wn stands for the string
obtained by repeating w n times.
w0 = 
Some questions

• What is {, 01, 001}  {, 00, 10}?


• What is the concatenation of {0, 11, 010}
and {, 10, 010}?
• What are the 5 shortest strings in the
language {0i1i | i  0}?
• What is the powerset {a, b, ab}?
Languages
• A language is a set of strings over an alphabet.
Eg:
– S={(, )}, L1={(), )(, (())} is a language over S.
• The set L2 of all strings with balanced left and right parentheses is also
a language over S.

– S={a, b, c, … , z}, the set L of all legal English words is a


language over S.

– The set {} is a language over any alphabet.

What is the difference between  and {}?


• L0 = {}
• L1 = L
Languages

• Other Examples:
– S={0, 1}, L={0n1n | n1} is a language over S consisting
of the strings {01, 0011, 000111, … }

– S={0, 1}, L = {0i1j | ji0} is a language over S


consisting of the strings with some 0’s (possibly none)
followed by at least as many 1’s.
Operations on languages
Set operations:
L1  L2 = {x | x  L1 or x  L2} is union
L1  L2 = {x | x  L1 and x  L2} is intersection
L1 - L2 = {x | x  L1 and x  L2} is difference
L = S* - L is complement
L1  L2 = (L1 - L2)  (L2 - L1) is “symmetric difference”

String operations:
LR = {wR | w  L} is “reverse of language”
L1L2 = {xy | x  L1, y  L2} is “concatenation of languages”
L* = {x = x1…xk | k  0 and x1, …, xk  L} =
L0  L1  L2 . . . . is “Kleene star” or "star closure"
L+ = L1  L2 . . . . is positive closure
Problems
• In automata theory, a problem is to decide
whether a given string is a member of some
particular language.
Why Automata Theory?
To study abstract computing devices which are
closely related to today’s computers. A simple
example of finite state machine:

start off on

There are many different kinds of machines.


Another Example

0 0

start off off on


1 0

When will this be on?


Try 100, 1001, 1000, 111, 00, …
Hierarchy of languages

Non-Recursively Enumerable Languages

Recursively Enumerable Languages

Recursive Languages

Context-Free Languages

Regular Languages

20
Finite automata
• Developed in 1940’s and 1950’s for neural net models of
brain and computer hardware design
• Finite memory!
• Many applications:
– text-editing software: search and replace
– many forms of pattern-recognition (including use in WWW
search engines)
– compilers: recognizing keywords (lexical analysis)
– sequential circuit design
– software specification and design
– communications protocols
SUMMARY
• Symbol – An atomic unit, such as a digit, character, lower-case letter, etc.
Sometimes a word. [Formal language does not deal with the “meaning” of the
symbols.]

• Alphabet – A finite set of symbols, usually denoted by Σ.


Σ = {0, 1} Σ = {0, a, , 4} Σ = {a, b, c, d}

• String – A finite length sequence of symbols, presumably from some alphabet.


w = 0110 y = 0aa x = aabcaa z = 111

special string: ε (also denoted by λ)

concatenation: wz = 0110111
length: |w| = 4 |ε| = 0 |x| = 6
reversal: yR = aa0
SUMMARY (Contd.)
• Some special sets of strings:
Σ* All strings of symbols from Σ
Σ+ Σ* - {ε}

• Example:
Σ = {0, 1}
Σ* = {ε, 0, 1, 00, 01, 10, 11, 000, 001,…}
Σ+ = {0, 1, 00, 01, 10, 11, 000, 001,…}

• A (formal) language is:


1) A set of strings from some alphabet (finite or infinite)., in other
words
2) Any subset L of Σ*

• Some special languages:


{} The empty set/language, containing no strings
{ε} A language containing one string, the empty string.

You might also like