Lecture 02
Lecture 02
Lecture 02
1
Lecture # 03/04
Theory of Automata
2
Revision
What is Automata and Automaton?
Application of Theory of Automata
What is a language?
Alphabets and Ambiguity
Words
Strings
Length of string
Reverse of string
Power of string and alphabet
3
Kleene Star Closure
It is undetermined power, represent infinite
number of terms can be made including
empty string.
Also known as Kleene Closure and Kleene
Operator.
It is denoted by Σ*
4
Examples
If Σ = {x}
Then Σ* = {Λ, x, xx, xxx, xxxx, ….}
If Σ = {0,1}
5
Kleene Plus
It is undetermined power, represent infinite
number of terms can be made except empty
string.
Also known as Kleene Positive and Positive
Closure.
It is denoted by Σ+
6
Examples
If Σ = {x}
Then Σ+ = { x, xx, xxx, xxxx, ….}
If Σ = {0,1}
7
Some more examples
8
Lexicographic Order
Method of sequencing a language in which
strings are grouped by their length.
Strings of shortest length will come first.
9
Example :
If Σ = {a,b}
Σ = { a, aa, aaa, aaaa,aaaaa ….}
If Σ = {a,b}
Σ = { a, b, aa, bb, aaa, bbb, aaaa, bbbb, aaaaa ….}
10
Types of Languages
Informal language (Talking languages)
Programming language
Formal Languages (Syntactic languages)
11
Informal Language
It studies purely semantic aspects of a
language .
Concern with the meaning
Formal Language
It studies purely syntactical aspects of a
language .
Concern with the rules /syntax and no
meaning
12
Example
1: work 2: wkro
Example 1 is but correct according to the
definition informal language,
Example 2 is correct according to the definition
of formal language.
13
How automata accept or reject an input?
How can automata know that the given string
is valid or not?
14
Defining Languages
The languages can be defined in different
ways , such as
1. Descriptive definition,
2. Recursive definition,
3. using Regular Expressions(RE) and
4. using Finite Automaton(FA) etc.
15
1:Descriptive Definition
One of the language defining method
In this method, simply describe condition
ambiguity.
16
Example :
Define a language which should not start with
zero finite string.
17
Example:
The language L of strings of odd length,
defined over Σ={a}, can be written as
L={a, aaa, aaaaa,…..}
Example:
The language L of strings that does not start
with a, defined over Σ={a,b,c}, can be written as
18
Example:
The language L of strings of length 2, defined over
Σ={0,1,2}, can be written as
L={00, 01, 02,10, 11,12,20,21,22}
19
Palindrome
20
Example:
For Σ={a,b},
PALINDROME={Λ , a, b, aa, bb, aaa, aba, bab,
bbb, ...}
21
2:Recursive Equation
One of the language defining method.
Fundamentally a three-step process
Rule#1:
Specify some basic objects in the set.
The number of basic objects specified must be
finite.
Some basic facts about the set are written.
22
Rule#2:
Give a finite number of basic rules for
constructing more objects in the set from the
ones we already know.
Rule#3:
Provide declaration that no objects except
those constructed in this way are allowed in
the set.
23
Examples
Defining language of INTEGER
Rule 1: 1 is in INTEGER.
24
Defining the language L, of strings beginning
and ending in different letters , defined over
Σ={a, b}
Rule 1: ab and ba are in L
25
Lecture Summary
Kleene Star Closure
Kleene Plus
Lexicographic order
Languages
Types of languages
Method of defining languages
Descriptive definition
Palindrome
Recursive way
26