COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lecture 2 : Regular Expressions & DFAs

Similar documents
COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 5 : DFA minimization

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

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lecture 1 : Introduction

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 10 : Context-Free Grammars

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 16 : Turing Machines

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 14 : Turing Machines

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

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.

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

Agenda. What is a complexity class? What are the important complexity classes? How do you prove an algorithm is in a certain class

Lecture 23: More PSPACE-Complete, Randomized Complexity

Data Structures in Java

NP-Complete and Non-Computable Problems. COMP385 Dr. Ken Williams

1 Primals and Duals: Zero Sum Games

9. PSPACE 9. PSPACE. PSPACE complexity class quantified satisfiability planning problem PSPACE-complete

NP Completeness and Approximation Algorithms

9. PSPACE. PSPACE complexity class quantified satisfiability planning problem PSPACE-complete

1 More finite deterministic automata

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

Chapter 9. PSPACE: A Class of Problems Beyond NP. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

CSC 8301 Design & Analysis of Algorithms: Lower Bounds

Quantum Complexity Theory. Wim van Dam HP Labs MSRI UC Berkeley SQUINT 3 June 16, 2003

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

Introduction to the Theory of Computing

BBM402-Lecture 11: The Class NP

Final exam study sheet for CS3719 Turing machines and decidability.

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

CSC 1700 Analysis of Algorithms: P and NP Problems

CS 350 Algorithms and Complexity

Analysis of Algorithms. Unit 5 - Intractable Problems

Algorithms and Theory of Computation. Lecture 19: Class P and NP, Reduction

} } } Lecture 23: Computational Complexity. Lecture Overview. Definitions: EXP R. uncomputable/ undecidable P C EXP C R = = Examples

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

NP-Completeness. Until now we have been designing algorithms for specific problems

Acknowledgments 2. Part 0: Overview 17

Approximation Algorithms

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

CS 350 Algorithms and Complexity

Tractability. Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time?

The P versus NP Problem. Ker-I Ko. Stony Brook, New York

Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness

Lecture 4: NP and computational intractability

Lecture Notes 4. Issued 8 March 2018

Theory Bridge Exam Example Questions

3130CIT Theory of Computation

CS 154 Introduction to Automata and Complexity Theory

POLYNOMIAL SPACE QSAT. Games. Polynomial space cont d

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Data Structures in Java. Session 22 Instructor: Bert Huang

NP Complete Problems. COMP 215 Lecture 20

NP and NP Completeness

Computational Complexity

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

The Beauty and Joy of Computing

CS154, Lecture 17: conp, Oracles again, Space Complexity

Polynomial-time Reductions

Theory of Computation

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

DESIGN AND ANALYSIS OF ALGORITHMS. Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS

Unit 6 Chapter 17 TRACTABLE AND NON-TRACTABLE PROBLEMS

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

6.045J/18.400J: Automata, Computability and Complexity Final Exam. There are two sheets of scratch paper at the end of this exam.

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

Algorithm Design and Analysis

Theory of Computation Lecture 1. Dr. Nahla Belal

Lecture 22: PSPACE

SE 2FA3: Discrete Mathematics and Logic II. Teaching Assistants: Yasmine Sharoda,

CP405 Theory of Computation

NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20

Computational Complexity

The Beauty and Joy of Computing

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

The P-vs-NP problem. Andrés E. Caicedo. September 10, 2011

Computational Models - Lecture 4

conp, Oracles, Space Complexity

SAT, NP, NP-Completeness

-bit integers are all in ThC. Th The following problems are complete for PSPACE NPSPACE ATIME QSAT, GEOGRAPHY, SUCCINCT REACH.

Introduction to Complexity Theory

COSE215: Theory of Computation. Lecture 20 P, NP, and NP-Complete Problems

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

P and NP. Warm Up: Super Hard Problems. Overview. Problem Classification. Tools for classifying problems according to relative hardness.

6.840 Language Membership

Foundations of Informatics: a Bridging Course

Algorithms. Sudoku. Rubik s cube. Evaluating how good (how efficient) an algorithm is 3/4/17. Algorithms, complexity and P vs NP SURVEY

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

6.045 Final Exam Solutions

Theory of Computation CS3102 Spring 2015 A tale of computers, math, problem solving, life, love and tragic death

UNIT-VIII COMPUTABILITY THEORY

CS/COE

What we have done so far

Algorithms: COMP3121/3821/9101/9801

NP-Complete Reductions 1

Automata Theory, Computability and Complexity

Lecture 19: Finish NP-Completeness, conp and Friends

Limitations of Algorithm Power

1. Introduction Recap

CSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal?

Transcription:

COMP-330 Theory of Computation Fall 2017 -- Prof. Claude Crépeau Lecture 2 : Regular Expressions & DFAs

