l ecture 1 t heory of a utomata. p ragmatics pre-requisites no pre-requisite text book ...
TRANSCRIPT
![Page 1: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/1.jpg)
LECTURE 1THEORY OF
AUTOMATA
![Page 2: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/2.jpg)
PRAGMATICS
Pre-Requisites No Pre-Requisite
Text book Introduction to Computer Theory by Daniel I.A. Cohen
Quizzes Roughly once every two weeks
Marks Distribution
Theoretical Course
30% Mid-term, 40% Final, 15 % Quizzes, 15 % assignments and class behaviour
![Page 3: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/3.jpg)
COURSE OBJECTIVES
The major objective of this course is to introduce the student to the concepts of theory of automata in computer science. The student should acquire insights into the relationship among formal languages, formal grammars, and automata.
Upon successful completion of this course, students will be able to:
Understand the equivalence between Nondeterministic Finite State Automata and Deterministic Finite State Automata.
Understand the equivalence between Context-Free Grammars and Nondeterministic Pushdown Automata.
Appreciate the power of the Turing Machine, as an abstract automaton, that describes computation, effectively and
efficiently.
![Page 4: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/4.jpg)
WHAT DOES “AUTOMATA” MEAN?
It is the plural of automaton, and it means “something that works automatically”
![Page 5: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/5.jpg)
AUTOMATA THEORY
Deals with the definitions and properties of mathematical model of computation.
Examples: Finite automata, Context free grammars.
Finite Automaton: Text Processing, Compilers
Context Free grammars: Programming languages, AI
![Page 6: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/6.jpg)
SETS
A set is a group of objects, called elements (or members) of this set. For example, the students in this room form a set.
A set can be defined by listing all its elements inside braces, e.g.:
S ={ 7,21,57} The order of elements in sets do not
matter – in particular, S={7,21,57} = {21,57,7}
![Page 7: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/7.jpg)
SETS CONTINUED…
The membership is denoted by ϵ symbol. For example, 21 ϵ S but 10 not belong to S.
If every member of A is also a member of B. We say that A is a subset of B and if A is a subset of B but not equal to B then A is proper subset of B and write as
A B. If A is a subset of B and A is equal to B then A is improper subset of B and write as A B.
![Page 8: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/8.jpg)
EXAMPLES OF SETS
The set with no elements is called the empty set and denoted by Λ
The empty set is a subset of every set. The set of natural numbers N (or N): N = {1, 2, 3, . . .}
The set of integers Z (or Z): Z = {. . ., -2,-1, 0, 1, 2,…} It is clear that N subset of Z
![Page 9: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/9.jpg)
SET OPERATIONS
![Page 10: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/10.jpg)
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 …).
![Page 11: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/11.jpg)
BASIC DEFINITIONS
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}
![Page 12: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/12.jpg)
STRINGS
Concatenation of finite symbols from the alphabet is called a string.
Example:If Σ= {a,b} then
a, abab, aaabb, ababababababababab
![Page 13: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/13.jpg)
WORDS Words are strings belonging to some
language.
Example: If Σ= {x} then a language L can be
defined as L={xn : n=1,2,3,…..} or L={x,xx,xxx,….} Here x,xx,… are the words of L
![Page 14: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/14.jpg)
EMPTY STRING OR NULL STRING
We shall allow a string to have no letters. We call this empty string or null string, and denote it by the symbol Λ.
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 Λ.
![Page 15: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/15.jpg)
STRING OPERATIONS
m
n
bbbv
aaaw
21
21
bbbaaa
abba
mn bbbaaawv 2121
Concatenation
abbabbbaaa
![Page 16: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/16.jpg)
12aaaw nR
naaaw 21 ababaaabbb
Reverse
bbbaaababa
![Page 17: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/17.jpg)
STRING LENGTH
Length:
Examples:
naaaw 21nw
1
2
4
a
aa
abba
![Page 18: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/18.jpg)
DEFINING LANGUAGES
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
L1 = { x, xx, xxx, xxxx, … } or
L1 = { xn for n = 1, 2, 3, … }
Note that because of the way we have defined it, the language L1 does not include the null word Λ.
![Page 19: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/19.jpg)
EXAMPLE:
The language L of strings of odd length, defined over Σ={a}, can be written asL={a, aaa, aaaaa,…..}
Example:The language L of strings that does not start with a, defined over Σ={a,b,c}, can be written asL={b, c, ba, bb, bc, ca, cb, cc, …}
![Page 20: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/20.jpg)
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 asL={0,00,10,000,010,100,110,…}
![Page 21: L ECTURE 1 T HEORY OF A UTOMATA. P RAGMATICS Pre-Requisites No Pre-Requisite Text book Introduction to Computer Theory by Daniel I.A. Cohen](https://reader034.vdocuments.mx/reader034/viewer/2022051316/56649ea75503460f94ba945e/html5/thumbnails/21.jpg)
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,…}