October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 1 Finite Automata Example 2: Can we build a finite automaton that.

Slides:



Advertisements
Similar presentations
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Advertisements

Natural Language Processing - Formal Language - (formal) Language (formal) Grammar.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Theory of Computation What types of things are computable? How can we demonstrate what things are computable?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Lecture 5 Turing Machines
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
November 3, 2009Introduction to Cognitive Science Lecture 15: Theory of Computation II 1 Languages Accepted by Turing Machines Example 2: Language L =
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Turing Machines CS 105: Introduction to Computer Science.
CSC 361Finite Automata1. CSC 361Finite Automata2 Formal Specification of Languages Generators Grammars Context-free Regular Regular Expressions Recognizers.
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
Great Theoretical Ideas in Computer Science.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Complexity and Computability Theory I Lecture #13 Instructor: Rina Zviel-Girshin Lea Epstein Yael Moses.
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
CS/IT 138 THEORY OF COMPUTATION Chapter 1 Introduction to the Theory of Computation.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Formal Methods in SE Theory of Automata Qasiar Javaid Assistant Professor Lecture # 06.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 INFO 2950 Prof. Carla Gomes Module Modeling Computation: Language Recognition Rosen, Chapter 12.4.
Finite State Automata / Machines and Turing Machines.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Great Theoretical Ideas in Computer Science.
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
Lecture # 22. PDA of language {a n b n : n=0,1,2,3, …}
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
© M. Winter COSC/MATH 4P61 - Theory of Computation CFL are closed under Substitution Union Concatenation Closure (*) Homomorphism Reversal Intersection.
CS 203: Introduction to Formal Languages and Automata
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
September1999 CMSC 203 / 0201 Fall 2002 Week #15 – 2/4/6 December 2002 Prof. Marie desJardins.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich
CSCI 2670 Introduction to Theory of Computing October 7, 2004.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Great Theoretical Ideas in Computer Science for Some.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
December 3, 2009Theory of Computation Lecture 21: Turing Machines III 1 Simulation of T in L Now the MIDDLE section of Q can be generated by replacing.
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
 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.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CSCI 2670 Introduction to Theory of Computing September 29, 2005.
Theory of Computation Automata Theory Dr. Ayman Srour.
Lecture 01: Theory of Automata:2013 Asif Nawaz Theory of Automata.
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
CSE202: Introduction to Formal Languages and Automata Theory
Busch Complexity Lectures: Turing Machines
Natural Language Processing - Formal Language -
Theory of Computation Lecture 22: Turing Machines III
Chapter 9 TURING MACHINES.
Chapter 3: The CHURCH-Turing thesis
Jaya Krishna, M.Tech, Assistant Professor
COSC 3340: Introduction to Theory of Computation
Theory of Computation Lecture 23: Turing Machines III
Presentation transcript:

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 1 Finite Automata Example 2: Can we build a finite automaton that accepts the language L = {a [n] b [n] | n > 0}? That is, the language of all words that start with a sequence of a’s followed by the same number of b’s. No, because with our finite number of states we have no way to memorize any number of a’s and determine whether it matches the number of b’s. But can we build such an automaton if we set an upper limit for n? Yes, we can!

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 2 Finite Automata Example 3: A finite automaton that accepts L = {a [n] b [n] | 0 < n  2} = {ab, aabb}: q1q1q1q1 q6q6q6q6 q4q4q4q4 a,b b q2q2q2q2 q3q3q3q3 a b a,b a b a q5q5q5q5b a

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 3 Regular Languages The languages accepted by finite automata are called the regular languages. To understand the complexity of these languages, we need to introduce some string operations: Union: If A = {hello, world} and B = {here, I, am}, then A  B = {hello, world, here, I, am} Concatenation: If A = {mouse, house} and B = {cat,hat}, then A  B = {mousecat, mousehat, housecat, househat}. Star Closure: If A = {wow, cool}, then A* = {0, wow, cool, wowwow, wowcool, coolwow, coolcool, wowcoolwow, coolcoolcool, …}

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 4 Regular Languages The class of regular languages is defined as follows: (a) The empty language (containing no word) is a regular language. (b) The language containing only the empty word (containing no letters) is a regular language. (c) The language containing only a one-symbol word ({a}, {b}, …) is a regular language. (d) If A and B are regular languages, then A  B, A  B, and A* are regular languages. (e) No other languages are regular.

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 5 Regular Languages: Examples What languages are specified by the following regular expressions: r = {1}* L(r) = {0, 1, 11, 111, …} r = {2}  {1} L(r) = {21} r = ({2}  {2}  {1})  ({3}  {1}) L(r) = {221, 31} r = (({3}  {1})  ({1}  {2}))* L(r) = {0, 31, 12, 3112, 1231, 3131, , …} r = {1}  ({1}  {2}  {3})*  {2} L(r) = {12, 132, 112, 122, 1312, 12232, …}

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 6 Regular Languages: Examples Here is a difficult one: What language is described by the following regular expression? r = ({x}  {y})*  {x}  {x}  ({x}  {y})* L(r) = {xx, xxx, yxx, yxxy, xyxxyy, …} The language of all strings of xs and ys containing at least two consecutive xs.

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 7 Turing Machines Now what happens if we remove the restriction on memory and its accessibility? This gives us Turing’s original theoretical concept of a computer, the Turing machine. Just like a finite automaton, the Turing machine’s next state is always determined by its current state and the current symbol under the head. However, each transition also includes printing a symbol or moving the head one square to the left or right. This way the tape serves as unlimited, freely accessible memory.

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 8 Languages Accepted by Turing Machines Notation: “If we are in state q 1 and read symbol a, the head moves one position to the right, and the state changes to q 2 :” q1q1q1q1 q2q2q2q2a/R “If we are in state q 4 and read symbol b, the head moves one position to the left, and the state changes to q 3 :” q4q4q4q4 q3q3q3q3b/L “If we are in state q 3 and read symbol B, the head writes the symbol c and does not move, and the state changes to q 1 :” q3q3q3q3 q1q1q1q1B/c

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 9 Turing Machines The input is written to the tape before the Turing machine is started. The tape head is set onto the leftmost symbol of the input string. All cells to the left and to the right of the input string are initialized with the blank symbol B. The Turing machine halts if there is no transition and accepts the input if its last state was an accepting one.

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 10 Languages Accepted by Turing Machines Now let us take a look at examples for Turing machines and the languages they accept. Example 1: Language L = {bb, bab, baab, baaab, …} on the alphabet {a, b}. q 4 is the only accepting state. q1q1q1q1 q2q2q2q2 q3q3q3q3b/R a/R b/RB/R q4q4q4q4

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 11 Languages Accepted by Turing Machines Example 2: Language L = {a [n] b [n] | n > 0} on the alphabet {a, b}. q7q7q7q7 q1q1q1q1 q2q2q2q2 B/Ba/B q3q3q3q3 q8q8q8q8 q6q6q6q6 q5q5q5q5b/L a/L b/L B/L q4q4q4q4b/B B/R a/R b/R B/L B/R

October 29, 2009Introduction to Cognitive Science Lecture 14: Theory of Computation I 12 TMs as Computers Church’s thesis: Any function that can be algorithmically computed can also be computed by a Turing machine. Why is it only a thesis? There is no general mathematical definition of algorithm – it is always specific to a particular scheme, i.e., a programming language. Therefore, Church’s thesis cannot be proved. However, no counterexample has been found, and no scientist seriously doubts that Church’s thesis is correct.