MA/CSSE 474 Theory of Computation Course Intro More about strings and languages.

Slides:



Advertisements
Similar presentations
8/25/2009 Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 1 Theory of Computation Course information Overview of the area Finite Automata Sofya.
Advertisements

Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
CS 355 – Programming Languages
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Computability (Chapter 2) ICS 535 Design and Implementation.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
© Love Ekenberg The Algorithm Concept, Big O Notation, and Program Verification Love Ekenberg.
Normal forms for Context-Free Grammars
Introduction to CS Theory Lecture 1 – Introduction Piotr Faliszewski
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
MA/CSSE 474 Theory of Computation Course Intro. Today's Agenda Student questions Overview of yesterday's proof –I placed online a "straight-line" writeup.
1 Theory of Computation 計算理論 2 Instructor: 顏嗣鈞 Web: Time: 9:10-12:10 PM, Monday Place: BL 103.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
AUTOMATA THEORY Reference Introduction to Automata Theory Languages and Computation Hopcraft, Ullman and Motwani.
1 Chapter 1 Automata: the Methods & the Madness Angkor Wat, Cambodia.
1 CSSE 350 Automata, Formal Languages, and Computability.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
MA/CSSE 474 Theory of Computation DFSM Canonical Form Proof of NDFSM  DFSM ALGORITHM (as much as we have time for) This version includes the "answers"
MA/CSSE 474 Theory of Computation Functions, Closure, Decision Problems.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
MA/CSSE 474 Theory of Computation Decision Problems DFSMs.
Languages and Strings Chapter 2. (1) Lexical analysis: Scan the program and break it up into variable names, numbers, etc. (2) Parsing: Create a tree.
Theory of Computation, Feodor F. Dragan, Kent State University 1 TheoryofComputation Spring, 2015 (Feodor F. Dragan) Department of Computer Science Kent.
Why Study the Theory of Computation? Implementations come and go. Chapter 1.
Chapter 3 Part II Describing Syntax and Semantics.
1 Theory of Computation 計算理論 2 Instructor: 顏嗣鈞 Web: Time: 9:10-12:10 PM, Monday Place: BL.
1 / 48 Formal a Language Theory and Describing Semantics Principles of Programming Languages 4.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
CS 203: Introduction to Formal Languages and Automata
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
Languages and Strings Chapter 2.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Finite-State Machines Fundamental Data Structures and Algorithms Peter Lee March 11, 2003.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
MA/CSSE 474 Theory of Computation How many regular/non-regular languages are there? Closure properties of Regular Languages (if there is time) Pumping.
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
Week 14 - Friday.  What did we talk about last time?  Simplifying FSAs  Quotient automata.
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
Languages and Strings Chapter 2. (1) Lexical analysis: Scan the program and break it up into variable names, numbers, etc. (2) Parsing: Create a tree.
Introduction to Automata Theory
Theory of Computation. Introduction We study this course in order to answer the following questions: What are the fundamental capabilities and limitations.
Introduction to formal languages and automata
Why do we study Theory of Computation ?
CIS Automata and Formal Languages – Pei Wang
CSE 311 Foundations of Computing I
CSCI 2670 Introduction to Theory of Computing
MA/CSSE 473 Day 02 Some Numeric Algorithms and their Analysis
CSE 105 theory of computation
Languages, prefixes, sets, cardinality, functions
HIERARCHY THEOREMS Hu Rui Prof. Takahashi laboratory
Introduction to Automata Theory
Intro to Theory of Computation
CSCE 411 Design and Analysis of Algorithms
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
MA/CSSE 474 Theory of Computation
Languages, prefixes, sets, cardinality, functions
More on showing L non-regular
MA/CSSE 474 Theory of Computation
CSE 105 theory of computation
Minimize # states in a DFSM
CSCE 355 Foundations of Computation
Sofya Raskhodnikova; Intro Theory of Computation
CSE 105 theory of computation
Presentation transcript:

MA/CSSE 474 Theory of Computation Course Intro More about strings and languages

