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)

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

Theory of Computation Regular Languages

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

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

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

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

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

Formal languages, automata, and theory of computation

Harvard University Computer Science 121 Midterm October 23, 2012

Homework 3 Solutions

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

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.

Some Theory of Computation Exercises Week 1

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

State Minimization for DFAs

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

First Midterm Examination

First Midterm Examination

CSCI FOUNDATIONS OF COMPUTER SCIENCE

Formal Language and Automata Theory (CS21004)

Name Ima Sample ASU ID

Let's start with an example:

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

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

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.

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

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

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

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

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

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

Automata and Languages

Finite Automata-cont d

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

1.4 Nonregular Languages

Fundamentals of Computer Science

CHAPTER 1 Regular Languages. Contents

Finite-State Automata: Recap

CS 330 Formal Methods and Models

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

Lecture 09: Myhill-Nerode Theorem

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

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

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

CS375: Logic and Theory of Computing

CS375: Logic and Theory of Computing

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

Nondeterminism and Nodeterministic Automata

Worked out examples Finite Automata

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

Chapter 2 Finite Automata

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

1 From NFA to regular expression

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

Lecture 08: Feb. 08, 2019

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

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.

Revision Sheet. (a) Give a regular expression for each of the following languages:

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

CISC 4090 Theory of Computation

Deterministic Finite Automata

Designing finite automata II

1.3 Regular Expressions

Coalgebra, Lecture 15: Equations for Deterministic Automata

CSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes

Convert the NFA into DFA

Recursively Enumerable and Recursive. Languages

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

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

Non-deterministic Finite Automata

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

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

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

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

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

Deterministic Finite-State Automata

1 Structural induction

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Closure Properties of Regular Languages

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

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

Formal Languages and Automata

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Minimal DFA. minimal DFA for L starting from any other

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

input tape head moves current state

1 Structural induction, finite automata, regular expressions

Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language.

Non-deterministic Finite Automata

Lexical Analysis Finite Automate

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Non Deterministic Automata. Formal Languages and Automata - Yonsei CS 1

CMSC 330: Organization of Programming Languages

Duke Math Meet

Finite Automata Part Three

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

1 Nondeterministic Finite Automata

CS 275 Automata and Formal Language Theory

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

Transcription:

cs3102: Theory of Computtion Clss 5: Non-Regulr PS1, Prolem 8 Menu Non-regulr lnguges Spring 2010 University of Virgini Dvid Evns PS1 Generl Comments Proofs re for mking convincing rguments, not for ofusction. e.g., If you ssumed pizzs cn only e cut through their center, it is ovious ech cut mkes 2 new pieces, nd the numer of pieces is 2n. Adding n inductive proof only dds unnecessry confusion! Pledges re to remind you to e honorle I ssume you re ll honorle whether you write pledge or not Writing rote pledge (not wht the PS collortion policy sys) doesn t work Prolem 8 DFA tht recognizes: { w w [, ]*nd wdoes not contin two consecutive s }, no- one- two- How mny strings of length nin this lnguge? no- one-, Fioncci Strings! two- n End in no- stte Endin one- stte Totl of length n 0 1 0 1 1 1 1 2 2 1+1 = 2 1 3 3 2+1 = 3 2 5 4 3+2 = 5 3 8 n> 2 E 0 (n-1)+e 1 (n-1) E 0 (n-1) 2E 0 (n-1) + E 1 (n-1) E 1 (n) = E 0 (n-1) E 0 (n) = E 0 (n-1)+e 0 (n-2) T(n) = 2E 0 (n-1) + E 0 (n-2) = 2(E 0 (n-2) +E 0 (n-3)) + E 0 (n-2) = 3E 0 (n-2) + 2E 0 (n-3) T(n -1)=2E 0 (n-2) + E 0 (n-3) + T(n -2)=2E 0 (n-3) + E 0 (n-4) = 2E 0 (n-2) + 3E 0 (n-3)+ E 0 (n-4) = 2E 0 (n-2) + 2E 0 (n-3)+ (E 0 (n-3) + E 0 (n-4)) = 3E 0 (n-2) + 2E 0 (n-3) = T(n)

Wht DFAs Cnnot Do All Regulr Cn e recognized y some DFA Finite Keep trck of non-constnt mount of stte: the mount of stte to keep trck of cnnot scle with the input string DFAs cn hve ny numer of sttes, ut the numer of sttes in ny prticulr DFA is fixed nd finite. The Lnguge Recognition Gme Plyers gree on lnguge A Plyer 1: drw DFA Mtht ttempts to recognize lnguge A. Plyer 2: find string stht Mdecides incorrectly. Either, s Aut M rejects Or, s Aut M ccepts If Plyer 2 cn find such string, Plyer 2 wins. Otherwise, Plyer 1 wins. A= ** Plying the Lnguge Gme If Ais regulr, Plyer 1 should lwys win. If A is non-regulr, Plyer 2 should lwys win. Plying the Lnguge Gme A= { n n n>= 0 } Regulr Lnguge Gme A= { w w [,]* ndw hs mores thns. }

Regulr Lnguge Gme A= { w w [0,1]*ndw is divisile y 3 when interpreted s inry numer} 0 1 0 1 2 0 1 q 0 q z 1 0 If input string is longer thn Q, some stte must repet. y Pumping Lemm Cpture our intuition out wht DFAs cn t do more precisely. We ll see pumping lemms for other types of computtion models. q i q 0 z qz x flickr: ytwhitelight Pumping Lemm for Regulr If Ais regulr lnguge, then there is some numer p(the pumping length) where for ny string s And s p, s my e divided into three pieces, s = xyz, such tht y > 0, xy p, nd for ny i 0, xy i z A. Intuitively: you cn go round the circle ny numer of times. Using the PLRL: Proof y Contrdiction 1. AssumeAis regulr. 2. Then, the pumping lemm is true for A: there is some numer p(the pumping length) where for ny We cn string condense s And the first s p, 2 steps into s my the e sttement: divided into three ``Assume pieces, A is regulr s = xyz, nd p such is the tht pumping y > length 0, xy p, for A.'' nd for ny i 0, xy i z A. 3. The cretive prt:identify string stht cn e uilt using pnd show tht there is no wy to divide s = xyz tht stisfies the pumping lemm: for ll possile divisions where y > 0 there is some i 0 such tht xy i z A.

Exmple: A= { n n n>= 0 } A= { n n n>= 0 }is not regulr A= { w whs mores thns.} A= { w w [0,1]*ndw is divisile y 3 when interpreted s inry numer} Pumping lemm cn e used to show lnguge is not regulr. It strts y ssuming lnguge is regulr nd gets contrdiction. This is no wy to show lnguge is regulr. Regulr One-Slide Summry A lnguge is set of strings. A lnguge is regulr iff some DFA recognizes it. DFAs, NFAs, nd Regulr Expressions re eqully powerful They cn recognize exctly the sme set of lnguges = the regulr lnguges Prove y construction: show how to construct DFA tht recognizes the sme lnguge s NFA, etc. To prove lnguge is regulr: construct DFA, NFA or RE tht recognizes it To prove lnguge is not regulr: show recognizing it requires keeping trck of infinitestte use the pumping lemm to get contrdiction All Regulr Cn e recognized y some DFA Finite Next week: mchines tht cn recognize some non-regulr lnguge.

Return PS1 front of room fg2s (Arthur Gordon) dk8p dr7jx (Dvid Renrdy) jmd9xk jth2ey (Jmes Hrrison) - pmc8p rs3kd (Royn Short) yyz5w