Formal Languages, Automata and Models of Computation
|
|
- Coral Alexander
- 6 years ago
- Views:
Transcription
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University
2 Content - More Properties of Regular Languages (RL) - Standard Representations of RL - Elementary Questions about RL - Non-Regular Languages - The Pigeonhole Principle - The Pumping Lemma - Applications of the Pumping Lemma - NFA-DFA repetition 2
3 More Properties of Regular Languages 3
4 We have proven Regular languages g are closed under Union Concatenation Star operation Reverse 4
5 Namely, for regular languages L1 and L2 : Union Concatenation Star operation Reverse L1 L 2 L 1 L 2 L 1 R L 1 Regular Languages 5
6 We will prove Regular languages are also closed under Complement Intersection 6
7 Namely, for regular languages L1 and L2 : Complement L1 Intersection L1 L 2 Regular Languages 7
8 Complement Theorem For regular language L the complement L is regular Proof Take DFA that accepts L and exchange: non-final states final states non-accepting states accepting states Resulting DFA accepts L 8
9 Example a L = L( a * b) a,b b a, b q0 q1 q2 L = L ( a + a b ( a + b )( a + b ) a ) a, b b a, b q 0 q 1 q 2 9
10 Intersection Theorem e For regular languages L 1 and L 2 the intersection L1 L 2 is regular Proof Apply DeMorgan s Law: L1 L2 = L1 L 2 10
11 L 1, L 2 1, regular L 1, L 2 L1 L 2 L1 L 2 L1 L 2 regular regular regular regular 11
12 Standard Representations of Regular Languages 12
13 Regular Language Representations Regular Expression Regular Language DFA NFA Regular Grammar 13
14 Elementary Questions about Regular Languages 14
15 Membership Question Question: Given regular language L and string w how can we check if w L? Answer: Take the DFA that accepts L and check if w is accepted 15
16 DFA w w L DFA w w L 16
17 Question: Given regular language how can we check L ( L = ) L if is empty:? Answer: Take the DFA that accepts L Check if there is a path from the initial state to a final state 17
18 DFA L DFA L = 18
19 Question: Given regular language how can we check L if is finite? L Answer: Take the DFA that accepts Check if there is a walk with cycle from the initial iti state t to a final state t L 19
20 DFA L is infinite it DFA L is finite 20
21 Question: L L2 Given regular languages 1 and how can we check if L 1 = L 2? Answer: Find if ( L1 L2 ) ( L1 L2 ) = 21
22 ( 2 L1 L2 ) ( L1 L ) = L 1 L 2 = and L 1 L 2 = L 1 L2 L 2 L 2 1 L L1 L1 L 2 L2 L1 L = 1 L 2 22
23 ( 2 L1 L2 ) ( L1 L ) L 1 L 2 or L 1 L 2 L 1 L L 2 2 L1 L1 L 2 L2 L1 L 1 L 2 23
24 Non-Regular Languages 24
25 Non-regular languages??? Regular languages a *b b * c + a b + c ( a + b)* etc... 25
26 How can we prove that a language L is not regular? a a a λ b λ λ b b 26
27 How can we prove that a language L is not regular? Prove that there is no DFA that accepts L a a a Problem: this is not easy to prove Solution: the Pumping Lemma! λ λ λ b b L n n = { a b : n 0} b 27
28 The Pigeonhole Principle i 28
29 The Pigeonhole Principle 29
30 4 pigeons 3 pigeonholes 30
31 A pigeonhole must contain at least two pigeons pg 31
32 n pigeons... m pigeonholes n > m... 32
33 The Pigeonhole Principle n pigeons m pigeonholes n > m There is a pigeonhole with at least 2 pigeons... 33
34 The Pigeonhole Principle and DFAs 34
35 DFA with 4 states b b b a b q 1 q 2 q 3 q b q 4 a a 35
36 In walks of strings: b b a aa aab no state is repeated b a a q1 q2 q3 a b a q 4 36
37 In walks of strings: aabb a state bbaa abbabb abbbabbabb... is repeated b b b a a q1 q2 q3 b q 4 a a 37
38 w w 4 If the walk of string has length then a state is repeated b b b a a q1 q2 q3 a b a q 4 38
39 Pigeonhole principle for any DFA: If in a walk of a string transitions then a state is repeated w states of DFA 39
40 In other words for a string w a q transitions are pigeons states t are pigeonholes 40
41 In general A string w has length number of states A state q must be repeated in the walk of w walk of w q 41
42 The Pumping Lemma for Regular Languages see also 42
43 Take an infinite regular language g L DFA that accepts L n states 43
44 Take string w with w L There is a walk with label w... walk w 44
45 If string w has length w m = n + ( n number of states) then, from the pigeonhole principle: 1 a state q is repeated in the walk w q walk w 45
46 Write w = x y z y q x z 46
47 Lengths: x y m (from pigeon pg principle, p as q is the first repetition in sequence) y 1 (there is a walk in the graph) y... q... x z 47
48 Observation The string x z is accepted y q x z 48
49 Observation The string x y y z is accepted y q x z 49
50 Observation The string is accepted Th t i x y y y z y... q... x z 50
51 Generally The string x y i z is accepted i = 0,1, 2,... y q x z 51
52 The Pumping Lemma Given an infinite regular language L there exists an integer m for any string w L with length w m we can write w = x y z with x y m and y 1 such hthat: t i x y i z L i = 0,1, 2,... 52
53 Applications of the Pumping Lemma 53
54 Theorem The language L n n = { a b : n 0} is not regular Proof Use the Pumping Lemma! 54
55 L n n = { a b : n 0} Assume to the contrary, that L is a regular language L Since is infinite we can apply the Pumping Lemma 55
56 L n n = { a b : n 0} Let m be the integer in the Pumping Lemma Pick a string such that: w w L length w m e.g. pick m b m w = a 56
57 Write: a m b m = x y z From the Pumping Lemma it must be that length x y m, y 1 Therefore: a m m m b m = a... aa... a... ab... b x y z y k = a, k 1 57
58 We have: x y z = m b m a y k = a, k 1 From the Pumping Lemma: x y i z i = 0,1, 2,... L We can choose i = 0 w = a m k b m L CONTRADICTION! 58
59 Therefore: Our assumption that L is a regular language is not true Conclusion L is not a regular language END OF PROOF 59
60 Non-regular languages n n { a b : n 0} Regular languages a *b b * c + a b + c ( a + b)* etc... 60
61 Theorem The language L R = { ww : w Σ*} Σ = { a, b} is not regular Proof Use the Pumping Lemma! 61
62 L R = { ww : w Σ*} Assume to the contrary, L that is a regular language L Since is infinite we can apply the Pumping Lemma 62
63 L R = { ww : w Σ *} Let m be the integer in the Pumping Lemma Pick a string w such that: w L length w m pick w = a m b m b m a m 63
64 Write a m b m b m a m = x y z From the Pumping Lemma it must be that length x y m, y 1 a m b m b m a m = m m m m a... aa... a... ab... bb... ba... a y k = a, k 1 x y z 64
65 a m b m b m a m = m m m m a... aa... a... ab... bb... ba... a y k, 1 = a k x y z We can choose i = 0 m k So we get a s as on the left, while m is on the right: CONTRADICTION! 65
66 Therefore: Our assumption that L is a regular language is not true Conclusion L is not a regular language END OF PROOF 66
67 n Non-regular languages g n { a b : n 0} { ww R : w Σ*} Regular languages a *b b * c + a b + c ( a + b)* etc... 67
68 Theorem The language L n = { a b c : n, l is not regular l n+ l 0} Proof Use the Pumping Lemma 68
69 L n l n+ l = { a b c : n, l 0} Assume to the contrary that L is a regular language L Since is infinite we can apply the Pumping Lemma 69
70 L n l n+l = { a b c : n, l 0} Let m be the integer in the Pumping Lemma Pick a string such that: w w L length w m Pick m m 2 m 2 w = a b c 70
71 Write a m b m c 2m = x y z From the Pumping Lemma it must be that length x y m, y 1 a m m 2m b c = m m 2m a... aa... aa... ab... bc... cc... c y k = a, k 1 x y z 71
72 m m m c b a z y x 2 = We have:, 1 = k a y k From the Pumping Lemma L z y x i... 2, = 0,1, i Thus: L z y x 0 L c b a z x z y x m m k m = =
73 Therefore: a m k m 2m b c L BUT: L n l n+ l = { a b c : n, l 0} a m k m 2m b c L CONTRADICTION! 73
74 Therefore: Our assumption that L is a regular language is not true Conclusion L is not a regular language END OF PROOF 74
75 Non-regular languages g { ww R : w Σ*} n n { a b : n 0} n l n+ l { a b c : n, l 0} Regular languages 75
76 Theorem The language L n = { a! : n 0} is not regular n! = 1 2L ( n 1 ) n Proof Use the Pumping Lemma Factorial of n, (n!) is the product of all positive integers less than or equal to n. For example, 5! = 5 x 4 x 3 x 2 x 1 = 120 The value of 0! is 1. 76
77 L n = { a! : n 0} Assume to the contrary that L is a regular language L Since is infinite we can apply the Pumping Lemma 77
78 L n = { a! : n 0} Let m be the integer in the Pumping Lemma Pick a string ti w such hthat: t w L length w m Pick w = a m!! 78
79 Write a m! = x y z From the Pumping Lemma it must be that length x y m, y 1 m m!! m! = a m a... aa... aa... aa... aa... a x y z k y = a, 1 k m 79
80 We have: x y z = m! a k y = a, 1 k m From the Pumping Lemma: x y i z L i = 0,1, 2,... Thus: x y 2 z L x y 2 z = x y y z = a m!+ k L 80
81 Therefore: a m!+ k L 1 k m Since: L n = { a! : n 0} There is p m! + k = p!! 1 k m There is p 81
82 However for m > 1 m! +k m!+ m m!+ m! < m! m + m! = m! ( m + 1) = ( m +1)! m! < m! + k < ( m + 1)! m! + k p! for any p 82
83 Therefore: a m!+ k L BUT: L = { a! : n 0} n and 1 k m a m!+ k L CONTRADICTION! 83
84 Therefore: Our assumption that L is a regular language is not true Conclusion L is not a regular language END OF PROOF 84
85 Non-regular languages { ww R : w Σ*} { a b : n 0} n n n l n+ l { a b c : n, l 0} { a n! : n 0} Regular languages 85
86 Theorem The language L = i { a : i prime } is not regular Proof Use the Pumping Lemma 86
87 L = i { a : i prime } Assume to the contrary that L is a regular language Since is infinite L we can apply the Pumping Lemma 87
88 w L length w m From the Pumping Lemma it must be that length x y m, y 1 From the Pumping Lemma: x y i z L i = 0,1, 2,... k+ 1 The length of w = xy z = k > m must be prime for each string of L 88
89 But, choosing length ( xyz ) = k length( xy k + 1 z) = length( xyy k z) = length( xyz) + length( y k ) = k + k ( length ( y )) = k (1 + length( y)) which is not prime! ( k > m) Thus: w L CONTRADICTION! 89
90 Therefore: Our assumption that L is a regular language is not true Conclusion L is not a regular language END OF PROOF 90
91 Non-regular languages { ww R : w Σ*} { a b : n 0} n n n l n+ l { a b c : n, l 0} { a n! : n 0} Regular languages L i = { a : i prime} 91
92 An alternative variant of proof from slide 53. Theorem The language is not regular L n n = { a b : n 0} Proof Use the Pumping Lemma! 92
93 L n n = { a b : n 0} Assume to the contrary that L is a regular language L Since is infinite we can apply the Pumping Lemma 93
94 L n n = { a b : n 0} Let m be the integer in the Pumping Lemma Pick a string w such that: w L length w m Pick m b m w = a 94
95 Write: a m b m = x y z From the Pumping Lemma it must be that: length x y m, y 1 m m Therefore: a m b m = a... aa... a... ab... b y k = a, k 1 x y z 95
96 We have: x y z = a m b m y = a, k 1 k From the Pumping Lemma: x y i z L i = 0,1, 2,... Thus: x y 2 z L x y 2 z = x y y z = a m+ k b m L 96
97 m+k + b m Therefore: a b L BUT: L n n = { a b : n 0} a m+ k b m L CONTRADICTION 97
98 Therefore: Our assumption that L is a regular language is not true Conclusion: L is not a regular language END OF PROOF 98
99 Pumping Lemma, in short 99
100 Observation: Every language of finite size has to be regular (we can easily construct an NFA that accepts every string in the language) Therefore, every non-regular language g has to be of infinite size (contains an infinite number of strings) 100
101 Suppose you want to prove that An infinite language L is not regular 1. Assume the opposite: L is regular 2. The pumping lemma should hold for L 3. Use the pumping lemma to obtain a contradiction 4. Therefore, L is not regular 101
102 Explanation of Step 3: How to get a contradiction with pumping lemma w L i. Find a particular string which satisfies the conditions of the pumping p lemma ii. Write w = xyz iii. Show that w i for some i 1 = xy z L iv. This gives a contradiction, since from pumping lemma w = xy i z L 102
103 Note: It suffices to show that only one string w gives a contradiction L You don t need to obtain contradiction for every w L 103
104 Extra Examples on Regular Languages 104
105 FA RE 105
106 FA RE or 106
107 NFA DFA Subset Construction Delmängdkonstruktion 107
108 Convert an NFA to DFA using the subset construction 108
109 Each state t of the DFAis a set of states t of the NFA. Start by the initial state of the DFA which is the ε-closure of the initial state of the NFA (all the states you reach by ε-transitions from the initial state). CLOSE{0}={0, {0, 1, 3}=S 0 109
110 Determine the transition function of the DFA on all inputs. Begin with the initial state S 0, and determine the transition on input a. CLOSE{0} = {0, 1, 3} = S 0 δ(s 0, a) = CLOSE{1, 2} 110
111 The ε-closure of the set {1, 2} is {1, 2, 3} This is a new state in the DFA, call it S 1. CLOSE{0} = {0, 1, 3} = S 0 δ(s 0, a) = CLOSE{1, 2} = {1, 2, 3} = S 1 111
112 With the initial state S 0, determine the transition on input b. CLOSE{0} = {0, 1, 3} = S 0 δ(s 0, a) = CLOSE{1, 2} = {1, 2, 3} = S 1 δ(s0, b) = CLOSE{3} 112
113 The ε-closure of the set {3} is {1, 3}. This is a new state in the DFA, call it S 2. CLOSE{0}={0 {0, 1, 3}=S 0 δ(s 0, a) = CLOSE{1, 2} = {1, 2, 3} = S 1 δ(s0, b) = CLOSE{3} = {1, 3} = S 2 113
114 Determine the transition function of the DFA from state S 1 on inputs a and b. On a there is no where to go in the NFA, so we create a sink ( trap ) state for DFA. δ(s 0, a) = CLOSE{1, 2} = {1, 2, 3} = S 1 δ(s 0, b) = CLOSE{3} = {1, 3} = S 2 δ(s 1, a) = CLOSE{} = = S 3 114
115 Determine the transition function of the DFA from state S 1 on inputs a and b. On b there is a transition to an existing state S 2. δ(s 0, a) = CLOSE{1, 2} = {1, 2, 3} = S 1 δ(s 0, b) = CLOSE{3} = {1, 3} = S 2 δ(s 1, a) = CLOSE{} = = S 3 δ(s 1, b) = CLOSE{3} = {1, 3} = S2 115
116 Determine the transition from state S 2 on inputs a and b. δ(s 0, a) = CLOSE{1, 2} = {1, 2, 3} = S 1 δ(s 0, b) = CLOSE{3} = {1, 3} = S 2 δ(s 1, a) = CLOSE{} = = S 3 δ(s 1, b) = CLOSE{3} = {1, 3} = S 2 δ(s 2, a) = CLOSE{} = = S 3 δ(s 2, b) = CLOSE{3} = {1, 3} = S 2 116
117 Determining the transition from state S 2 on inputs a and b is easy; from the empty set of states there are no transitions in the NFA. In the DFA this is represented by a transition from the empty set back to itself. 117
118 The final states t of the DFA are determined d from the final states t of the NFA. State t 3 was the only final state in the NFA. (Any set of NFA states containing a final state is a final state in the DFA.) 118
119 NFA DFA RESULT 119
120 State elimination 0*1 q 0 λ+10* q 1 0*11 q 2 01 (λ+10*)(0*1)*0*11 q 0 q 2 01 (λ+10*)(0*1)*0*11 1) q 0 q 2
121 Example 7 Convert the following NFA to DFA. 1 0 q 0 0 s 0 ε ε 1 s r 0 q p ε r p r s p q, r, p 1
122 Converting the NFA to DFA s p 0 λ λ q λ 1 r p r s 1 q r p 0 1 q p r s
123 Application: Lex - lexical analyzer Lex RE NFA DFA Minimal DFA The final states of the DFA are associated with actions. 123
More Properties of Regular Languages
More Properties of Regular anguages 1 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse 2 Namely, for regular languages 1 and 2 : Union 1 2 Concatenation Star
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTATION
FORMAL LANGUAGES, AUTOMATA AND COMPUTATION IDENTIFYING NONREGULAR LANGUAGES PUMPING LEMMA Carnegie Mellon University in Qatar (CARNEGIE MELLON UNIVERSITY IN QATAR) SLIDES FOR 15-453 LECTURE 5 SPRING 2011
More informationThe Pumping Lemma and Closure Properties
The Pumping Lemma and Closure Properties Mridul Aanjaneya Stanford University July 5, 2012 Mridul Aanjaneya Automata Theory 1/ 27 Tentative Schedule HW #1: Out (07/03), Due (07/11) HW #2: Out (07/10),
More informationNon-regular languages
Non-regular languages (Pumping Lemma) Fall 2017 Costas Busch - RPI 1 Non-regular languages { a n n : n 0} { vv R : v{ a, }*} Regular languages a* * c a c( a )* etc... Fall 2017 Costas Busch - RPI 2 How
More informationBefore we show how languages can be proven not regular, first, how would we show a language is regular?
CS35 Proving Languages not to be Regular Before we show how languages can be proven not regular, first, how would we show a language is regular? Although regular languages and automata are quite powerful
More informationCSci 311, Models of Computation Chapter 4 Properties of Regular Languages
CSci 311, Models of Computation Chapter 4 Properties of Regular Languages H. Conrad Cunningham 29 December 2015 Contents Introduction................................. 1 4.1 Closure Properties of Regular
More informationTDDD65 Introduction to the Theory of Computation
TDDD65 Introduction to the Theory of Computation Lecture 2 Gustav Nordh, IDA gustav.nordh@liu.se 2012-08-31 Outline - Lecture 2 Closure properties of regular languages Regular expressions Equivalence of
More informationClosure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism
Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement
More informationLecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2
BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 Prepared by, Dr. Subhendu Kumar Rath, BPUT, Odisha. UNIT 2 Structure NON-DETERMINISTIC FINITE AUTOMATA
More information2.1 Solution. E T F a. E E + T T + T F + T a + T a + F a + a
. Solution E T F a E E + T T + T F + T a + T a + F a + a E E + T E + T + T T + T + T F + T + T a + T + T a + F + T a + a + T a + a + F a + a + a E T F ( E) ( T ) ( F) (( E)) (( T )) (( F)) (( a)) . Solution
More informationMore on Regular Languages and Non-Regular Languages
More on Regular Languages and Non-Regular Languages CSCE A35 Decision Properties of Regular Languages Given a (representation, e.g., RE, FA, of a) regular language L, what can we tell about L? Since there
More informationProperties of Regular Languages. Wen-Guey Tzeng Department of Computer Science National Chiao Tung University
Properties of Regular Languages Wen-Guey Tzeng Department of Computer Science National Chiao Tung University Closure Properties Question: L is a regular language and op is an operator on strings. Is op(l)
More informationComputational Models - Lecture 3 1
Computational Models - Lecture 3 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. March 13/18, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationFinite Automata and Regular languages
Finite Automata and Regular languages Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/
More informationTheory of Computation
Fall 2002 (YEN) Theory of Computation Midterm Exam. Name:... I.D.#:... 1. (30 pts) True or false (mark O for true ; X for false ). (Score=Max{0, Right- 1 2 Wrong}.) (1) X... If L 1 is regular and L 2 L
More informationCS 455/555: Finite automata
CS 455/555: Finite automata Stefan D. Bruda Winter 2019 AUTOMATA (FINITE OR NOT) Generally any automaton Has a finite-state control Scans the input one symbol at a time Takes an action based on the currently
More informationAutomata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS
Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.
More informationGEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I
GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I Internal Examination 2017-18 B.Tech III Year VI Semester Sub: Theory of Computation (6CS3A) Time: 1 Hour 30 min. Max Marks: 40 Note: Attempt all three
More informationChapter 6. Properties of Regular Languages
Chapter 6 Properties of Regular Languages Regular Sets and Languages Claim(1). The family of languages accepted by FSAs consists of precisely the regular sets over a given alphabet. Every regular set is
More informationUnit 6. Non Regular Languages The Pumping Lemma. Reading: Sipser, chapter 1
Unit 6 Non Regular Languages The Pumping Lemma Reading: Sipser, chapter 1 1 Are all languages regular? No! Most of the languages are not regular! Why? A finite automaton has limited memory. How can we
More informationProperties of Context-Free Languages. Closure Properties Decision Properties
Properties of Context-Free Languages Closure Properties Decision Properties 1 Closure Properties of CFL s CFL s are closed under union, concatenation, and Kleene closure. Also, under reversal, homomorphisms
More informationSri vidya college of engineering and technology
Unit I FINITE AUTOMATA 1. Define hypothesis. The formal proof can be using deductive proof and inductive proof. The deductive proof consists of sequence of statements given with logical reasoning in order
More informationComputational Models - Lecture 3
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Computational Models - Lecture 3 Equivalence of regular expressions and regular languages (lukewarm leftover
More informationCS5371 Theory of Computation. Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression) Objectives Prove the Pumping Lemma, and use it to show that there are non-regular languages
More informationPS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010
University of Virginia - cs3102: Theory of Computation Spring 2010 PS2 - Comments Average: 77.4 (full credit for each question is 100 points) Distribution (of 54 submissions): 90, 12; 80 89, 11; 70-79,
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be
More informationProperties of Context-Free Languages
Properties of Context-Free Languages Seungjin Choi Department of Computer Science and Engineering Pohang University of Science and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjin@postech.ac.kr
More informationTheory of Computation (II) Yijia Chen Fudan University
Theory of Computation (II) Yijia Chen Fudan University Review A language L is a subset of strings over an alphabet Σ. Our goal is to identify those languages that can be recognized by one of the simplest
More informationClosure Properties of Context-Free Languages. Foundations of Computer Science Theory
Closure Properties of Context-Free Languages Foundations of Computer Science Theory Closure Properties of CFLs CFLs are closed under: Union Concatenation Kleene closure Reversal CFLs are not closed under
More informationComputational Models: Class 3
Computational Models: Class 3 Benny Chor School of Computer Science Tel Aviv University November 2, 2015 Based on slides by Maurice Herlihy, Brown University, and modifications by Iftach Haitner and Yishay
More informationContext-Free Languages (Pre Lecture)
Context-Free Languages (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall 2017 1 / 34 Outline Pumping Lemma
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THE PUMPING LEMMA FOR REGULAR LANGUAGES and REGULAR EXPRESSIONS TUESDAY Jan 21 WHICH OF THESE ARE REGULAR? B = {0 n 1 n n 0} C = { w w has equal number
More informationFABER Formal Languages, Automata. Lecture 2. Mälardalen University
CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010 1 Content Languages, g Alphabets and Strings Strings & String Operations Languages & Language Operations
More informationCS375 Midterm Exam Solution Set (Fall 2017)
CS375 Midterm Exam Solution Set (Fall 2017) Closed book & closed notes October 17, 2017 Name sample 1. (10 points) (a) Put in the following blank the number of strings of length 5 over A={a, b, c} that
More informationBefore We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions?
Before We Start The Pumping Lemma Any questions? The Lemma & Decision/ Languages Future Exam Question What is a language? What is a class of languages? Context Free Languages Context Free Languages(CFL)
More informationUses of finite automata
Chapter 2 :Finite Automata 2.1 Finite Automata Automata are computational devices to solve language recognition problems. Language recognition problem is to determine whether a word belongs to a language.
More informationLanguages, regular languages, finite automata
Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,
More informationCISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata
CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Sipser Ch 1.4 Explain the limits of the class of regular languages Justify why the Pumping
More informationMA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation Closure properties of Regular Languages Pumping Theorem Your Questions? Previous class days' material? Reading Assignments? HW 6 or 7 problems? Anything else? 1 To Show
More informationCS 133 : Automata Theory and Computability
CS 133 : Automata Theory and Computability Lecture Slides 1 Regular Languages and Finite Automata Nestine Hope S. Hernandez Algorithms and Complexity Laboratory Department of Computer Science University
More informationContext Free Languages. Automata Theory and Formal Grammars: Lecture 6. Languages That Are Not Regular. Non-Regular Languages
Context Free Languages Automata Theory and Formal Grammars: Lecture 6 Context Free Languages Last Time Decision procedures for FAs Minimum-state DFAs Today The Myhill-Nerode Theorem The Pumping Lemma Context-free
More informationV Honors Theory of Computation
V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant
More informationLecture 7 Properties of regular languages
Lecture 7 Properties of regular languages COT 4420 Theory of Computation Section 4.1 Closure properties of regular languages If L 1 and L 2 are regular languages, then we prove that: Union: L 1 L 2 Concatenation:
More informationWhat we have done so far
What we have done so far DFAs and regular languages NFAs and their equivalence to DFAs Regular expressions. Regular expressions capture exactly regular languages: Construct a NFA from a regular expression.
More informationAutomata Theory Final Exam Solution 08:10-10:00 am Friday, June 13, 2008
Automata Theory Final Exam Solution 08:10-10:00 am Friday, June 13, 2008 Name: ID #: This is a Close Book examination. Only an A4 cheating sheet belonging to you is acceptable. You can write your answers
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 9 Ana Bove April 19th 2018 Recap: Regular Expressions Algebraic representation of (regular) languages; R, S ::= a R + S RS R......
More informationPushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen
Pushdown automata Twan van Laarhoven Institute for Computing and Information Sciences Intelligent Systems Version: fall 2014 T. van Laarhoven Version: fall 2014 Formal Languages, Grammars and Automata
More informationGrade 6 Math Circles October 20/21, Formalism and Languages: Beyond Regular Languages
Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 6 Math Circles October 20/21, 2015 Formalism and Languages: Beyond Regular Languages Dr. Troy Vasiga
More informationTheory of Computation (Classroom Practice Booklet Solutions)
Theory of Computation (Classroom Practice Booklet Solutions) 1. Finite Automata & Regular Sets 01. Ans: (a) & (c) Sol: (a) The reversal of a regular set is regular as the reversal of a regular expression
More informationFooling Sets and. Lecture 5
Fooling Sets and Introduction to Nondeterministic Finite Automata Lecture 5 Proving that a language is not regular Given a language, we saw how to prove it is regular (union, intersection, concatenation,
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.4 Explain the limits of the class of regular languages Justify why the
More informationNon-context-Free Languages. CS215, Lecture 5 c
Non-context-Free Languages CS215, Lecture 5 c 2007 1 The Pumping Lemma Theorem. (Pumping Lemma) Let be context-free. There exists a positive integer divided into five pieces, Proof for for each, and..
More informationComment: The induction is always on some parameter, and the basis case is always an integer or set of integers.
1. For each of the following statements indicate whether it is true or false. For the false ones (if any), provide a counter example. For the true ones (if any) give a proof outline. (a) Union of two non-regular
More informationOgden s Lemma for CFLs
Ogden s Lemma for CFLs Theorem If L is a context-free language, then there exists an integer l such that for any u L with at least l positions marked, u can be written as u = vwxyz such that 1 x and at
More informationCS 154. Finite Automata vs Regular Expressions, Non-Regular Languages
CS 154 Finite Automata vs Regular Expressions, Non-Regular Languages Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and guessing
More information3515ICT: Theory of Computation. Regular languages
3515ICT: Theory of Computation Regular languages Notation and concepts concerning alphabets, strings and languages, and identification of languages with problems (H, 1.5). Regular expressions (H, 3.1,
More informationNondeterministic Finite Automata
Nondeterministic Finite Automata Not A DFA Does not have exactly one transition from every state on every symbol: Two transitions from q 0 on a No transition from q 1 (on either a or b) Though not a DFA,
More informationRegular Expressions and Language Properties
Regular Expressions and Language Properties Mridul Aanjaneya Stanford University July 3, 2012 Mridul Aanjaneya Automata Theory 1/ 47 Tentative Schedule HW #1: Out (07/03), Due (07/11) HW #2: Out (07/10),
More informationCOM364 Automata Theory Lecture Note 2 - Nondeterminism
COM364 Automata Theory Lecture Note 2 - Nondeterminism Kurtuluş Küllü March 2018 The FA we saw until now were deterministic FA (DFA) in the sense that for each state and input symbol there was exactly
More informationComputational Theory
Computational Theory Finite Automata and Regular Languages Curtis Larsen Dixie State University Computing and Design Fall 2018 Adapted from notes by Russ Ross Adapted from notes by Harry Lewis Curtis Larsen
More informationComputational Models - Lecture 3 1
Computational Models - Lecture 3 1 Handout Mode Iftach Haitner. Tel Aviv University. November 14, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.
More informationAutomata: a short introduction
ILIAS, University of Luxembourg Discrete Mathematics II May 2012 What is a computer? Real computers are complicated; We abstract up to an essential model of computation; We begin with the simplest possible
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 14 Ana Bove May 14th 2018 Recap: Context-free Grammars Simplification of grammars: Elimination of ǫ-productions; Elimination of
More information10. The GNFA method is used to show that
CSE 355 Midterm Examination 27 February 27 Last Name Sample ASU ID First Name(s) Ima Exam # Sample Regrading of Midterms If you believe that your grade has not been recorded correctly, return the entire
More informationHomework 5 - Solution
DCP3122 Introduction to Formal Languages, Spring 2015 Instructor: Prof. Wen-Guey Tzeng Homework 5 - Solution 5-May-2015 Due: 18-May-2015 1. Given Σ = {a, b, c}, find an NPDA that accepts L = {a n b n+m
More informationProperties of Regular Languages (2015/10/15)
Chapter 4 Properties of Regular Languages (25//5) Pasbag, Turkey Outline 4. Proving Languages Not to e Regular 4.2 Closure Properties of Regular Languages 4.3 Decision Properties of Regular Languages 4.4
More informationMA/CSSE 474 Theory of Computation. Your Questions? Previous class days' material Reading Assignments
MA/CSSE 474 Theory of Computation How many regular/non-regular languages are there? Closure properties of Regular Languages (if there is time) Pumping Theorem Your Questions? Previous class days' material
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 1.4 Give an example of a non-regular language Outline two strategies for proving
More informationIncorrect reasoning about RL. Equivalence of NFA, DFA. Epsilon Closure. Proving equivalence. One direction is easy:
Incorrect reasoning about RL Since L 1 = {w w=a n, n N}, L 2 = {w w = b n, n N} are regular, therefore L 1 L 2 = {w w=a n b n, n N} is regular If L 1 is a regular language, then L 2 = {w R w L 1 } is regular,
More informationComputational Models - Lecture 4
Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push
More informationProperties of Regular Languages. BBM Automata Theory and Formal Languages 1
Properties of Regular Languages BBM 401 - Automata Theory and Formal Languages 1 Properties of Regular Languages Pumping Lemma: Every regular language satisfies the pumping lemma. A non-regular language
More informationUNIT-III REGULAR LANGUAGES
Syllabus R9 Regulation REGULAR EXPRESSIONS UNIT-III REGULAR LANGUAGES Regular expressions are useful for representing certain sets of strings in an algebraic fashion. In arithmetic we can use the operations
More informationClosure under the Regular Operations
September 7, 2013 Application of NFA Now we use the NFA to show that collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have shown this closure
More informationCSE 355 Test 2, Fall 2016
CSE 355 Test 2, Fall 2016 28 October 2016, 8:35-9:25 a.m., LSA 191 Last Name SAMPLE ASU ID 1357924680 First Name(s) Ima Regrading of Midterms If you believe that your grade has not been added up correctly,
More informationProving languages to be nonregular
Proving languages to be nonregular We already know that there exist languages A Σ that are nonregular, for any choice of an alphabet Σ. This is because there are uncountably many languages in total and
More informationTAFL 1 (ECS-403) Unit- II. 2.1 Regular Expression: The Operators of Regular Expressions: Building Regular Expressions
TAFL 1 (ECS-403) Unit- II 2.1 Regular Expression: 2.1.1 The Operators of Regular Expressions: 2.1.2 Building Regular Expressions 2.1.3 Precedence of Regular-Expression Operators 2.1.4 Algebraic laws for
More informationTheory of Computation (I) Yijia Chen Fudan University
Theory of Computation (I) Yijia Chen Fudan University Instructor Yijia Chen Homepage: http://basics.sjtu.edu.cn/~chen Email: yijiachen@fudan.edu.cn Textbook Introduction to the Theory of Computation Michael
More informationLanguages. A language is a set of strings. String: A sequence of letters. Examples: cat, dog, house, Defined over an alphabet:
Languages 1 Languages A language is a set of strings String: A sequence of letters Examples: cat, dog, house, Defined over an alphaet: a,, c,, z 2 Alphaets and Strings We will use small alphaets: Strings
More informationComputer Sciences Department
1 Reference Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER 3 objectives Finite automaton Infinite automaton Formal definition State diagram Regular and Non-regular
More informationTheory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is
Abstraction of Problems Data: abstracted as a word in a given alphabet. Σ: alphabet, a finite, non-empty set of symbols. Σ : all the words of finite length built up using Σ: Conditions: abstracted as a
More informationClosure Properties of Regular Languages
Closure Properties of Regular Languages Lecture 13 Section 4.1 Robb T. Koether Hampden-Sydney College Wed, Sep 21, 2016 Robb T. Koether (Hampden-Sydney College) Closure Properties of Regular Languages
More informationRegular Languages. Problem Characterize those Languages recognized by Finite Automata.
Regular Expressions Regular Languages Fundamental Question -- Cardinality Alphabet = Σ is finite Strings = Σ is countable Languages = P(Σ ) is uncountable # Finite Automata is countable -- Q Σ +1 transition
More informationExam 1 CSU 390 Theory of Computation Fall 2007
Exam 1 CSU 390 Theory of Computation Fall 2007 Solutions Problem 1 [10 points] Construct a state transition diagram for a DFA that recognizes the following language over the alphabet Σ = {a, b}: L 1 =
More informationLecture 4: More on Regexps, Non-Regular Languages
6.045 Lecture 4: More on Regexps, Non-Regular Languages 6.045 Announcements: - Pset 1 is on piazza (as of last night) - If you don t have piazza access but are registered for 6.045, send email to TAs with
More informationCS 154, Lecture 3: DFA NFA, Regular Expressions
CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and
More informationECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam
ECS 120: Theory of Computation Handout MT UC Davis Phillip Rogaway February 16, 2012 Midterm Exam Instructions: The exam has six pages, including this cover page, printed out two-sided (no more wasted
More informationFall, 2017 CIS 262. Automata, Computability and Complexity Jean Gallier Solutions of the Practice Final Exam
Fall, 2017 CIS 262 Automata, Computability and Complexity Jean Gallier Solutions of the Practice Final Exam December 6, 2017 Problem 1 (10 pts). Let Σ be an alphabet. (1) What is an ambiguous context-free
More informationAuthor: Vivek Kulkarni ( )
Author: Vivek Kulkarni ( vivek_kulkarni@yahoo.com ) Chapter-3: Regular Expressions Solutions for Review Questions @ Oxford University Press 2013. All rights reserved. 1 Q.1 Define the following and give
More informationCS5371 Theory of Computation. Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL)
CS5371 Theory of Computation Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL) Objectives Introduce Pumping Lemma for CFL Apply Pumping Lemma to show that some languages are non-cfl Pumping Lemma
More informationTheory Bridge Exam Example Questions
Theory Bridge Exam Example Questions Annotated version with some (sometimes rather sketchy) answers and notes. This is a collection of sample theory bridge exam questions. This is just to get some idea
More informationCS Automata, Computability and Formal Languages
Automata, Computability and Formal Languages Luc Longpré faculty.utep.edu/longpre 1 - Pg 1 Slides : version 3.1 version 1 A. Tapp version 2 P. McKenzie, L. Longpré version 2.1 D. Gehl version 2.2 M. Csűrös,
More informationAutomata Theory. CS F-10 Non-Context-Free Langauges Closure Properties of Context-Free Languages. David Galles
Automata Theory CS411-2015F-10 Non-Context-Free Langauges Closure Properties of Context-Free Languages David Galles Department of Computer Science University of San Francisco 10-0: Fun with CFGs Create
More informationCOMP4141 Theory of Computation
COMP4141 Theory of Computation Lecture 4 Regular Languages cont. Ron van der Meyden CSE, UNSW Revision: 2013/03/14 (Credits: David Dill, Thomas Wilke, Kai Engelhardt, Peter Höfner, Rob van Glabbeek) Regular
More informationCSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs
CSE : Foundations of Computing Lecture : Finite State Machine Minimization & NFAs State Minimization Many different FSMs (DFAs) for the same problem Take a given FSM and try to reduce its state set by
More informationCSE 105 Theory of Computation Professor Jeanne Ferrante
CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Announcement & Reminders HW 2: Grades not available yet, will be soon Solutions posted, read even if you did well
More informationName: Student ID: Instructions:
Instructions: Name: CSE 322 Autumn 2001: Midterm Exam (closed book, closed notes except for 1-page summary) Total: 100 points, 5 questions, 20 points each. Time: 50 minutes 1. Write your name and student
More informationRegular Expressions. Definitions Equivalence to Finite Automata
Regular Expressions Definitions Equivalence to Finite Automata 1 RE s: Introduction Regular expressions are an algebraic way to describe languages. They describe exactly the regular languages. If E is
More informationCSE 105 THEORY OF COMPUTATION. Spring 2018 review class
CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus
More information