Today's Agenda Roll call Student questions Introductions and Course overview Overview of yesterday's proof –I placed online a "straight-line" write-up of the proof in detail, without the "here is how a proof works" commentary that was in the slides. See Session 1 resources on schedule page Responses to Reading Quiz 1 ( ) Languages and Strings (if time) Operations on Languages

Introductions Roll Call –If I mispronounce your name, or you want to be called by a nickname or different name than the Registrar lists for you, let me know. –I have had most of you in class, but for some of you it has been a long time. Graders: Andy Miller, Fred Zhang, James Edwards, Edna Jones, Cort Pugh, Jonathan Taylor Instructor: Claude Anderson: F-210, x8331 Random Note: I often put more on my PowerPoint slides for a day than I expect we can actually cover that day, "just in case".

Instructor Professional Background Formal Education: –BS Caltech, Mathematics 1975 –Ph.D. Illinois, Mathematics 1981 –MS Indiana, Computer Science 1987 Teaching: –TA at Illinois, Indiana , –Wilkes College (now Wilkes University) –RHIT 1988 – 2022? Major Consulting Gigs: –Pennsylvania Funeral Directors Assn –Navistar International –Beckman Coulter –ANGEL Learning Theory of Computation history See optional video on Moodle for some personal background

Why Study the Theory of Computation? Why not just write programs? Implementations come and go. We want to address larger issues, such as –What is computable? –What is tractable?

Timeless Abstractions Mathematical properties of problems and algorithms Do not depend on technology or programming style The basic principles remain the same: –What can be computed, and what cannot? –What are reasonable mathematical models of computation?

More Detailed Questions Does a computational solution to the problem exist? –Without regard to limitations of processor speed or memory size. –If not, is there a restricted but useful variation of the problem for which a solution does exist? If a solution exists, can it be implemented using some fixed amount of memory? If a solution exists, how efficient is it? –More specifically, how do its time and space requirements grow as the size of the problem grows? Are there groups of problems that are equivalent in the sense that if there is an efficient solution to one member of the group there is an efficient solution to all the others?

Applications of the Theory Finite State Machines (FSMs) for parity checkers, vending machines, communication protocols, and building security devices. Interactive games as nondeterministic FSMs. Programming languages, compilers, and context-free grammars. Natural languages are mostly context-free. Speech understanding systems use probabilistic FSMs. Computational biology: DNA and proteins are strings. The undecidability of a simple security model. Artificial intelligence: the undecidability of first-order logic.

(1) Lexical analysis: Scan the program and break it up into variable names, numbers, operators, punctuation, etc. (2) Parsing: Create a tree that corresponds to the sequence of operations that should be executed, e.g., / (3) Optimization: Realize that we can skip the first assignment since the value is never used, and that we can pre-compute the arithmetic expression, since it contains only constants. (4) Termination: Decide whether the program is guaranteed to halt. (5) Interpretation: Figure out what (if anything) useful it does. Some Language-related Problems int alpha, beta; alpha = 3; beta = (2 + 5) / 10;

A Framework for Analyzing Problems We need a single framework in which we can analyze a very diverse set of problems. The framework we will use is Language Recognition Most interesting problems can be restated as language recognition problems.

What we will focus on in 474 Definitions Theorems Examples Proofs A few applications, but mostly theory

Textbook Recent (as ToC books go) Thorough Literate Large (and larger!) Theory and Applications We’ll focus more on theory; applications are there for you to see

Online Materials Locations –On the Schedule page – public stuff Reading, HW, topics, resources, Suggestion: bookmark schedule page –On Moodle – personal stuff surveys, solutions, grades –On piazza.com: Discussion forums and announcements –Many things are under construction and subject to change, especially the course schedule.

My most time-consuming courses (for students) This is my perception, not a scientific study! 220 (object-oriented) 473 (design and analysis of algorithms) 120 (intro to software development) 280 (web programming) 304 (PLC) 404 (Compilers) 474 (Theory of Computation) 230 (Data Structures & Algorithms) The learning outcomes include a lot of difficult material. Most of you will need a lot practice in order to understand it.

Questions about course policies and procedures? From Syllabus? Schedule page? Things said in class yesterday? Anything else? Attendance? Late Days? When do I plan to be in my office and available for you most days?

