Theory Of Automata By Dr. MM Alam

Slides:



Advertisements
Similar presentations
Properties of Regular Languages
Advertisements

Theory Of Automata By Dr. MM Alam
Theory Of Automata By Dr. MM Alam
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
Lecture 1 String and Language. String string is a finite sequence of symbols. For example, string ( s, t, r, i, n, g) CS4384 ( C, S, 4, 3, 8) (1,
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Theory Of Automata By Dr. MM Alam
Lecture # 1 (Automata Theory)
Theory of Automata.
1 Welcome to ! Theory Of Automata. 2 Text and Reference Material 1.Introduction to Computer Theory, by Daniel I. Cohen, John Wiley and Sons, Inc., 1991,
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 7 1.
CSC312 Automata Theory Lecture # 2 Languages.
CSC312 Automata Theory Lecture # 2 Languages.
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 
Formal Methods in SE Theory of Automata Qasiar Javaid Assistant Professor Lecture # 06.
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
Two examples English-Words English-Sentences alphabet S ={a,b,c,d,…}
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Language Definitions Lecture # 2. Defining Languages The languages can be defined in different ways, such as Descriptive definition, Recursive definition,
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
1 Chapter 1 Introduction to the Theory of Computation.
Lecture # 3 Regular Expressions 1. Introduction In computing, a regular expression provides a concise and flexible means to "match" (specify and recognize)
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2006.
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
Lecture-2 Recap Lecture-1
L ECTURE 3 Chapter 4 Regular Expressions. I MPORTANT T ERMS Regular Expressions Regular Languages Finite Representations.
1 Module 14 Regular languages –Inductive definitions –Regular expressions syntax semantics.
Recursive Definitions & Regular Expressions (RE)
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
1 Recap lecture 27 Pumping lemma version II, proof, examples, Myhill Nerode theorem, examples.
Lecture 02: Theory of Automata:08 Theory of Automata.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010.
UNIT - 2.  A binary operation on a set combines two elements of the set to produce another element of the set. a*b  G,  a, b  G e.g. +, -, ,  are.
CSC312 Automata Theory Lecture # 3 Languages-II. Formal Language A formal language is a set of words—that is, strings of symbols drawn from a common alphabet.
Recursive Definations Regular Expressions Ch # 4 by Cohen
Lecture # Book Introduction to Theory of Computation by Anil Maheshwari Michiel Smid, 2014 “Introduction to computer theory” by Daniel I.A. Cohen.
Lecture # 4.
Mathematical Foundations of Computer Science Chapter 3: Regular Languages and Regular Grammars.
Lecture 2 Theory of AUTOMATA
Transparency No. 1 Formal Language and Automata Theory Homework 5.
Week 13 - Wednesday.  What did we talk about last time?  Exam 3  Before review:  Graphing functions  Rules for manipulating asymptotic bounds  Computing.
Lecture # 17 Theory Of Automata By Dr. MM Alam 1.
Lecture 02: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
CHAPTER TWO LANGUAGES By Dr Zalmiyah Zakaria.
Lecture # 8 (Transition Graphs). Example Consider the language L of strings, defined over Σ={a, b}, having (containing) triple a or triple b. Consider.
By Dr.Hamed Alrjoub. 1. Introduction to Computer Theory, by Daniel I. Cohen, John Wiley and Sons, Inc., 1991, Second Edition 2. Introduction to Languages.
Lecture 01: Theory of Automata:2013 Asif Nawaz Theory of Automata.
MA/CSSE 474 Theory of Computation Regular Expressions Intro.
Recap Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of.
Pumping Lemma.
Theory of Computation Lecture #
Lecture # 2.
Lecture 1 Theory of Automata
Formal Language & Automata Theory
Theory of Automata.
Regular Expressions (Examples)
LANGUAGES Prepared by: Paridah Samsuri Dept. of Software Engineering
CSC312 Automata Theory Lecture # 4 Languages-III.
Pumping Lemma.
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
Chapter 1 Introduction to the Theory of Computation
Recap lecture 11 Proof of Kleene’s theorem part II (method with different steps), particular examples of TGs to determine corresponding REs.
Recap lecture 25 Intersection of two regular languages is regular, examples, non regular languages, example.
CSC312 Automata Theory Lecture # 5 Chapter # 4 Cont…
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
CSC312 Automata Theory Lecture # 3 Languages-II.
Welcome to ! Theory Of Automata Irum Feroz
Presentation transcript:

Theory Of Automata By Dr. MM Alam Lecture # 3 Theory Of Automata By Dr. MM Alam

Lecture#2 Recap Kleene Closure Examples of Kleene Closure. Plus Operation

Prove that for all sets S, (i) (S+)* = (S*)* (ii) (S+)+ = S+ (iii) Is (S*)+ = (S+)* for all sets S? S+ = {all concatenations of words in S, excluding Λ}. (S+)* = {Λ and all concatenations of words in S+} = {Λ and all concatenations of (concatenations of words in S, excluding Λ)} = {Λ and all concatenations of words in S} = S*

S* = {Λ and all concatenations of words in S} = {Λ and all concatenations of (Λ and all concatenations of words in S)} = {Λ and all concatenations of words in S} = S* Therefore (S+)* = (S*)* = S*

(ii) (S+)+ = S+ S+ = {all concatenations of words in S, excluding Λ} (S+)+ = {all concatenations of words in S+, excluding Λ} = {all concatenations of (all concatenations of words in S, excluding Λ) excluding Λ)} = {all concatenations of words in S, excluding Λ} = S+

