Regular Language. Nonregular Languages The Pumping Lemma. The pumping lemma. Regular Language. The pumping lemma. Infinitely long words 3/17/15

Similar documents
Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem. Kleene s Theorem 2/16/15

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

Harvard University Computer Science 121 Midterm October 23, 2012

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science

Chapter 4 Regular Grammar and Regular Sets. (Solutions / Hints)

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

Formal languages, automata, and theory of computation

Minimal DFA. minimal DFA for L starting from any other

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Automata and Languages

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

Homework Solution - Set 5 Due: Friday 10/03/08

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

1.4 Nonregular Languages

First Midterm Examination

Solutions Problem Set 2. Problem (a) Let M denote the DFA constructed by swapping the accept and non-accepting state in M.

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Let's start with an example:

Theory of Computation Regular Languages

CS103 Handout 32 Fall 2016 November 11, 2016 Problem Set 7

Homework 3 Solutions

2.4 Linear Inequalities and Interval Notation

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

Finite Automata-cont d

Free groups, Lecture 2, part 1

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

Bases for Vector Spaces

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY. FLAC (15-453) - Spring L. Blum

State Minimization for DFAs

CHAPTER 1 Regular Languages. Contents

1.3 Regular Expressions

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa

Lecture 08: Feb. 08, 2019

Regular expressions, Finite Automata, transition graphs are all the same!!

E 1 (n) = E 0 (n-1) E 0 (n) = E 0 (n-1)+e 0 (n-2) T(n -1)=2E 0 (n-2) + E 0 (n-3)

First Midterm Examination

Parse trees, ambiguity, and Chomsky normal form

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

CSCI FOUNDATIONS OF COMPUTER SCIENCE

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Quadratic Forms. Quadratic Forms

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

CS 275 Automata and Formal Language Theory

1 Nondeterministic Finite Automata

Name Ima Sample ASU ID

Chapter 2 Finite Automata

Lecture 3: Equivalence Relations

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

set is not closed under matrix [ multiplication, ] and does not form a group.

Recursively Enumerable and Recursive. Languages

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Coalgebra, Lecture 15: Equations for Deterministic Automata

Languages & Automata

Thoery of Automata CS402

Convert the NFA into DFA

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS375: Logic and Theory of Computing

Table of contents: Lecture N Summary... 3 What does automata mean?... 3 Introduction to languages... 3 Alphabets... 3 Strings...

1 From NFA to regular expression

For convenience, we rewrite m2 s m2 = m m m ; where m is repeted m times. Since xyz = m m m nd jxyj»m, we hve tht the string y is substring of the fir

1 Structural induction

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O

Before we can begin Ch. 3 on Radicals, we need to be familiar with perfect squares, cubes, etc. Try and do as many as you can without a calculator!!!

Lexical Analysis Finite Automate

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.

Nondeterminism and Nodeterministic Automata

CSE396 Prelim I Answer Key Spring 2017

Math 4310 Solutions to homework 1 Due 9/1/16

Definite Integrals. The area under a curve can be approximated by adding up the areas of rectangles = 1 1 +

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

Designing finite automata II

Linear Systems with Constant Coefficients

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Closure Properties of Regular Languages

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

7.1 Integral as Net Change and 7.2 Areas in the Plane Calculus

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Lecture 2e Orthogonal Complement (pages )

Non-deterministic Finite Automata

Formal Language and Automata Theory (CS21004)

Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1

Surface maps into free groups

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Talen en Automaten Test 1, Mon 7 th Dec, h45 17h30

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014

Bridging the gap: GCSE AS Level

More on automata. Michael George. March 24 April 7, 2014

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

Lecture 09: Myhill-Nerode Theorem

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Centrum voor Wiskunde en Informatica REPORTRAPPORT. Supervisory control for nondeterministic systems

Transcription:

Regulr Lnguge Nonregulr Lnguges The Pumping Lemm Models of Comput=on Chpter 10 Recll, tht ny lnguge tht cn e descried y regulr expression is clled regulr lnguge In this lecture we will prove tht not ll lnguges re regulr. Tht is, there re lnguges for which no regulr expression will suffice to descrie the lnguge. Regulr Lnguge Sying tht there is no RE to descrie lnguge is different thn sying I don t know how to write the RE for this lnguge. The RE for nonregulr lnguge Does. Not. Exist. The pumping lemm Imgine n infinite regulr lnguge tht is descried y some FA with six sttes. For exmple: () * The pumping lemm For exmple: () * From finite mchine:,,,, 1

