FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 www.cs.cmu.edu/~emc/flac09.

Slides:



Advertisements
Similar presentations
Lecture 24 MAS 714 Hartmut Klauck
Advertisements

CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Deterministic Finite Automata (DFA)
Fall 2006Costas Busch - RPI1 Non-regular languages (Pumping Lemma)
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
CS21 Decidability and Tractability
NFAs Sipser 1.2 (pages 47–54). CS 311 Fall Recall… Last time we showed that the class of regular languages is closed under: –Complement –Union.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
NFAs Sipser 1.2 (pages 47–54). CS 311 Mount Holyoke College 2 Recall… Last time we showed that the class of regular languages is closed under: –Complement.
Introduction to Computability Theory
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
CS5371 Theory of Computation
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
Courtesy Costas Busch - RPI1 Non-regular languages.
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
1 Non-regular languages. 2 Regular languages Non-regular languages.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Great Theoretical Ideas in Computer Science.
 2004 SDU Introduction to the Theory of Computation My name: 冯好娣 My office: 计算中心 430
Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { ‘{‘, ‘}’ } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite language,
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 7 Mälardalen University 2010.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
CSCI 2670 Introduction to Theory of Computing August 24, 2005.
1 Unit 1: Automata Theory and Formal Languages Readings 1, 2.2, 2.3.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Athasit Surarerks THEORY OF COMPUTATION 07 NON-DETERMINISTIC FINITE AUTOMATA 1.
Great Theoretical Ideas in Computer Science.
Languages Given an alphabet , we can make a word or string by concatenating the letters of . Concatenation of “x” and “y” is “xy” Typical example: 
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
THEORY OF COMPUTATION Komate AMPHAWAN 1. 2.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CS 203: Introduction to Formal Languages and Automata
Deterministic Finite Automata COMPSCI 102 Lecture 2.
August 23, 2005 CSCI 2670 Introduction to Theory of Computing August 23, 2005.
Lecture 2 Overview Topics What I forgot from last lecture Proof techniques continued Alphabets, strings, languages Automata June 2, 2015 CSCE 355 Foundations.
Lecture Notes 
Great Theoretical Ideas in Computer Science for Some.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Equivalence with FA * Any Regex can be converted to FA and vice versa, because: * Regex and FA are equivalent in their descriptive power ** Regular language.
 2004 SDU Lecture4 Regular Expressions.  2004 SDU 2 Regular expressions A third way to view regular languages. Say that R is a regular expression if.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
Week 14 - Friday.  What did we talk about last time?  Simplifying FSAs  Quotient automata.
Theory of Computation. Introduction to The Course Lectures: Room ( Sun. & Tue.: 8 am – 9:30 am) Instructor: Dr. Ayman Srour (Ph.D. in Computer Science).
CSCI 2670 Introduction to Theory of Computing
Formal Language & Automata Theory
Non-regular languages
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
COSC 3340: Introduction to Theory of Computation
CSE 2001: Introduction to Theory of Computation Fall 2009
Elementary Questions about Regular Languages
Non-regular languages
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Great Theoretical Ideas in Computer Science
Chapter 1 Regular Language
CSCE 355 Foundations of Computation
Presentation transcript:

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

INSTRUCTORS Will Klieber Yi Wu Edmund Clarke

Grading Exams: 50% - Final Exam: 25% - Midterm Exam: 25% Homework: 45% Class Participation: 5% Attendance is required.

HOMEWORK Homework will be assigned every Thursday and will be due one week later at the beginning of class You must list your collaborators and all references in every homework assignment. Readings will be posted on the course website. For next class: Read Chapters 0 and 1.1

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 1 Automata and Languages PART 2 Computability Theory PART 3 Complexity and Applications

Course Outline PART 1 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.

PART 1 Automata and Languages: (1940’s)‏ finite automata, regular languages, pushdown automata, context-free languages, pumping lemmas. PART 2 Computability Theory: (1930’s-40’s)‏ Turing Machines, decidability, reducibility, the arithmetic hierarchy, the recursion theorem, the Post correspondence problem. PART 3 Mathematical Models of Computation (predated computers as we know them)‏ Complexity Theory and Applications: (1960’s-70’s)‏ time complexity, classes P and NP, NP-completeness, space complexity PPACE, 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  {1, 2, …, 2n} TRUE or FALSE: There are always two numbers in A such that one divides the other with |A| = n+1 TRUE

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

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

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

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

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

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 one- paragraph 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

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

The machine accepts a string if the process ends in a double circle A Deterministic Finite Automaton (DFA) 0 0, states q0q0 q1q1 q2q2 q3q3

The machine accepts a string if the process ends in a double circle A Deterministic Finite Automaton (DFA) 0 0, q0q0 q1q1 q2q2 q3q3 start state (q 0 )‏ accept states (F)‏states

An alphabet Σ is a finite set (e.g., Σ = {0,1})‏ A string over Σ is a finite-length sequence of elements of Σ For x a string, |x| is the length of x The unique string of length 0 will be denoted by ε and will be called the empty or null string NOTATION A language over Σ is a set of strings over Σ, ie, a subset of Σ* Σ* denotes the set of finite length sequences of elements of Σ

Q is the set of states (finite)‏ Σ is the alphabet (finite)‏  : Q  Σ → Q is the transition function q 0  Q is the start state F  Q is the set of accept states A deterministic finite automaton (DFA) is represented by a 5-tuple M = (Q, Σ, , q 0, F) : Let w 1,..., w n  Σ and w = w 1... w n  Σ* Then M accepts w if there are r 0, r 1,..., r n  Q, s.t. r 0 =q 0  (r i, w i+1 ) = r i+1, for i = 0,..., n-1, and r n  F

Q is the set of states (finite)‏ Σ is the alphabet (finite)‏  : Q  Σ → Q is the transition function q 0  Q is the start state F  Q is the set of accept states L(M) = the language of machine M = set of all strings machine M accepts A deterministic finite automaton (DFA) is represented by a 5-tuple M = (Q, Σ, , q 0, F) :

0,1 q0q0 L(M) = {0,1}*

q0q0 q1q L(M) = { w | w has an even number of 1s}

qq q0q0 q ,1 Build an automaton that accepts all and only those strings that contain 001

A language L is regular if it is recognized by a deterministic finite automaton (DFA), i.e. if there is a DFA M such that L = L (M). L = { w | w contains 001} is regular L = { w | w has an even number of 1’s} is regular

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

Proof: Let M 1 = (Q 1, Σ,  1, q 0, F 1 ) be finite automaton for L 1 and M 2 = (Q 2, Σ,  2, q 0, F 2 ) be finite automaton for L 2 We want to construct a finite automaton M = (Q, Σ, , q 0, F) that recognizes L = L 1  L 2 1 2

Idea: Run both M 1 and M 2 at the same time! Q = pairs of states, one from M 1 and one from M 2 = { (q 1, q 2 ) | q 1  Q 1 and q 2  Q 2 } = Q 1  Q 2 q 0 = (q 0, q 0 )‏ 1 2 F = { (q 1, q 2 ) | q 1  F 1 or q 2  F 2 }  ( (q 1,q 2 ),  ) = (  1 (q 1,  ),  2 (q 2,  ))

Theorem: The union of two regular languages is also a regular language q0q0 q1q p0p0 p1p

q 0,p 0 q 1,p q 0,p 1 q 1,p

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

FLAC Read Chapters 0 and 1.1 of the book for next time