CSE 105 THEORY OF COMPUTATION

Similar documents
CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Proving languages to be nonregular

CSE 105 THEORY OF COMPUTATION

Unit 6. Non Regular Languages The Pumping Lemma. Reading: Sipser, chapter 1

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

TDDD65 Introduction to the Theory of Computation

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

CSE 105 THEORY OF COMPUTATION

Name: Student ID: Instructions:

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Computer Sciences Department

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CSE 105 THEORY OF COMPUTATION

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

CSE 105 THEORY OF COMPUTATION

CS 154. Finite Automata, Nondeterminism, Regular Expressions

Lecture 4: More on Regexps, Non-Regular Languages

Computational Theory

CS 154. Finite Automata vs Regular Expressions, Non-Regular Languages

CSE 105 THEORY OF COMPUTATION

Intro to Theory of Computation

CS 154, Lecture 3: DFA NFA, Regular Expressions

CSE 105 THEORY OF COMPUTATION

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

Automata: a short introduction

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010

Computational Models - Lecture 3 1

Finite Automata and Regular languages

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:

Foundations of (Theoretical) Computer Science

CSE 105 THEORY OF COMPUTATION

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

CSE 105 Theory of Computation Professor Jeanne Ferrante

Fooling Sets and. Lecture 5

MA/CSSE 474 Theory of Computation. Your Questions? Previous class days' material Reading Assignments

Before we show how languages can be proven not regular, first, how would we show a language is regular?

Computational Models: Class 3

COM364 Automata Theory Lecture Note 2 - Nondeterminism

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

The Pumping Lemma and Closure Properties

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1)

Notes for Comp 497 (Comp 454) Week 5 2/22/05. Today we will look at some of the rest of the material in Part 1 of the book.

Closure under the Regular Operations

More Properties of Regular Languages

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is

CS5371 Theory of Computation. Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

Sri vidya college of engineering and technology

What we have done so far

Mathematics for linguists

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Incorrect reasoning about RL. Equivalence of NFA, DFA. Epsilon Closure. Proving equivalence. One direction is easy:

Formal Languages, Automata and Models of Computation

More on Regular Languages and Non-Regular Languages

CSE 322, Fall 2010 Nonregular Languages

Finite Automata (contd)

3515ICT: Theory of Computation. Regular languages

CPSC 421: Tutorial #1

Chapter 6. Properties of Regular Languages

CSE 20 DISCRETE MATH. Winter

CS 121, Section 2. Week of September 16, 2013

ECS120 Fall Discussion Notes. October 25, The midterm is on Thursday, November 2nd during class. (That is next week!)

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CSci 311, Models of Computation Chapter 4 Properties of Regular Languages

10. The GNFA method is used to show that

We define the multi-step transition function T : S Σ S as follows. 1. For any s S, T (s,λ) = s. 2. For any s S, x Σ and a Σ,

CSE 105 THEORY OF COMPUTATION

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

Part 4 out of 5 DFA NFA REX. Automata & languages. A primer on the Theory of Computation. Last week, we showed the equivalence of DFA, NFA and REX

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Part 3 out of 5. Automata & languages. A primer on the Theory of Computation. Last week, we learned about closure and equivalence of regular languages

V Honors Theory of Computation

CSE 105 THEORY OF COMPUTATION

CSE 20 DISCRETE MATH WINTER

MA/CSSE 474 Theory of Computation

FS Properties and FSTs

Chapter 2 The Pumping Lemma

Harvard CS 121 and CSCI E-207 Lecture 6: Regular Languages and Countability

Theory of Computation (I) Yijia Chen Fudan University

I have read and understand all of the instructions below, and I will obey the University Code on Academic Integrity.

CSCE 551 Final Exam, Spring 2004 Answer Key

Theory of Computation (II) Yijia Chen Fudan University

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

Finite State Machines 2

CS 455/555: Finite automata

Uses of finite automata

MA/CSSE 474 Theory of Computation

Intro to Theory of Computation

Transcription:

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 Pumping Lemma is true Apply the Pumping Lemma in proofs of nonregularity Identify some nonregular sets

Counting languages How many languages over {0,1} are there? A. Finitely many because {0,1} is finite. B. Finitely many because strings are finite. C. Countably infinitely many because {0,1}* is countably infinite. D. Uncountably many because languages are in the power set of {0,1}*. E. None of the above.

Counting regular languages over {0,1} { regular languages} { regular expressions } Each regular expression is a finite string over the alphabet { 0, 1, ε, ø, (, ), U, * } The set of strings over an alphabet is countably infinite. Conclude: countably infinitely many regular languages.

Where we stand Fact 1: There exist nonregular languages. Fact 2: If we know some languages are nonregular, we can conclude others must be too. (cf. Discussion) But, we don't have any specific examples of nonregular languages. Yet.

