FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

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

CS 154 Introduction to Automata and Complexity Theory

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Automata Theory, Computability and Complexity

CS 172: Computability and Complexity. Introduction and Course Overview. Sanjit A. Seshia EECS, UC Berkeley

Theory of Computation Lecture 1. Dr. Nahla Belal

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Name: Student ID: Instructions:

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Sri vidya college of engineering and technology

COM364 Automata Theory Lecture Note 2 - Nondeterminism

Midterm II : Formal Languages, Automata, and Computability

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

CSCI 2670 Introduction to Theory of Computing

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Equivalence of DFAs and NFAs

Harvard CS 121 and CSCI E-207 Lecture 4: NFAs vs. DFAs, Closure Properties

CS 455/555: Finite automata

Nondeterministic Finite Automata

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

Finite Automata and Regular languages

Theory of Computation (I) Yijia Chen Fudan University

UNIT-III REGULAR LANGUAGES

CSE 105 THEORY OF COMPUTATION

Final exam study sheet for CS3719 Turing machines and decidability.

Theory of Computation

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CSE 105 Theory of Computation

Great Theoretical Ideas in Computer Science. Lecture 4: Deterministic Finite Automaton (DFA), Part 2

CSE 105 THEORY OF COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

CS 154, Lecture 3: DFA NFA, Regular Expressions

Intro to Theory of Computation

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo

CSE 105 Theory of Computation Professor Jeanne Ferrante

Finite Automata. Mahesh Viswanathan

CSC236 Week 10. Larry Zhang

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008

Computational Models - Lecture 1 1

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

DM17. Beregnelighed. Jacob Aae Mikkelsen

CS 581: Introduction to the Theory of Computation! Lecture 1!

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

CSC173 Workshop: 13 Sept. Notes

Chapter Five: Nondeterministic Finite Automata

CS243, Logic and Computation Nondeterministic finite automata

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

CSE 105 THEORY OF COMPUTATION

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r

Fooling Sets and. Lecture 5

Lecture 24: Randomized Complexity, Course Summary

Computational Models - Lecture 5 1

Computability and Complexity

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 9 : Myhill-Nerode Theorem and applications

Computational Models: Class 3

Computational Models - Lecture 4 1

CMP 309: Automata Theory, Computability and Formal Languages. Adapted from the work of Andrej Bogdanov

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Nondeterministic finite automata

Answers to the CSCE 551 Final Exam, April 30, 2008

Lecture 17: Language Recognition

Computational Models #1

Lecture 23 : Nondeterministic Finite Automata DRAFT Connection between Regular Expressions and Finite Automata

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,

Lecture 1: Finite State Automaton

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

Announcements. Problem Set Four due Thursday at 7:00PM (right before the midterm).

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

What we have done so far

Languages, regular languages, finite automata

Lecture 3: Nondeterministic Finite Automata

CSE 105 THEORY OF COMPUTATION

CSE 105 Theory of Computation

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

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

CSE 105 THEORY OF COMPUTATION

Theory Bridge Exam Example Questions

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u,

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

Finite Automata and Languages

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

Computational Models: Class 1

Nondeterministic Finite Automata

Automata Theory for Presburger Arithmetic Logic

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

Regular Languages and Finite Automata

Inf2A: The Pumping Lemma

CSE 105 THEORY OF COMPUTATION

3515ICT: Theory of Computation. Regular languages

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

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

Transcription:

5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY YOU NEED TO PICK UP THE SYLLABUS, THE COURSE SCHEDULE, THE PROJECT INFO SHEET, TODAY S CLASS NOTES

WWW.FLAC.WS

INSTRUCTORS & TAs Lenore Blum Aashish Jindia Andy Smith

Office Hours Lenore Blum (lblum@cs) Office Hours: Tues 2-3pm, Gates 75 Andy Smith (adsmith@andrew) Office Hours: Mon 6-8pm, GHC 7 Aashish Jindia (ajindia@andrew) Office Hours: Wed 6-8pm, GHC 7

Homework 25% Project 5% Class Participation 5+5% Final 25% Midterm II 5% Midterm I 5%

Homework 25% Project 5% Class Participation 5+5% Final 25% Midterm II 5% Midterm I 5%

HOMEWORK Homework will be assigned every Tuesday and will be due one week later at the beginning of class. Late homework will be accepted only under exceptional circumstances. All assignments must be typeset (exceptions allowed for diagrams). Each problem should be done on a separate page. You must list your collaborators (including yourself) and all references (including books, articles, websites, people) in every homework assignment in a References section at the end.

