Lecture # 2.

Slides:



Advertisements
Similar presentations
L ECTURE 3 T HEORY OF AUTOMATA. E QUIVALENT R EGULAR E XPRESSIONS Definition Two regular expressions are said to be equivalent if they generate the same.
Advertisements

YES-NO machines Finite State Automata as language recognizers.
Regular Grammars Formal definition of a regular expression.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Strings and Languages Operations
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
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,
L ECTURE 2 Chapter 3 Recursive Definitions. R ECURSIVE D EFINITION It is method of defining sets.
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.
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.
Introduction to Theory of Automata
Two examples English-Words English-Sentences alphabet S ={a,b,c,d,…}
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.
Lecture # 3 Regular Expressions 1. Introduction In computing, a regular expression provides a concise and flexible means to "match" (specify and recognize)
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.
Introduction to Theory of Automata By: Wasim Ahmad Khan.
Recursive Definitions & Regular Expressions (RE)
Regular Expressions and Languages A regular expression is a notation to represent languages, i.e. a set of strings, where the set is either finite or contains.
Lecture 02: Theory of Automata:08 Theory of Automata.
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
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.
CS 203: Introduction to Formal Languages and Automata
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.
Lecture 2 Theory of AUTOMATA
1 Strings and Languages Lecture 2-3 Ref. Handout p12-17.
Lecture 02: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
L ANGUAGE C ONCEPTS : F ORMAL M ODEL FOR L ANGUAGES Theory of Computer Akram Salah.
L ECTURE 3 T HEORY OF AUTOMATA. E QUIVALENT R EGULAR E XPRESSIONS Definition Two regular expressions are said to be equivalent if they generate the same.
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.
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.
Recap lecture 5 Different notations of transition diagrams, languages of strings of even length, Odd length, starting with b, ending in a (with different.
Pumping Lemma.
Theory of Computation Lecture #
Language Theory Module 03.1 COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez.
Regular Languages, Regular Operations, Closure
LANGUAGES Prepared by: Paridah Samsuri Dept. of Software Engineering
Lecture 9 Theory of AUTOMATA
COP4620 – Programming Language Translators Dr. Manuel E. Bermudez
CSC312 Automata Theory Lecture # 4 Languages-III.
Recap lecture 29 Example of prefixes of a language, Theorem: pref(Q in R) is regular, proof, example, Decidablity, deciding whether two languages are equivalent.
Pumping Lemma.
Recap Lecture 16 Examples of Kleene’s theorem part III (method 3), NFA, examples, avoiding loop using NFA, example, converting FA to NFA, examples, applying.
Recap lecture 10 Definition of GTG, examples of GTG accepting the languages of strings:containing aa or bb, beginning with and ending in same letters,
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
Recap lecture 25 Intersection of two regular languages is regular, examples, non regular languages, example.
RECAP Lecture 7 FA of EVEN EVEN, FA corresponding to finite languages(using both methods), Transition graphs.
Recap Lecture 15 Examples of Kleene’s theorem part III (method 3), NFA, examples, avoiding loop using NFA, example, converting FA to NFA, examples, applying.
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
CSC312 Automata Theory Lecture # 2 Languages.
CSC312 Automata Theory Lecture # 3 Languages-II.
Welcome to ! Theory Of Automata Irum Feroz
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.
LECTURE # 07.
Presentation transcript:

Lecture # 2

An Important language 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. 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

To calculate the number of palindromes of length (2n), consider the following diagram,

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.

To calculate the number of palindromes of length (2n-1) with ‘a’ as the middle letter, consider the following diagram,

which shows that there are as many palindromes of length 2n-1 as there are the strings of length n-1 i.e. the required number of palindromes are 2n-1. Similarly the number of palindromes of length 2n-1, with ‘ b ’ as middle letter, will be 2n-1 as well. Hence the total number of palindromes of length 2n-1 will be 2n-1 + 2n-1 = 2 (2n-1)= 2n .

Kleene Star Closure Given Σ, then the Kleene Star Closure of the alphabet Σ, denoted by Σ*, is the collection of all strings defined over Σ, including Λ. It is to be noted that Kleene Star Closure can be defined over any set of strings.

Examples If Σ = {x} Then Σ* = {Λ, x, xx, xxx, xxxx, ….} If Σ = {0,1} If Σ = {aaB, c} Then Σ* = {Λ, aaB, c, aaBaaB, aaBc, caaB, cc, ….}

Note Languages generated by Kleene Star Closure of set of strings, are infinite languages. (By infinite language, it is supposed that the language contains infinite many words, each of finite length).

PLUS Operation (+) Plus Operation is same as Kleene Star Closure except that it does not generate Λ (null string), automatically. Example: If Σ = {0,1} Then Σ+ = {0, 1, 00, 01, 10, 11, ….} If Σ = {aab, c} Then Σ+ = {aab, c, aabaab, aabc, caab, cc, ….}

TASK Q1)Is there any case when S+ contains Λ? If yes then justify your answer.

Remark It is to be noted that Kleene Star can also be operated on any string i.e. a* can be considered to be all possible strings defined over {a}, which shows that a* generates Λ, a, aa, aaa, … It may also be noted that a+ can be considered to be all possible non empty strings defined over {a}, which shows that a+ generates a, aa, aaa, aaaa, …

Defining Languages Continued… Recursive definition of languages: The following three steps are used in recursive definition Some basic words are specified in the language. Rules for constructing more words are defined in the language. No strings except those constructed in above, are allowed to be in the language.

Example Defining language of INTEGER Step 1: 1 is in INTEGER. Step 2: If x is in INTEGER then x+1 and x-1 are also in INTEGER. Step 3: No strings except those constructed in above, are allowed to be in INTEGER.

Example Defining language of EVEN Step 1: 2 is in EVEN. Step 2: If x is in EVEN then x+2 and x-2 are also in EVEN. Step 3: No strings except those constructed in above, are allowed to be in EVEN.

Example Defining the language factorial Step 1: As 0!=1, so 1 is in factorial. Step 2: n!=n*(n-1)! is in factorial. Step 3: No strings except those constructed in above, are allowed to be in factorial.

Thank You…