Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.

Slides:



Advertisements
Similar presentations
Lecture 9,10 Theory of AUTOMATA
Advertisements

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.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
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.
L ECTURE 2 Chapter 3 Recursive Definitions. R ECURSIVE D EFINITION It is method of defining sets.
Second lecture REGULAR EXPRESSION. Regular Expression.
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.
Formal Methods in SE Theory of Automata Qasiar Javaid Assistant Professor Lecture # 06.
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.
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.
Recursive Definitions & Regular Expressions (RE)
Lecture 02: Theory of Automata:08 Theory of Automata.
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.
Lecture 2 Theory of AUTOMATA
Lecture 02: Theory of Automata:2014 Asif Nawaz Theory of Automata.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
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.
Page 1. 1)Let B n = { a k | where k is a multiple of n}. I.e. B 1 = { a k | where k is a multiple of 1} = { a k | k Є {0,1,2,3,…}} = {‘’, a, aa, aaa, aaaa,
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 #
Lecture # 2.
Regular Languages, Regular Operations, Closure
Theory of Automata Course: Theory of Automata
Recap lecture 33 Example of trees, Polish Notation, examples, Ambiguous CFG, example,
Theory of Automata.
Regular Expressions (Examples)
LANGUAGES Prepared by: Paridah Samsuri Dept. of Software Engineering
Lecture 9 Theory of AUTOMATA
CSC312 Automata Theory Lecture # 4 Languages-III.
Non-deterministic Finite Automata (NFA)
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.
Kleene’s Theorem Muhammad Arif 12/6/2018.
Pumping Lemma.
CSE322 Regular Expressions and their Identities
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 18 NFA corresponding to union of FAs,example, NFA corresponding to concatenation of FAs,examples, NFA corresponding to closure of an FA,examples.
Recap lecture 37 New format for FAs, input TAPE, START, ACCEPT , REJECT, READ states Examples of New Format of FAs, PUSHDOWN STACK , PUSH and POP states,
Lecture # 13.
Recap Lecture 17 converting NFA to FA (method 3), example, NFA and Kleene’s theorem method 1, examples, NFA and Kleene’s theorem method 2 , NFA corresponding.
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.
Recap lecture 19 NFA corresponding to Closure of FA, Examples, Memory required to recognize a language, Example, Distinguishing one string from another,
RECAP Lecture 7 FA of EVEN EVEN, FA corresponding to finite languages(using both methods), Transition graphs.
Recap lecture 23 Mealy machines in terms of sequential circuit.
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.
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.
Recap Lecture 4 Regular expression of EVEN-EVEN language, Difference between a* + b* and (a+b)*, Equivalent regular expressions; sum, product and closure.
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:

Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings (i) ending in a, (ii) beginning and ending in same letters, (iii) containing aa or bb (iv)containing exactly aa,

Task Q) Let S={ab, bb} and T={ab, bb, bbbb} Show that S* = T* [Hint S*  T* and T*  S*] 2) Let S={ab, bb} and T={ab, bb, bbb} Show that S* ≠ T* But S*  T* Solution: Since S  T , so every string belonging to S* , also belongs to T* but bbb is a string belongs to T* but does not belong to S*.

Solution: consider S={Λ,a} then Task Q1)Is there any case when S+ contains Λ? If yes then justify your answer. Solution: consider S={Λ,a} then S+ ={Λ, a, aa, aaa, …} Here Λ is in S+ as member of S. Thus Λ will be in S+ , in this case.

Q2) Prove that for any set of strings S Solution: In general Λ is not in S+ , while Λ does belong to S*. Obviously Λ will now be in (S+)*, while (S*)* and S* generate the same set of strings. Hence (S+)*=(S*)*.

Q2) continued… ii) (S+)+=S+ Solution: since S+ generates all possible strings that can be obtained by concatenating the strings of S, so (S+)+ generates all possible strings that can be obtained by concatenating the strings of S+ , will not generate any new string. Hence (S+)+=S+

Q2) continued… Is (S*)+=(S+)* Solution: since Λ belongs to S* ,so Λ will belong to (S*)+ as member of S* .Moreover Λ may not belong to S+, in general, while Λ will automatically belong to (S+)*. Hence (S*)+=(S+)*

Regular Expression As discussed earlier that a* generates Λ, a, aa, aaa, … and a+ generates a, aa, aaa, aaaa, …, so the language L1 = {Λ, a, aa, aaa, …} and L2 = {a, aa, aaa, aaaa, …} can simply be expressed by a* and a+, respectively. a* and a+ are called the regular expressions (RE) for L1 and L2 respectively. Note: a+, aa* and a*a generate L2.

Defining Languages (continued)… Method 3 (Regular Expressions) Consider the language L={Λ, x, xx, xxx,…} of strings, defined over Σ = {x}. We can write this language as the Kleene star closure of alphabet Σ or L=Σ*={x}* this language can also be expressed by the regular expression x*. Similarly the language L={x, xx, xxx,…}, defined over Σ = {x}, can be expressed by the regular expression x+.

Now consider another language L, consisting of all possible strings, defined over Σ = {a, b}. This language can also be expressed by the regular expression (a + b)*. Now consider another language L, of strings having exactly double a, defined over Σ = {a, b}, then it’s regular expression may be b*aab*

Now consider another language L, of even length, defined over Σ = {a, b}, then it’s regular expression may be ((a+b)(a+b))* Now consider another language L, of odd length, defined over Σ = {a, b}, then it’s regular expression may be (a+b)((a+b)(a+b))* or ((a+b)(a+b))*(a+b)

Remark It may be noted that a language may be expressed by more than one regular expressions, while given a regular expression there exist a unique language generated by that regular expression.

Consider the language, defined over Example: Consider the language, defined over Σ={a , b} of words having at least one a, may be expressed by a regular expression (a+b)*a(a+b)*. Σ = {a, b} of words having at least one a and one b, may be expressed by a regular expression (a+b)*a(a+b)*b(a+b)*+ (a+b)*b(a+b)*a(a+b)*.

Consider the language, defined over Σ={a, b}, of words starting with double a and ending in double b then its regular expression may be aa(a+b)*bb Σ={a, b} of words starting with a and ending in b OR starting with b and ending in a, then its regular expression may be a(a+b)*b+b(a+b)*a

TASK Consider the language, defined over Σ={a, b} of words beginning with a, then its regular expression may be ? Σ={a, b} of words beginning and ending in same letter, then its regular expression may be ?

TASK Consider the language, defined over Σ={a, b} of words ending in b, then its regular expression may be ? Σ={a, b} of words not ending in a, then its regular expression may be ?

SummingUP Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of strings of even length, Language of strings of odd length, RE defines unique language (as Remark), Language of strings having at least one a, Language of strings havgin at least one a and one b, Language of strings starting with aa and ending in bb, Language of strings starting with and ending in different letters.