COURSE PROJECT Choose a (unique) topic Learn about your topic Write progress reports (Feb 6, March 22) Meet with an instructor/ta once a month Prepare a -minute presentation (April 24, April 29, May?) Final Report (May )

COURSE PROJECT Suggested places to look for project topics Any paper that has appeared in the proceedings of FOCS or STOC in the last 5 years. FOCS (Foundations of Computer Science) and STOC (Symposium on the Theory of Computing) are the two major conferences of general computer science theory. The proceedings of both conferences are available at the E&S library or electronically. Electronic version of the proceedings of STOC Electronic version of the proceedings of FOCS What's New]

This class is about mathematical models of computation

WHY SHOULD I CARE? WAYS OF THINKING THEORY CAN DRIVE PRACTICE Mathematical models of computation predated computers as we know them THIS STUFF IS USEFUL

Course Outline PART Automata and Languages: finite automata, regular languages, pushdown automata, context-free languages, pumping lemmas. PART 2 Computability Theory: Turing Machines, decidability, reducibility, the arithmetic hierarchy, the recursion theorem, the Post correspondence problem. PART 3 Complexity Theory and Applications: time complexity, classes P and NP, NP-completeness, space complexity, PSPACE, PSPACE-completeness, the polynomial hierarchy, randomized complexity, classes RP and BPP.

Mathematical Models of Computation (predated computers as we know them) PART Automata and Languages: finite automata, regular languages, pushdown automata, context-free languages, pumping lemmas. PART 2 Computability Theory: Turing Machines, decidability, reducibility, the arithmetic hierarchy, the recursion theorem, the Post correspondence problem. PART 3 94 s-5 s (neurophysiology, linguistics) 93 s-4 s (logic, decidability) 96 s-7 s (computers) Complexity Theory and Applications: time complexity, classes P and NP, NP-completeness, space complexity, PSPACE, PSPACE-completeness, the polynomial hierarchy, randomized complexity, classes RP and BPP.

This class will emphasize PROOFS A good proof should be: Easy to understand Correct

Suppose A {, 2,, 2n} with A = n+ TRUE or FALSE: There are always two numbers in A such that one divides the other TRUE

LEVEL HINT : THE PIGEONHOLE PRINCIPLE If you put 6 pigeons in 5 holes then at least one hole will have more than one pigeon

LEVEL HINT : THE PIGEONHOLE PRINCIPLE If you put 6 pigeons in 5 holes then at least one hole will have more than one pigeon

LEVEL HINT : THE PIGEONHOLE PRINCIPLE If you put n+ pigeons in n holes then at least one hole will have more than one pigeon HINT 2: Every integer a can be written as a = 2 k m, where m is an odd number

LEVEL 2 PROOF IDEA: Given: A {, 2,, 2n} and A = n+ Show: There is an integer m and elements a = a 2 in A such that a = 2 i m and a 2 = 2 j m

LEVEL 3 PROOF: Suppose A {, 2,, 2n} with A = n+ Write every number in A as a = 2 k m, where m is an odd number between and 2n- How many odd numbers in {,, 2n}? n Since A = n+, there must be two numbers in A with the same odd part Say a and a 2 have the same odd part m. Then a = 2 i m and a 2 = 2 j m, so one must divide the other

We expect your proofs to have three levels: The first level should be a one-word or one-phrase HINT of the proof (e.g. Proof by contradiction, Proof by induction, Follows from the pigeonhole principle ) The second level should be a short oneparagraph description or KEY IDEA The third level should be the FULL PROOF

DOUBLE STANDARDS? During the lectures, my proofs will usually only contain the first two levels and maybe part of the third

DETERMINISTIC FINITE AUTOMATA

DETERMINISTIC FINITE AUTOMATA and REGULAR LANGUAGES TUESDAY JAN 4

, Read string left to right The automaton accepts a string if the process ends in a double circle

ANATOMY OF A DETERMINISTIC states FINITE AUTOMATON q accept states (F), q q 2 start state (q ) q 3 states

SOME VOCABULARY An alphabet Σ is a finite set (e.g., Σ = {,}) A string over Σ is a finite-length sequence of elements of Σ Σ* = the set of strings over Σ For string x, x is the length of x The unique string of length will be denoted by ε and will be called the empty or null string A language over Σ is a set of strings over Σ In other words: a language is a subset of Σ*

deterministic DFA A ^ finite automaton ^ is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set of states (finite) Σ is the alphabet (finite) δ : Q Σ Q is the transition function q Q is the start state F Q is the set of accept/final states Suppose w,..., w n Σ and w = w... w n Σ* Then M accepts w iff there are r, r,..., r n Q, s.t. r = q δ(r i, w i+ ) = r i+, for i =,..., n-, and r n F