Words with more le\ers thn mchine hs sttes Only possile ecuse of loops,,,, The generliz=on An FA for n infinite lnguge lwys hs words tht re lrger thn the numer of (finite) sttes the mchine hs The generliz=on So, for words in the lnguge tht re lrger thn the numer of sttes in the mchine, every word cn e descried s fctors: So, there will lwys e these loops.,, x is wht is efore the loop y is the loop; not Λ z is wht follows the loop,, The pumping lemm Aritrrily long words re generted y pumping extr =mes through the loop. The generliz=on,, Importnt point: The generliz=on Every infinite regulr lnguge cn e pumped; otherwise, it would require n FA with infinite sttes, which is not possile. So, n infinite lnguge tht cn not e pumped must not e regulr. 2

w = Exmple Exmple w = x = y = z = n = 1,, x = y = z = n = 8,, Necessry vs. sufficient condi=ons If A implies B Then not- B implies not- A But B does not necessrily imply A We sy tht A is sufficient ut not necessry to imply B. Necessry vs. sufficient condi=ons If lnguge is regulr then it is pumple Therefore, if lnguge is not pumple then it is not regulr But if it is pumple then it my or my not e regulr. Regulrity is sufficient ut not necessry for pumpility. There re exmples of pumple nonregulr lnguges (e.g. ww R v; see ref. h\p://www.rdford.edu/~nokie/clsses/420/chp1-4- NonregulrLngs.html) So, no=cing tht lnguge is pumple mens nothing. But finding tht lnguge is not pumple mens tht the lnguge is nonregulr. Exmple L = { n n ; n = 0 1 2 } { Λ } Drw the FA. Before eginning, you might wnt to know tht it s regulr. Since it s infinite, tht mens it cn e pumped if it is regulr. Exmple If this is prt of regulr lnguge, then it must e pumple. So how would we divide it up? If y is ll s or ll s then, when pumped they re no longer equl. If there re oth s nd s in y, then n could pper jer which is not correct for this lnguge. 3

Exmple So, there is no wy to divide the words in this lnguge to conform to: Therefore the lnguge is nonregulr. So don t other trying to drw the FA. You cn t. No one cn. Becuse it s not regulr lnguge. Exmple So we hve just used the pumping lemm to prove tht L = { n n ; n = 0 1 2 } is nonregulr. New prolem. Lnguge Equl All words with sme numer of s s s. Equl For exmple { Λ } Importnt oserv=on: { n n ; n = 0 1 2 } Equl In fct, we cn sy more thn tht: Equl { n n ; n = 0 1 2 } = * * Equl 1. n n is nonregulr; previous pumping lemm exmple 2. Since it s n RE, then * * is regulr 3. the intersec=on of two regulr lnguges is regulr; proof in lst chpter 4. Therefore, Equl most not e regulr. { n n ; n = 0 1 2 } = * * Equl Equl is nonregulr { n n ; n = 0 1 2 } = * * Equl 1. n n i nonregulr; previous pumping lemm exmple 2. Since it s n RE, then * * is regulr 3. the intersec=on of two regulr lnguges is regulr; proof in lst chpter 4. Therefore, Equl most not e regulr. Cool, huh? Pumping lemm; version 2 Let L e n infinite lnguge ccepted y n FA with n sttes. Then for ll words w in L tht hve more thn n le\ers, there re strings x, y, nd z, where y is not null nd len(x)+len(y) n such tht xyz nd xy m z (for m = 1 2 3 ) re in L. Exmple: PAL PAL = the set of ll plindromes for nd { Λ } 4

Proof tht PAL is nonregulr Proof y contrdic=on. Assume tht PAL is regulr. Then there is n FA to define the lnguge. Suppose one such FA hs 123 sttes. It will generte ll memers of PAL including: 150 150 Proof tht PAL is nonregulr Becuse 150 150 hs more le\ers thn the mchine hs sttes, then it cn e fctored in xy m z. Since len(x)+len(y) 123 (in this cse), then the non- null y prt must contin ll s. But tht mens we ll pump more s into the front ut not into the ck; so it will no longer e in PAL. Proof tht PAL is nonregulr So, the ini=l ssump=on PAL is regulr needs must e incorrect. PAL is nonregulr. 5