0% found this document useful (0 votes)
10 views

lecture# 2 (2)

The document provides an overview of the Theory of Automata, which studies abstract machines to analyze computation capabilities and limitations. It covers key concepts such as empty strings, tokenization, formal and informal languages, and palindromes, along with examples and definitions of various languages. Additionally, it includes assignments related to defining different types of languages based on specified alphabets.

Uploaded by

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

lecture# 2 (2)

The document provides an overview of the Theory of Automata, which studies abstract machines to analyze computation capabilities and limitations. It covers key concepts such as empty strings, tokenization, formal and informal languages, and palindromes, along with examples and definitions of various languages. Additionally, it includes assignments related to defining different types of languages based on specified alphabets.

Uploaded by

farinasyeda11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

THEORY OF AUTOMATA

AND FORMAL
LANGUAGE

LECTURE#2
Text and reference material

1. Introduction to Computer Theory, by


Daniel I. Cohen, John Wiley and Sons,
Inc., 1991, Second Edition
2. Introduction to Languages and Theory of
Computation, by J. C. Martin, McGraw Hill
Book Co., 1997, Second Edition
What is theory of automata and 3

way we study it?

"Theory of Automata" is a branch of computer science


that studies abstract machines, called "automata," to
understand the capabilities and limitations of
computation by analyzing how these machines can
perform calculations based on a set of rules; essentially,
it's a way to model and analyze the behavior of
computing systems using mathematical models,
allowing us to explore what problems can be solved by
different types of computational devices and their
complexity.
4

What does automata


mean?

It is the plural of automaton, and it


means “something that works
automatically”
Empty string
An empty string is a string instance of zero
length, whereas a null string has no value at all.
An empty string is represented as "" . It is a
character sequence of zero characters.
• String that has no letters, also known as Null
string, donated with ^, λ, €
• Length is zero (0)
• All words are strings but not all strings are
words.
Tokenizing
Tokenization is a term that describes breaking a
document or body of text into small units called
tokens. You can define tokens by certain
character sequences, punctuation, or other
definitions depending on the type of
tokenization. Doing so makes it easier for a
machine to process the text.
Question :

∑={Aa,bab} and string is babaabab so find


length?

• Make token ?
• Length find ?
• Reverse find ?
• Is palindrome ?

 ∑(sigma)
Length of string
• Is a number of letters in a string , donated by |k|

• Example :- s = abab

|s|= 4
or
length (s)= 4
or
length (abab)= 4
9

Reverse of string
• is obtained by writing letters of
string in reverse order, donated by
Rev(s) or s® or Reverse(s)
Example :- s= abab , Rev(s)= baba,
Reverse(s)= baba
 ∑={aa,bab} and string is babaabab
so find length?
10

Power of Alphabet
Determined that the strings made from
alphabet will be of length equal to the power ^
of alphabet.

∑ = {a ,b }² {aa, ab, ba, bb}

Total number of length in alphabets= n^m

2^2
4
Introduction to languages 11

There are two types of languages

• Formal Languages (Syntactic


languages)
• Informal Languages (Semantic
languages)
Difference B/W Formal and informal languages

Formal language Informal language


• Make mathematical • Not make mathematical
model model
• Limited words • No limited words
• Follow rules • Increase according to time
• All computer languages period
are lies formal languages • All natural languages are
• It is also called syntactic lies
languages informal languages
• It is also called semantic
languages
13
Valid/in-valid alphabets
While defining an alphabet, an
alphabet may contain letters
consisting of group of symbols.
For example, Σ= {a ,b }
{a, b, ab, ba, aab, bba, aba,
abb……}
or
{A, aB, baa, abA…..}
An important language

• PALINDROME:
The language consisting of Λ and the strings s
defined over Σ such that Rev(s)=s.
babaabab= babaabab
It is to be denoted that the words of
PALINDROME are called palindromes.
• Example: For Σ={a,b},
PALINDROME={Λ , a, b, aa, bb, aaa, aba, bab,
bbb, ...}
Remark

• There are as many palindromes of


length 2n as there are of length 2n-1.
To prove the above remark, the
following is to be noted:
NOTE
• Number of strings of length ‘m’ defined over
alphabet of ‘n’ letters is nm.
• Examples:
• The language of strings of length 2, defined over
Σ={a,b} is L={aa, ab, ba, bb} i.e. number of strings =
22
• The language of strings of length 3, defined over
Σ={a,b} is L={aaa, aab, aba, baa, abb, bab, bba,
bbb} i.e. number of strings = 23
• which shows that there are as many palindromes of
length 2n as there are the strings of length n i.e. the
required number of palindromes are 2n.
17

Defining languages
The languages can be defined in different
ways , such as Descriptive definition,
Recursive definition, using Regular
Expressions(RE) and using Finite
Automaton(FA) , NFA, DFA etc.

Descriptive definition of language:


The language is defined, describing the
conditions imposed on its words.
18
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,
…}
19

Assignment:
-
1: The language of strings of length 2, defined over Σ={0,1,2}
2: The language of strings ending in 0, defined over Σ ={0,1}
3: The language EQUAL, of strings with number of a’s equal to
number of b’s, defined over Σ={a,b}
4: The language EVEN-EVEN, of strings with even number of a’s
and even number of b’s, defined over Σ={a,b}
5: The language INTEGER, of strings defined over
Σ={-,0,1,2,3,4,5,6,7,8,9}
6: The language EVEN, of stings defined over
Σ={-,0,1,2,3,4,5,6,7,8,9}
7: The language {anbn }, of strings defined over Σ={a,b}, as
{an bn : n=1,2,3,…}
20

8: The language {anbnan }, of strings defined over Σ={a,b}


9: The language factorial, of strings defined over
Σ={1,2,3,4,5,6,7,8,9…..}
10: The language DOUBLEFACTORIAL, of strings defined
over Σ={a, b}, as
{an!bn! : n=1,2,3,…}
11: The language SQUARE, of strings defined over Σ={a},
2
as an
12: The language DOUBLESQUARE, of strings defined over
2 2
Σ={a,b}, as a n b n
13: The language PRIME, of strings defined over Σ={a}, as
{ap : p is prime}
THANK YOU

Lecturer : Ms Fazeela Maryum

You might also like