Overview of yesterday's proof S = L(M), language accepted by M T = {w ∊ {0,1}* : w does not have 11 as substring} Show that S = T. i.e., S ⊆ T and T ⊆ S S ⊆ T: i.e. if wS, then wT –By induction on |w|, showed If δ(q0, w) = q0, w has no 11 and does not end in 1. If δ(q0, w) = q1, w has no 11 and ends in 1. T ⊆ S: i.e. if wT, then wS. –We show the contrapositive: if w ∉ S, then w ∉ T. If w ∉ S then δ(q0, w) = q2 (the only non-accepting state). Show by induction that if δ(q0, w) = q2, then w contains 11. This uses the property of q1 that was proved by induction as part of S ⊆ T.

Responses to Reading Quiz 1

From #4: ℘ ( ∅ ) = { ∅ } (not ℘ ( ∅ ) = ∅ ) What is ℘ ( ℘ ( ∅ ))? From #4: {a, b} X {1, 2, 3} X ∅ = ∅ #10: (representing {1, 4, 9, 16, 25, 36, …} in the form: {x  A : P(x)} {x ∊ ℕ : x>0 ∧ ∃ y ∊ℕ (y*y = x)} Why not {x ∊ ℕ : x>0 ∧ sqrt(x) ∊ ℕ } ? From #15:  x  ℕ (  y  ℕ (y < x)). Why is this not satisfiable? (e, g, by x=3, y=2)

Responses to Reading Quiz 1 #16: Let ℕ be the set of nonnegative integers. Let A be the set of nonnegative integers x such that x  3 0. Show that | ℕ | = |A|. Define a function f : ℕ →A by f(n) = 3n. f is one-to-one: if f(n) = f(m), then 3n = 3m, so m=n. f is onto: Let k ∊ A. Then k = 3m for some m ∊ ℕ. So k = f(m).

Responses to Reading Quiz 1 #18: Prove by induction:  n>0 (n!  2 n-1 ). Why is the following "proof" of the induction step shaky at best, perhaps wrong? (n+1)!  2 n what we're trying to show (n+1)n!  2(2 n-1 ) definitions of ! And exponents ( n+1 )  2 induction hypothesis (n!  2 n-1 ) Since n is at least 1, this statement is true, therefore (n+1)!  2 n is true.

Languages and Strings

A string is a finite sequence (possibly empty) of symbols from some finite alphabet .  is the empty string (some books/papers use instead)  * is the set of all possible strings over an alphabet  Counting: |s| is the number of symbols in s. |  | = 0| | = 7 # c (s) is the number of times that c occurs in s. # a ( abbaaa ) = 4. Properties of Strings

More Functions on Strings Concatenation: st is the concatenation of s and t. If x = good and y = bye, then xy = goodbye. Note that |xy| = |x| + |y|.  is the identity for concatenation of strings. So:  x (x  =  x = x). Concatenation is associative. So:  s, t, w ((st)w = s(tw)).

More Functions on Strings Replication: For each string w and each natural number i, the string w i is: w 0 = , w i+1 = w i w Examples: a 3 = aaa ( bye ) 2 = byebye a 0 b 3 = bbb Reverse: For each string w, w R is defined as: if |w| = 0 then w R = w =  if |w|  1 then:  a   (  u   * (w = ua)). So define w R = a u R.

Concatenation and Reverse of Strings Theorem: If w and x are strings, then (w x) R = x R w R. Example: ( nametag ) R = ( tag ) R ( name ) R = gateman Proof on next slide

Concatenation and Reverse of Strings Proof: By induction on |x|: |x| = 0: Then x = , and (wx) R = (w  ) R = (w) R =  w R =  R w R = x R w R.  n  0 (((|u| = n)  ((w u) R = u R w R ))  ((|x| = n + 1)  ((w x) R = x R w R ))): Consider any string x, where |x| = n + 1. Then x = u a for some symbol a and |u| = n. So: (w x) R = (w (u a)) R rewrite x as ua = ((w u) a) R associativity of concatenation = a (w u) R definition of reversal = a (u R w R )induction hypothesis = (a u R ) w R associativity of concatenation = (ua) R w R definition of reversal = x R w R rewrite ua as x