(iii) Is (S*)+ = (S+)* for all sets S? S* = {Λ and all concatenations of words in S} (S*)+ = {all concatenations of words in S*, but not Λ} S* already contains Λ, so (S*)+ contains Λ too, since it’s part of the language. No new words are added with the + operator, so (S*)+ = S*.

S+ = {all concatenations of words in S, without Λ} (S+)* = {Λ and all concatenations of words in S+} = {Λ and all concatenations of (all concatenations of words in S, not Λ)} = {Λ and all concatenations of words in S} = S* The external * operator only added Λ to the language. Therefore (S*)+ = (S+)* = S*.

Let S = {a, bb, bab, abaab}. Is abbabaabab in S. Is abaabbabbaab Let S = {a, bb, bab, abaab}. Is abbabaabab in S*? Is abaabbabbaab? Does any word in S* have an odd total number of b’s? (a)(bb)(abaab)ab can’t be factored into substrings from S, so it is not in the language. (abaab)(bab)b (a)(a)(bb) can’t be factored into substrings from S, so it’s not in the language. It is not possible to have an odd no of b’s. The reason is that even b’s +even b’s = even b’s

Suppose that for some language L we can always concatenate two words in L and get another word in L if and only if the words are not the same. That is, for any words w1 and w2 in L where w1 ≠ w2, the word w1w2 is in L but the word w1w1 is not in L. Prove that this cannot happen. w1 ∈ L and w2 ∈ L (2 different words) therefore (w1)(w2) ∈ L w1w2 ∈ L and w1 ∈ L (2 different words) therefore (w1w2)(w1) ∈ L w1w2w1 ∈ L and w2 ∈ L (2 different words) therefore (w1w2w1)(w2) ∈ L But (w1w2w1)(w2) can also be factored as: (w1w2)(w1w2), which are 2 equal factors / words, so this language can’t exist.

Let us define (S. ). = S. Is this set bigger than S Let us define (S**)* = S*** Is this set bigger than S*? Is it bigger than S? S*** is no bigger than S*. Both sets contain an infinite number of elements. S*** is bigger than S (if S is not {Λ}) because it is made up of all concatenations of elements in S.

(i) If S = {a b} and T. = S. , prove that T must contain S (i) If S = {a b} and T* = S*, prove that T must contain S. (ii) Find another pair of sets S and T such that if T* = S*, then S ⊂ T (i) S* = {Λ and all concatenations of a’s and b’s} = T*. This means that a ∈ T and b ∈ T. (The smallest words in S* and T*). T may contain other strings (only concatenations of a & b) and still have the same closure as S*, but it must have at least the elements of S (which are the smallest factors in the definition of S*), so T contains S.

(ii) Find another pair of sets S and T such that if T. = S (ii) Find another pair of sets S and T such that if T* = S*, then S ⊂ T T = {a, b, aa, abb} S ⊂ T S = {a b aa} Still S* = T* but S ⊂ T

Four different ways, in which a language can be defined So far, we have studied many languages like INTEGER, PRIME, PALINDROME etc., Now, we will take a detailed look at how a language can be defined in different ways. There are four ways that we will study in this course: Descriptive way Recursive way Regular Expression Finite Automata

Descriptive Definition of a Language The language and its associated conditions are defined in plain English. This way is semi-formal way with chances of ambiguity. Descriptive method is used in early phases of requirement engineering and resultant equations are then formally transformed using other methods.

Example: The language L of strings of even length, defined over Σ={b}, can be written as L={bb, bbbb, …..} 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, …}

Example: The language L of strings of length 3, defined over Σ={0,1,2}, can be written as L={000, 012, 022,101, 101,120,…} The language L of strings ending in 1, defined over Σ ={0,1}, can be written as L={1,001,101,0001,0101,1001,1101,…}

{Λ ,ab,aabb,abab,baba,abba,…} 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,…} Example: 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,…}

Example: The language INTEGER, of strings defined over Σ={-,0,1,2,3,4,5,6,7,8,9}, can be written as Example: The language EVEN, of stings defined over Σ={-,0,1,2,3,4,5,6,7,8,9}, can be written as EVEN = { …,-4,-2,0,2,4,…}

Example: The language {anbn }, of strings defined over Σ={a,b}, as {an bn : n=1,2,3,…}, can be written as {ab, aabb, aaabbb,aaaabbbb,…} Example: The language {anbncn }, of strings defined over Σ={a,b,c}, as {an bn cn: n=1,2,3,…}, can be written as {abc, aabbcc, aaabbbccc,aaaabbbbcccc,…}

Lecture#3 Summary Plus Operation Examples Four ways of defining languages Examples for Descriptive way of defining languages