deterministic DFA A ^ finite automaton ^ is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set of states (finite) Σ is the alphabet (finite) δ : Q Σ Q is the transition function q Q is the start state F Q is the set of accept/final states M accepts ε iff q F L(M) = set of all strings that M accepts = the language recognized by M

q, L(M) =?

q, L(M) =?

q q L(M) =?

q q L(M) = { w w has an even number of s}

Q Σ q F M = ({p,q}, {,}, δ, p, {q}) δ p p q q q p p q

Q Σ q F M = ({p,q}, {,}, δ, p, {q}) δ p p q q q p p q THEOREM: L(M) = {w w has odd number of s }

Q Σ q F M = ({p,q}, {,}, δ, p, {q}) δ p p q q q p p q THEOREM: L(M) = {w w has odd number of s } Proof: By induction on n, the length of a string. Base Case: n=: ε RHS and ε L(M). Why?

Q Σ q F M = ({p,q}, {,}, δ, p, {q}) p q δ p p q q q p THEOREM: L(M) = {w w has odd number of s } Proof: By induction on n, the length of a string. Base Case: n=: ε RHS and ε L(M). Why? Induction Hypothesis: Suppose for all w Σ*, w = n, w L(M) iff w has odd number of s. Induction step: Any string of length n+ has the form w or w.

Q Σ q F M = ({p,q}, {,}, δ, p, {q}) p q δ p p q q q p THEOREM: L(M) = {w w has odd number of s } Proof: By induction on n, the length of a string. Base Case: n=: ε RHS and ε L(M). Why? Induction Hypothesis: Suppose for all w Σ*, w = n, w L(M) iff w has odd number of s. Induction step: Any string of length n+ has the form w or w. Now w has an odd # of s w has an odd # of s M is in state q after reading w (why?) M is in state q after reading w (why?) w L(M)

Q Σ q F M = ({p,q}, {,}, δ, p, {q}) p q δ p p q q q p THEOREM: L(M) = {w w has odd number of s } Proof: By induction on n, the length of a string. Base Case: n=: ε RHS and ε L(M). Why? Induction Hypothesis: Suppose for all w Σ*, w = n, w L(M) iff w has odd number of s. Induction step: Any string of length n+ has the form w or w. Now w has an odd # of s w has an even # of s M is in state p after reading w (why?) M is in state q after reading w (why?) w L(M) QED

Build a DFA that accepts all and only those strings that contain

Build a DFA that accepts all and only those strings that contain, q q q q

DEFINITION: A language L is regular if it is recognized by a DFA, i.e. if there is a DFA M s.t. L = L(M). L = { w w contains } is regular L = { w w has an even number of s} is regular

UNION THEOREM Given two languages, L and L 2, define the union of L and L 2 as L L 2 = { w w L or w L 2 } Theorem: The union of two regular languages is also a regular language

Theorem: The union of two regular languages is also a regular language Proof: Let M = (Q, Σ, δ, q, F ) be finite automaton for L and 2 M 2 = (Q 2, Σ, δ 2, q, F 2 ) be finite automaton for L 2 We want to construct a finite automaton M = (Q, Σ, δ, q, F) that recognizes L = L L 2

Idea: Run both M and M 2 at the same time! Q = pairs of states, one from M and one from M 2 = { (q, q 2 ) q Q and q 2 Q 2 } = Q Q 2 2 q = (q, q ) F = { (q, q 2 ) q F or q 2 F 2 } δ( (q,q 2 ), σ) = (δ (q, σ), δ 2 (q 2, σ))

Intersection THEOREM Given two languages, L and L 2, define the intersection of L and L 2 as L L 2 = { w w L and w L 2 } Theorem: The intersection of two regular languages is also a regular language

q q p p UNION? INTERSECTION?

UNION q,p q,p q,p q,p

INTERSECTION q,p q,p q,p q,p

Intersection THEOREM Given two languages, L and L 2, define the intersection of L and L 2 as L L 2 = { w w L and w L 2 } Theorem: The intersection of two regular languages is also a regular language

Show: L = { x {, 2, 3}* the digits, 2 and 3 appear in x in that order, but not necessarily consecutively} is regular.

Show: L = { x {,}* x ε and d(x) mod 3 } is regular. (d(x) is the natural # corresponding to x.)

WWW.FLAC.WS YOU NEED TO PICK UP THE SYLLABUS, THE COURSE SCHEDULE, THE PROJECT INFO SHEET, TODAY S CLASS NOTES Read Chapters,. and.2 of Sipser for next time, Also Rabin-Scott paper