Proving nonregularity How can we prove that a set is non-regular? A. Try to design a DFA that recognizes it and, if the first few attempts don't work, conclude there is none that does. B. Prove that it's a strict subset of some regular set. C. Prove that it's the union of two regular sets. D. Prove that its complement is not regular. E. I don't know.

Bounds on DFA in DFA, memory = states Automata can only "remember" finitely far in the past finitely much information If a computation path visits the same state more than once, the machine can't tell the difference between the first time and future times it visited that state.

Example! { 0 n 1 n n 0} What are some strings in this set? What are some strings not in this set? Compare to L(0 * 1 * ) Design a DFA? NFA?

Example! { 0 n 1 n n 0} What are some strings in this set? What are some strings not in this set? Is this set finite or infinite? Compare to L(0 * 1 * ) Design a DFA? NFA?

Pumping Focus on computation path through DFA

Pumping Focus on computation path through DFA

Pumping Focus on computation path through DFA Idea: if one long string is accepted, then many other similar strings have to be accepted too

Pumping Lemma Sipser p. 78 Theorem 1.70

Pumping Lemma Sipser p. 78 Theorem 1.70 # states in DFA recognizing A Transition labels along loop

Pumping Lemma If A is recognized by DFA M with state diagram below, the computation of M on any string s of length >= p = Q must have a loop. Divide s into the strings labelling the path before the loop x, the loop itself y, and from the loop to the accept state z

Pumping Lemma If A is recognized by DFA M with state diagram below, the computation of M on any string s of length >= p = Q must have a loop. Divide s into the strings labelling the path before the loop x, the loop itself y, and from the loop to the accept state z Which of the following is true? A. xy <= p D. All of A,B,C B. y > 0 E. None of them C. xy i z is accepted by M for all i

Pumping Lemma True for all (but not only) regular sets. Can't be used to prove that a set is regular Can be used to a prove that a set is not regular how?

Negation flash-back to CSE 20 J Pumping lemma ``There is p, where p is a pumping length for L" Given a specific number p, it being a pumping length for L means So p not being a pumping length of L means

Proof strategy To prove that a language L is not regular Consider arbitrary positive integer p. Prove that p isn't a pumping length for L. Conclude that L does not have any pumping length and is therefore not regular.

Using the Pumping Lemma Claim: The set L = {0 n 1 n n 0} is not regular.

Using the Pumping Lemma Claim: The set L = {0 n 1 n n 0} is not regular. Proof: Consider an arbitrary positive integer. WTS p is not a pumping length for L. How? Want to show that there is some string that *should* be pump'able but isn't.

Using the Pumping Lemma L = {0 n 1 n n 0} CLAIM: p is not a pumping length for L. How would you prove the claim? A. Find a string with length >= p that is not in L. B. Find a string with length <p that is in L. C. None of the above.

Using the Pumping Lemma L = {0 n 1 n n 0} CLAIM: p is not a pumping length for L. WTS Find a string s such that 1. s >= p 2. s is in L 3. No matter how we cut s into three (viable) pieces, some related string obtained by repeating the middle part falls out of L.

Using the Pumping Lemma Claim: The set L = {0 n 1 n n 0} is not regular. Proof: Consider an arbitrary positive integer. WTS p is not a pumping length for L. Consider the string s = 0 p 1 p. 1. s >= p? 2. s is in L? 3. No matter how we cut s into three (viable) pieces, some related string obtained by repeating the middle part falls out of L?

Using the Pumping Lemma Claim: The set L = {0 n 1 n n 0} is not regular. Proof: Consider an arbitrary positive integer p. WTS p is not a pumping length for L. Consider the string s = 0 p 1 p.

Using the Pumping Lemma Claim: The set L = {0 n 1 n n 0} is not regular. Proof: Consider an arbitrary positive integer. WTS p is not a pumping length for L. Consider the string s = 0 p 1 p. Then, s is in L and s = 2p >= p. Consider any division of s into three parts s = xyz with y >0, xy p. Since xy p, x=0 k, y = 0 m, z = 0 r 1 p with k+m+r = p, and since y > 0, m>0. Picking i=0: xy i z = xz = 0 k 0 r 1 p = 0 k+r 1 p, which is not in L because k+r < p. Thus, no p can be a pumping length for L and L is not regular.

Another example Claim: The set {a n b m a n m,n 0} is not regular. Proof: Consider an arbitrary positive integer. WTS p is not a pumping length for L. Consider the string s =??? 1. s >= p? 2. s is in L? 3. No matter how we cut s into three (viable) pieces, some related string obtained by "repeating" the middle part falls out of L?

For next time Work on Group Homework 2 due Saturday Pre class-reading for Monday: Examples 1.75, 1.77.