CS 154 Formal Languages and Computability April 19 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.

Slides:



Advertisements
Similar presentations
Turing Machines (At last!). Designing Universal Computational Devices Was Not The Only Contribution from Alan Turing… Enter the year 1940: The world is.
Advertisements

CS 174: Web Programming April 28 Class Meeting
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Recursively Enumerable and Recursive Languages
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
Turing Machines.
Linear Bounded Automata LBAs
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
Fall 2003Costas Busch - RPI1 Turing Machines (TMs) Linear Bounded Automata (LBAs)
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 185C: The History of Computing August 24 Class Meeting Department of Computer Science San Jose State University Fall 2011 Instructor: Ron Mak
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
CS 151: Object-Oriented Design December 5 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 157B: Database Management Systems II March 18 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
CS 152: Programming Language Paradigms April 9 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak
CS 235: User Interface Design November 3 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
1 Section 14.2 A Hierarchy of Languages Context-Sensitive Languages A context-sensitive grammar has productions of the form xAz  xyz, where A is a nonterminal.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
CS 149: Operating Systems April 7 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
A Universal Turing Machine
CMPE 226 Database Systems November 18 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
CS 3240 – Chapters.  PDAs with 2 stacks or 1 queue  TMs with 1-way infinite tape  TMs with n tapes or n heads or n-dim tapes  TMs with various “move”
Turing Machine Finite state automaton –Limitation: finite amount of memory –Prevents recognizing languages that are not regular {0 n 1 n |n = 0,1,2,…}
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Recursively Enumerable Languages
CS 151: Object-Oriented Design October 29 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
Recursively Enumerable and Recursive Languages
CS 154 Formal Languages and Computability February 4 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
1 IDT Open Seminar ALAN TURING AND HIS LEGACY 100 Years Turing celebration Gordana Dodig Crnkovic, Computer Science and Network Department Mälardalen University.
CS 235: User Interface Design April 28 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 174: Web Programming November 16 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Summary of Previous Class There are languages that are not decidable –(we have not proved this yet) Why not extend Turing machines just as we did with.
CS 154 Formal Languages and Computability April 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability March 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability March 15 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 160 and CMPE/SE 131 Software Engineering May 12 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
CS 154 Formal Languages and Computability May 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability April 28 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 154 Formal Languages and Computability April 5 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 154 Formal Languages and Computability April 7 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
1 Recursively Enumerable and Recursive Languages.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Recursively Enumerable and Recursive Languages
Linear Bounded Automata LBAs
CMPE Database Systems Exercise #1 Solutions
Chapter 9 TURING MACHINES.
CMPE 135: Object-Oriented Analysis and Design December 6 Class Meeting
CMPE 152: Compiler Design December 6 Class Meeting
CMPE 152: Compiler Design November 29 Class Meeting
CMPE 135: Object-Oriented Analysis and Design November 29 Class Meeting Department of Computer Engineering San Jose State University Fall 2018 Instructor:
Formal Languages, Automata and Models of Computation
CMPE/SE 131 Software Engineering May 9 Class Meeting
CS 144 Advanced C++ Programming April 25 Class Meeting
Presentation transcript:

CS 154 Formal Languages and Computability April 19 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak 2 Unofficial Field Trip  Computer History Museum in Mt. View Provide your own transportation to the museum.  Saturday, May 14, 11:30 – closing time Special free admission (for my students only). Experience a fully restored IBM 1401 mainframe computer from the early 1960s in operation. Do a self-guided tour of the Revolution exhibit.

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak 3 Unofficial Field Trip, cont’d  IBM 1401 computer, fully restored and operational. A small transistor-based mainframe computer. Extremely popular with small businesses in the late 1950s through the mid 1960s  Maximum of 16K bytes of memory.  800 card/minute card reader (wire brushes).  600 line/minute line printer (impact).  6 magnetic tape drives, no disk drives.

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak Unofficial Field Trip, cont’d  Information on the IBM 1401: General info: My summer seminar: Restoration: thelen.org/1401Project/1401RestorationPage.htmlhttp://ed- thelen.org/1401Project/1401RestorationPage.html 4

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak 5 Unofficial Field Trip, cont’d  See the extensive Revolution exhibit! Walk through a timeline of the First 2000 Years of Computing History. Historic computer systems, data processing equipment, and other artifacts. Small theater presentations. Atanasoff-Berry Computer Hollerith Census Machine

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak 6 Unofficial Field Trip, cont’d  There may be extra credit if you participate in the visit to the Computer History Museum. If I find the time to put together a Canvas quiz.  Correct answers will be found among the museum exhibits and presentations. You will have to read the exhibit labels, listen to the audio, and watch the videos.  Each correct answer adds one point to your midterm score.

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak A Universal Turing Machine  A Turing machine is not just a special-purpose computer that, once defined, can carry out only one type of computation.  A Turing machine is equivalent to a modern general-purpose computer.  A universal Turing machine M u is reprogrammable.  An M u takes another TM as input and simulates the other TM. 7

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak A Universal Turing Machine, cont’d  Given another TM M and an input string w, a universal TM M u can simulate the computation of M on w. TM M must be properly encoded. Example: Encode δ(q 1, a 2 ) = (q 2, a 3, L) as

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak A Universal Turing Machine, cont’d  Now we can claim the existence of a Turing machine that, given any program, can carry out the computations specified by that program and is therefore a proper model for a general-purpose computer. 9

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak Countable Sets  An infinite set is countable if there is a one-to-one correspondence between its elements and the positive integers. We can list the elements of the set in some order.  Example: The set of all even integers is countable. You can write them in the order 0, 2, 4, … and each element 2 n corresponds to n

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak Countable Sets, cont’d  The set of all rational numbers p/q are countable, where p and q are positive integers.  Generates the order: … … ….:.:.:.:.:.: …

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak Countable Sets, cont’d  A set is countable if we can specify an enumeration procedure by which we can list its elements in some sequence.  An enumeration procedure is a mechanical process that can be carried out by a Turing machine.  A proper order is a sequence of strings from an infinite set where the length of the strings is the first criterion. 12

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak Proper Order  Let S be an infinite set of strings over {a, b, c}.  We cannot simply sort the strings alphabetically. There are an infinite number of a words. We would never get to the b words.  The proper order uses the string length as the first sorting criterion. Then the sequence is Therefore, S is countable. 13 a, b, c, aa, ab, ac, ba, bb, bc, ca, cb, cc, aaa, …

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak Turing Machines are Countable  The set of all Turing machines, though infinite, is countable.  The enumeration procedure: Encode each Turing machine using 0 and 1. Generate all strings in {0, 1} in proper order. Check each generated string to see if it defines a Turing machine. If yes, write down the string. If not, ignore the string. Eventually, every Turing machine will be generated. 14

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak Limited Forms of Turing Machines  We cannot build a more powerful Turing machine, but we can limit its power.  A pushdown automaton is a limited form of Turing machine. The input tape can only be used as a stack.  A linear bounded automaton (LBA) is another limited form of Turing machine. The machine can only use the part of the tape occupied by the input. More space is available for longer input strings. 15

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak Linear Bounded Automata  Bracket he input of an LBA with the end marker symbols [ and ]. For input string w, the initial configuration is q 0 [w].  The read-write head cannot move to the left of [ or to the right of ]. The head bounces off the end markers.  LBAs are more powerful than pushdown automata. LBAs can accept languages that are not context-free. 16

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak Recursively Enumerable Languages  A language L is recursively enumerable if there exists a Turing machine that accepts it.  For every string w in L, there exists a Turing machine that will read w and halt in a final state.  What happens if w is not in L is unspecified. The Turing machine can halt in a nonfinal state. The Turing machine can go into an infinite loop and never halt. 17

Computer Science Dept. Spring 2016: April 14 CS 154: Formal Languages and Computability © R. Mak Recursive Languages  A language L is recursive if there exists a Turing machine that accepts it and the machine will halt on every input string w, whether or not w is in L. 18