Lec 01-Introduction Lec 01-IntroductionLec 01-Introduction

msazeem77 33 views 29 slides Mar 05, 2025
Slide 1
Slide 1 of 29
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29

About This Presentation

Theory Of Automata


Slide Content

Lecture 01: Theory of Automata
Theory of Automata

Lecture 01: Theory of Automata
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

Lecture 01: Theory of Automata
3
Background
•We shall form several mathematical models that will
describe with varying degrees of accuracy parts of
computers, types of computers, and similar machines.
•In particular, the way we shall be studying about
computers is to build mathematical models, called
machines, and then to study their limitations by
analyzing the types of inputs on which they can operate
successfully.
•The collection of these successful inputs is called the
language of the machine.

Lecture 01: Theory of Automata
4
•Every time we introduce a new machine, we will learn its
language; and every time we develop a new language, we
will try to find a machine that corresponds to it.
•This interplay between languages and machines will be our
way of investigating problems and their potential solutions
by automatic procedures, which we call algorithms.
•We will study different types of theoretical machines that
are mathematical models for actual physical processes. By
considering the possible inputs on which these machines
can work, we can analyze their various strengths and
weaknesses.

Lecture 01: Theory of Automata
5
We are obliged to prove the truth about whatever we
discover.
•So consider only question of whether certain tasks can
be done at all. Conclusion are of the form “this can be
done” or “this can never be done”.
•When reach conclusions of the second type, we mean
not just that techniques for performing these tasks are
unknown at the present time, but that such techniques
will never exist in the future.
What is mathematical about the
models?

Lecture 01: Theory of Automata
6
•We will arrive at what we may believe to be the most
powerful machine possible. When we do, we will be
surprised to find tasks that even such machine cannot
perform.
•Our ultimate result is that no matter what machine we
build, there will always be questions that are simple to
state and that the machine can not answer.

Lecture 01: Theory of Automata
7
What does automata mean?
It is the plural of automaton, and it means
“something that works automatically”

Lecture 01: Theory of Automata
8
Languages
•In English, we distinguish 3 different entities: letters,
words, and sentences.
–Groups of letters make up words and groups of words
make up sentences.
–However, not all collections of letters form valid words, and
not all collections of words form valid sentences.
•This situation also exists with computer languages.
–Certain (but not all) strings of characters are recognizable
words (e.g., IF, ELSE, FOR, WHILE …); and certain (but
not all) strings of words are recognizable commands.

Lecture 01: Theory of Automata
9
•To construct a general theory of formal languages, we
need to have a definition of a language structure, in
which the decision of whether a given string of units
constitutes a valid larger unit is not a matter of
guesswork, but is based on explicitly stated rules.
•In this model, language will be considered as symbols
with formal rules, and not as expressions of ideas in the
minds of humans.
•The term “formal” emphasizes that it is the form of the
string of symbols that we are interested in, not the
meaning.

Lecture 01: Theory of Automata
10
•A finite non-empty set of symbols (letters), is
called an
alphabet. It is denoted by Σ ( Greek letter
sigma).
Example:
Σ={a,b}
Σ={0,1} //important as this is the language
//which the computer understands.
Σ={i,j,k}
Basic Definitions

Lecture 01: Theory of Automata
11
Strings
Concatenation of finite symbols from the
alphabet is called a string.
•Example:
If Σ= {a,b} then
a, abab, aaabb, ababababababababab

Lecture 01: Theory of Automata
12
Words
•Words are strings belonging to some language.
Example:
If Σ= {x} then a language L can be defined as
L={x
n
: n=1,2,3,…..} or L={x,xx,xxx,….}
Here x,xx,… are the words of L
•All words are strings, but not all strings are words.

Lecture 01: Theory of Automata
13
•We shall allow a string to have no letters. We call this
empty string or null string, and denote it by the symbol
Λ (Capital Greek Lambda).
•For all languages, the null word, if it is a word in the
language, is the word that has no letters. We also denote
the null word by Λ.
•Two words are considered the same if all their letters are
the same and in the same order.
•For clarity, we usually do not allow the symbol Λ to be
part of the alphabet of any language.
EMPTY STRING or NULL STRING

Lecture 01: Theory of Automata
14
•The language that has no words is denoted by the
standard symbol for null set, ø.
•It is not true that Λ is a word in the language ø since this
language has no words at all.
•If a certain language L does not contain the word Λ and
we wish to add it to L, we use the operation “+” to form L +
{Λ}. This language is not the same as L.
•However, the language L + ø is the same as L since no
new words have been added.
Discussion of null

Lecture 01: Theory of Automata
15
Introduction to Defining Languages
•The rules for defining a language can be of two kinds:
–They can tell us how to test if a string of alphabet letters is a
valid word, or
–They can tell us how to construct all the words in the language
by some clear procedures.

Lecture 01: Theory of Automata
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) etc.
•Descriptive definition of language
–The language is defined, describing the conditions
imposed on its words.
16

