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

Lecture 02

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 26

Theory Of Automata

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 Σ*

 It contains infinite words, however each word


has finite length.

4
Examples
 If Σ = {x}
Then Σ* = {Λ, x, xx, xxx, xxxx, ….}
 If Σ = {0,1}

Then Σ* = {Λ, 0, 1, 00, 01, 10, 11, ….}


 If Σ = {aaB, c}

Then Σ* = {Λ ,aaB, c, aaBaaB, aaBc, caaB,


cc, ….}

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}

Then Σ+ = { 0, 1, 00, 01, 10, 11, ….}


 If Σ = {aaB, c}

Then Σ+ = {aaB, c, aaBaaB, aaBc, caaB,


cc, ….}

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 ….}

 Strings of b will not get chance to come

If Σ = {a,b}
 Σ = { a, b, aa, bb, aaa, bbb, aaaa, bbbb, aaaaa ….}

 Strings with a lexicographic order

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?

 For every language rules are defined


 We can say that language is already defined
 Automata accepts/rejects input ,according to

the predefined rules.

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

imposed on its strings/words.


 The language and its associated conditions

are defined in plain English.


 This way is semi-formal way with chances of

ambiguity.

Language name = {define equation here}

16
Example :
Define a language which should not start with
zero finite string.

L1= {Any finite string of letters that doesn’t


start with letter zero}

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

L={b, c, ba, bb, bc, ca, cb, cc, …}

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

 The language consisting of Λ and the


strings s defined over Σ such that Rev(s)=s.
 It is to be denoted that the words of

PALINDROME are called palindromes.

20
Example:
 For Σ={a,b},
 PALINDROME={Λ , a, b, aa, bb, aaa, aba, bab,
bbb, ...}

 Null string is also a palindrome

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.

Rule 2: If x is in INTEGER then x+1 and x-1


are also in INTEGER.

Rule 3: No strings except those constructed


in above, are allowed to be 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

Rule 2: (a)s(b) and (b)s(a) are also in L, where s


belongs to Σ*

Rule 3: No strings except those constructed in


above, are allowed to be 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

You might also like