COMP 330 Fall 2017: Lectures Schedule 1-2. Introduction 1.5. Some basic mathematics 2-3. Deterministic finite automata +Closure properties, 3-4. Nondeterministic finite automata 5. Minimization+ Myhill-Nerode theorem 6. Determinization+Kleene s theorem 7. Regular Expressions+GNFA 8. Regular Expressions and Languages 9-10. The pumping lemma 11. Duality 12. Labelled transition systems 13. MIDTERM 14. Context-free languages 15. Pushdown automata 16. Parsing 17. The pumping lemma for CFLs 18. Introduction to computability 19. Models of computation Basic computability theory 20. Reducibility, undecidability and Rice s theorem 21. Undecidable problems about CFGs 22. Post Correspondence Problem 23. Validity of FOL is RE / Gödel s and Tarski s thms 24. Universality / The recursion theorem 25. Degrees of undecidability 26. Introduction to complexity

Simple Puzzle Bremner and MacLeod looked at what happens when we replace the 4 with something else. When you try to represent 178 in this way, you ll need 398,605,460 digits. If you try 896, you ll be up to trillions of digits 95% of people cannot solve this! 99.9999% + + = 4 + + +. Can you find positive whole values for,, and? =154476802108746166441951315019919837485664325669565431700026634898253202035277999 =36875131794129999827197811565225474825492979968971970996283137471637224634055579 =4373612677928697257861252602371390152816537558161613618621437993378423467772036

Not all problems were born equal...

Is it possible to paint a colour on each region (province) of a map so that no neighbours are of the same colour? Vietnam

Obviously, yes, if you can use as many colours as you like... Vietnam

2-colouring problem Vietnam

2-colouring problem

3-colouring problem Vietnam

3-colouring problem

4-colouring problem Vietnam

K-colouring of Maps (planar graphs) K=1, only the maps with zero or one region are 1-colourable. K=2, easy to decide. Impossible as soon as 3 regions touch each other. K=3, No known efficient algorithm to decide. However it is easy to verify a solution. K 4, all maps are K-colourable. (looong proof) Not easy to find a K-colouring. However it is easy to verify a solution. http://people.math.gatech.edu/~thomas/fc/fourcolor.html

3-colouring of Maps Seems hard to solve in general, Is easy to verify when a solution is given, Is a special type of problem (NP-complete) because an efficient solution to it would yield efficient solutions to MANY similar problems!

Examples of NP-Complete Problems SAT: given a boolean formula, is there an assignment of the variables making the formula evaluate to true? Travelling Salesman: given a set of cities and distances between them, what is the shortest route to visit each city once. KnapSack: given items with various weights, is there of subset of them of total weight K.

NP-Complete Problems Many practical problems are NP-complete. If any of them is easy, they are all easy. In practice, some of them may be solved efficiently in some special cases. Some books list hundreds of such problems.

Tractable Problems (P) 2-colorability of maps. Primality testing. (but probably not factoring) Solving NxNxN Rubik s cube. Finding a word in a dictionary. Sorting elements.

Tractable Problems (P) Fortunately, many practical problems are tractable. The name P stands for Polynomial- Time computable. Computer Science studies mostly techniques to approach and find efficient solutions to tractable problems. Some problems may be efficiently solvable but we might not be able to prove that...

Complexity Theory Decidable Languages complete NP P P = NP?

Beyond NP-Completeness PSpace Completeness: problems that require a reasonable (Poly) amount of space to be solved but may use very long time though. Many such problems. If any of them may be solved within reasonable (Poly) amount of time, then all of them can.

PSpace Completeness Geography Game: Given a set of country names: Arabia, Cuba, Canada, France, Italy, Japan, Korea, Vietnam A two player game: One player chooses a name. The other player must choose a name that starts with the last letter of the previous name and so on. A player wins when his opponent cannot play any name.

Generalized Geography Given an arbitrary set of names: w 1,..., w n. Is there a winning strategy for the first player to the previous game?

Complexity Theory Decidable Languages complete PSpace NP P NP = PSpace?

Theoretical Computer Science Challenges of TCS: FIND efficient solutions to many problems. (Algorithms and Data Structures) PROVE that certain problems are NOT computable within a certain time or space. Consider new models of computation. (Such as a Quantum Computer)

Regular expressions, and Deterministic Finite Automata

Regular expressions, and Deterministic Finite Automata

Swing doors

Swing doors

Swing doors

Swing doors

Swing doors

Elevators

Elevators

Elevators

Elevators

M 1 DFA: example

Definition of DFA States q2 q1 Alphabet a,b,c,d Accept states b q1 Transition function Start state q3 q1 q2 q2

Definition of DFA

M 1 10010101 q1

M1 10010101 1 q2 q2

M1 10010101 0 q3 q3

M1 10010101 q2 0 q2

M1 10010101 1 q2 q2

M1 10010101 0 q3 q3

M1 10010101 q2 1 q2

M1 10010101 0 q3 q3

M1 10010101 q2 1 q2

M1 10010101 q2

COMP-330 Theory of Computation Fall 2017 -- Prof. Claude Crépeau Lecture 2 : Regular Expressions & DFAs