Lecture 01: Theory of Automata
17
•Example: Consider this alphabet with only one letter
∑ = { x }
•We can define a language by saying that any nonempty
string of alphabet letters is a word
L
1 = { x, xx, xxx, xxxx, … } or
L
1 = { x
n
for n = 1, 2, 3, … }
Note that because of the way we have defined it, the
language L
1 does not include the null word Λ.
Defining Languages

Lecture 01: Theory of Automata
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, …}

Lecture 01: Theory of Automata
19
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}
•Example:
The language L of strings ending in 0,
defined over Σ ={0,1}, can be written as
L={0,00,10,000,010,100,110,…}

Lecture 01: Theory of Automata
20
Example
•The language EQUAL, of strings with number of
a’s equal to number of b’s, defined over Σ={a,b},
can be written as
{Λ ,ab,aabb,abab,baba,abba,…}
•The language EVEN-EVEN, of strings with even
number of a’s and even number of b’s, defined
over Σ={a,b}, can be written as
{Λ, aa, bb, aaaa,aabb,abab, abba, baab, baba,
bbaa, bbbb,…}

Lecture 01: Theory of Automata
Example
•The language {a
n
b
n
}, of strings defined over
Σ={a,b}, as
{an bn : n=1,2,3,…}, can be written as
{ab, aabb, aaabbb,aaaabbbb,…}
•The language {a
n
b
n
a
n
}, of strings defined over
Σ={a,b}, as
{an bn an: n=1,2,3,…}, can be written as
{aba, aabbaa, aaabbbaaa,aaaabbbbaaaa,…}
21

Lecture 01: Theory of Automata
Example
•The language FACTORIAL, of strings defined
over Σ= {a}, as
{a
n
! : n=1,2,3,…}, can be written as
{a,aa,aaaaaa,…}. It is to be noted that the
language FACTORIAL can be defined over any
single letter alphabet.
•The language DOUBLEFACTORIAL, of strings
defined over Σ= {a, b}, as
{a
n!
b
n!
: n=1,2,3,…}, can be written as
{ab, aabb, aaaaaabbbbbb,…}
22

Lecture 01: Theory of Automata
23
•Let us define an operation, concatenation, in which two strings are
written down side by side to form a new longer string.
xxx concatenated with xx is the word xxxxx
x
n
concatenated with x
m
is the word x
n+m
•For convenience, we may label a word in a given language by a new
symbol. For example,
xxx is called a, and xx is called b
•Then to denote the word formed by concatenating a and b, we can
write
ab = xxxxx
•It is not true that when two words are concatenated, they produce
another word. For example, if the language is
L
2 = {x, xxx, xxxxx, …} = {x
2n+1
for n = 0, 1, 2, …}
then a = xxx and b = xxxxx are both words in L
2, but their
concatenation ab = xxxxxxxx is not in L
2
Concatenation

Lecture 01: Theory of Automata
24
•Note that in this simple example, we have:
ab = ba
But in general, this relationship does NOT hold for all
languages (e.g., houseboat and boathouse are two
different words in English).
•Example: Consider another language by beginning with
the alphabet
∑ = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
Define the language
L
3
= { any finite string of alphabet letters that does not
start with the letter zero }
Concatenation makes new Words?

Lecture 01: Theory of Automata
25
•This language L
3
looks like the set of positive integers:
L
3
= { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, … }
•If we want to define L3 so that it includes the string
(word) 0, we could say
L
3
= { any finite string of alphabet letters that, if it starts
with a 0, has no more letters after the first}

Lecture 01: Theory of Automata
26
Definition: Length
•We define the function length of a string to be the
number of letters in the string.
•Example:
–If a = xxxx in the language L
1, then length(a) = 4
–If c = 428 in the language L
3
, then length(c) = 3
–If d = 0 in the language L
3, then length(d) = 1
–In any language that includes the null word Λ, then
length(Λ) = 0
•For any word w in any language, if length(w) = 0 then w =
Λ.

Lecture 01: Theory of Automata
27
•Recall that the language L
1
does not contain the null
string Λ. Let us define a language like L
1 but that does
contain Λ:
L
4
= { Λ, x, xx, xxx, xxxx, … }
= { x
n
for n = 0, 1, 2, 3, … }
•Here we have defined that
x
0
= Λ (NOT x
0
= 1 as in algebra)
•In this way, x
n
always means the string of n alphabet
letters x’s.
•Remember that even Λ is a word in the language, it is
not a letter in the alphabet.

Lecture 01: Theory of Automata
28
Definition: Reverse
•If a is a word in some language L, then reverse(a) is the
same string of letters spelled backward, even if this
backward string is not a word in L.
•Example:
–reverse(xxx) = xxx
–reverse(145) = 541
–Note that 140 is a word in L
3, but reverse(140) = 041 is NOT a
word in L
3

Lecture 01: Theory of Automata
•Useful Reading
First and second chapter of Daniel I. Cohen book.
29
Tags