CAs and Turing Machines. The Basis for Universal Computation

Similar documents
6.080 / Great Ideas in Theoretical Computer Science Spring 2008

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

Turing Machines: An Introduction

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Notes on Complexity Theory Last updated: August, Lecture 1

Turing Machines, Part I

Turing Machines, Busy Beavers, and Big Questions about Computing

3515ICT Theory of Computation Turing Machines

Computational Models Lecture 8, Spring 2009

Theory of Computation Chapter 2: Turing Machines

Reading 13 : Finite State Automata and Regular Expressions

Computability Theory

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

24 Uses of Turing Machines

The Halting Problem is Undecidable

Automata and Formal Languages

Finite Automata and Formal Languages

Properties of Stabilizing Computations

6.080/6.089 GITCS Feb 12, Lecture 3

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

Introduction to Turing Machines

Regular Languages and Finite State Machines

Automata and Computability. Solutions to Exercises

C H A P T E R Regular Expressions regular expression

Session 7 Fractions and Decimals

Universality in the theory of algorithms and computer science

Lecture 2: Universality

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

THEORY of COMPUTATION

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

How To Compare A Markov Algorithm To A Turing Machine

Computer Science Theory. From the course description:

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

Parts of a Computer. Preparation. Objectives. Standards. Materials Micron Technology Foundation, Inc. All Rights Reserved

Introduction to Automata Theory. Reading: Chapter 1

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Oracle Turing machines faced with the verification problem

NP-Completeness and Cook s Theorem

The computer's internal components

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 4 Nancy Lynch

Windows Server Performance Monitoring

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

What you should know about: Windows 7. What s changed? Why does it matter to me? Do I have to upgrade? Tim Wakeling

Count the Dots Binary Numbers

Grade 7/8 Math Circles Sequences and Series

Regular Expressions and Automata using Haskell

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

How to Make the Most of Excel Spreadsheets

Chapter 2. Making Shapes

How To Understand The Relation Between Simplicity And Probability In Computer Science

Tech Application Chapter 3 STUDY GUIDE

Introduction to computer science

FINITE STATE AND TURING MACHINES

Writing Thesis Defense Papers

Section 4.1 Rules of Exponents

Reliably computing cellular automaton, in 1-sparse noise

Quantum Computing. Robert Sizemore

1 Description of The Simpletron

Chapter 1. Computation theory

An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008

Graph Theory Problems and Solutions

Super Turing-Machines

Outline 2. 1 Turing Machines. 2 Coding and Universality. 3 The Busy Beaver Problem. 4 Wolfram Prize. 5 Church-Turing Thesis.

3. Mathematical Induction

Vieta s Formulas and the Identity Theorem

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

1. The RSA algorithm In this chapter, we ll learn how the RSA algorithm works.

Writing Assignment #2 due Today (5:00pm) - Post on your CSC101 webpage - Ask if you have questions! Lab #2 Today. Quiz #1 Tomorrow (Lectures 1-7)

Finite Automata. Reading: Chapter 2

How To Understand The Theory Of Computer Science

Deposit Direct. Getting Started Guide

(Refer Slide Time: 2:03)

Digital Persona Fingerprint Reader Installation

Braille: Deciphering the Code Adapted from American Foundation for the Blind

Circuits and Boolean Expressions

Process / Operation Symbols

Universal Turing Machine: A Model for all Computational Problems

Programming Tricks For Reducing Storage And Work Space Curtis A. Smith, Defense Contract Audit Agency, La Mirada, CA.

The Hexadecimal Number System and Memory Addressing

Page 18. Using Software To Make More Money With Surveys. Visit us on the web at:

Python Programming: An Introduction to Computer Science

Lab 4.4 Secret Messages: Indexing, Arrays, and Iteration

Anyone Can Learn PROC TABULATE

Section 1.5 Exponents, Square Roots, and the Order of Operations

Linear Programming Notes VII Sensitivity Analysis

VHDL Test Bench Tutorial

Informatique Fondamentale IMA S8

OA3-10 Patterns in Addition Tables

Basic Concepts of Set Theory, Functions and Relations

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

Fundamentele Informatica II

=

Base Conversion written by Cathy Saxton

Regular Languages and Finite Automata

Transcription:

CAs and Turing Machines The Basis for Universal Computation

What We Mean By Universal When we claim universal computation we mean that the CA is capable of calculating anything that could possibly be calculated*. It takes some input, runs a program, and produces some output. Or really, we mean it can calculate any algorithm. Algorithms are a well-defined finite sequence of instructions that will always terminate (eventually) with an answer. Oh, get it? Those are just computer programs. *Some things are impossible to calculate with any computer.

Your Laptop Is Universal So how about your desktop or laptop? Intuitively, you know it is universal you ve used it enough to know it can do just about anything with the correct hardware and software. You know it will run any algorithm (program). So let s dissect your computer and see what s inside. That will help us see what parts of a CA correspond to the parts of your real computer.

Parts of a Computer output input

Guts of a Computer More I/O (CDs, USB, etc.) Processor (on mother board ) Memory cards (RAM) Power supply

Important Parts: Power Supply? No, not power supply! Turns out energy is unnecessary for computation. Why? Can make reversible computers. Kind of like reversible CA! Copying or measuring a bit is ultimately free. Just can t erase anything that costs energy (increases entropy). So don t erase anything just copy bits into new space. All information is preserved (nothing erased) so no energy expended. Cool proof by Landauer. Ok, so we can t build a powerless computer yet (but we re working on it).

Important Parts Input Yes, need a way to get the program (algorithm) and the data (initial state) into the machine. Output Yes, need a way to get the result of the computation. But could share with the input device! E.g., read and write from the same disk. Memory Yes, need a place for temporary storage. But could share the input and output device! E.g., read, write, and store temporarily on the same disk. Processor Yes, need something that actually does the calculation. Typically filled with lots of boolean gates or circuits. And has a clock. Keeps all the operations in sync.

Parts of CA Computers Have to be built from the same parts! Memory/input/output Processor and clock Turing in 1936 mathematically formalized these parts. Was interested in what can and can t be computed. Created very simple concept of a Turing Machine (TM) built from these parts. So we ll start with TMs and then show equivalence to some CA.

Turing Machine Has a finite-sized control. The processor. Has a tape and a tape head. For reading, writing, memory on the tape. Tape can be magnetic (like floppy disk), paper, legos, piles of cookies, etc. Tape is infinite! Ok, so that is one difference. But practically speaking we can create as big a tape as we would like for our desktop.

Turing Machine Picture Blank tape (often written with the symbol #) # 0 1 0 1 0 0 1 0 # # # #... Tape head for reading and writing Tape with symbols (I/O and memory) Put you program and data here! q 4 q 0 q 1 q 3 q 2 Finite control (processor)

Finite State Control This is just an automata. Take automata theory. Has a finite number of states q o through q n. The current state is indicated by the arrow. At discrete steps (the clock!), the automata does two things. 1. State changes to a new q i that depends on (1) the current state, and (2) the symbol on the tape. q 4 q 3 q 0 q 1 q 2 2. Either writes a new symbol on the tape, or moves tape head left or right to a new position.

How s That Transition Work? Define the transition from one state to another as d(q i, X) = (q j, Y, D) where q i is the current state q j is the next state X is the current symbol on the tape Y is the symbol that is written in place of X D is the direction that the tape head moves L = left, R = right, S = stay put

Picture of Transition Function Draw transition d(q i, X) = (q j, Y, D) as q i X/Y, D q j So can draw entire TM this way show all possible transitions

Example TM: Accept Input With aba Looks like a typical automata! (Take Automata Theory.) This TM accepts all strings that contain a substring aba. Assumes an alphabet of a, b, and # (could be 0, 1, and #). Program quits when reaches h a or h r. h a is an accepting state indicating that input does contain aba. h r is a reject state indicating that input does not contain aba. b/b, R h r #/#, R #/#, R q 0 q 1 #/#, R #/#, R a/a, R a/a, R q 2 q 3 h a b/b, R a/a, R Try it! b/b, R tape not shown

TM Example: n mod 2 This TM calculates n mod 2. Assumes an alphabet of 1 and # (could be 0, 1, and #). Represents a number in unary. E.g., 1111 is 4, 11111 is 5. On tape will leave a single 1 or nothing. 1/1, R #/#, R #/#, R q 0 q 1 #/#, L 1/#, L q 2 q 3 q 4 h a 1/#, L #/#, R #/1, R Try it on #111# and #1111# tape not shown

So What s the Big Deal? This simple computer is as powerful as it gets. Extensions to the model add no new power. Extra tape heads, two-dimensional tapes, etc. Or even CD-ROMS, USB ports, etc. Lots of proofs of this. Take Theory of Computation. E.g., Having 2 tapes is same as 1 tape. The proof essentially takes one tape and splits it into two. May not be as efficient as your desktop, but can do all the same stuff. May not be as pretty (the output is on tape, not a nice display), but gives the same answers.

Church s Thesis Church-Turing Thesis: Turing Machines are formal versions of algorithms. Can t be proved. Why? Because an algorithm isn t mathematically defined. In fact, this thesis says that the TM is the mathematical definition. Can be disproved. Why? Someone could invent something more powerful tomorrow. Not likely to be disproved. Every other type of computation has been proven identical. Lambda-calculus, general recursive functions, quantum computing, etc. In fact, we will prove that CA computation is identical to the Turing Machine!

Philosophical Implication Anything you want to calculate can be done on a Turing Machine. So if you want to prove that something can do any calculation, you have to show it is equivalent to all possible Turing Machines. All TMs? Yup! i.e., we have to show that Rule 110, Life and other Universal CA are equivalent to all TMs. Sounds like a pain. So we ll create a Universal TM that makes life easier.

Universal TMs Our current TM can only do one kind of task at a time. We fix the finite state machine (i.e., control/automata) to solve that particular task. Your desktop can do many different tasks. We don t have to rebuild your desktop for every new application. So what s the difference? We need to build a so called universal TM. A Universal TM can read in (as input) any other TM and run its program! Ah, a programmable TM. So now we just have to show that a CA is equivalent to this one Universal TM!

Turing Machine: Definition A Turing Machine is a quadruple (Q, S, d, q 0 ) where Q is a finite set of states, not including the halt state q h. S is an alphabet including the blank symbol but not the symbols L, R, S. q 0 Q is the initial state. d is the transition function from Q S to (Q {q h }) S {L, R, S} Note: The transition function is the same as what we defined before, but here we were careful to show that we can t transition away from the halt state. Note: Sometimes the definition for the transition function is Q S to (Q {q h }) (S {L, R}) with no S symbol. i.e., the TM can (1) move L or R, or (2) write a new symbol on the tape, but it can t do both at the same time. This changes nothing fundamental.

Building A Universal TM If a Universal TM is going to read any other TM as input (from its tape), then we need a way to encode a TM (so we can write it on a tape). Our Universal TM will use the alphabet {0, 1, #}. Then everything about the TM it is reading must be represented in this alphabet. Let state q 0 be 0 q 1 be 00 q 2 be 000 and in general q i be 0 i+1. (The exponent means concatenation.) Continuing in this way, we can build a table representing the symbols of a TM (see next slide).

Mapping TM Symbols Onto a Universal Tape The a i are the alphabet. For example, 0 and 1. Or 0, 1, and 2. Or a and b. Etc. Original TM symbol # 0 a i 0 i+2 h a 0 h r 00 q i 0 i+1 S 0 L 00 R 000 Code for input on Universal TM

Mapping Transitions And Input Onto a Universal Tape d(q i, a i ) = (q k, a k, D) is represented by q i 1a i 1q k 1a k 1D1. Just separate by ones. For example, d(q 0, a 2 ) = (q 1, a 4, L) is 01000010010000001001 An input string W is W = 1a i 1a k 1a m 1a n 1 a p 1 Begin and end with a 1.

Encoding The Whole TM Suppose there are n states and m letters in the TM alphabet. Q = n, S = m Then there are n m possible transitions. Call them S ik where 1 i n and 1 k m Then we can list the whole Turing machine (Q, S, d, q 0 ) and its input in this order 1q 0 1S 11 S 12...S 1m S 21 S 22...S 2m...S n1 S n2...s nm 1W We ll abbreviate this input as MW M for Turing Machine

Universal TM Operation So how s the Universal TM (UTM) work on this input MW? To make the explanation easier, let s use a UTM that has three tapes. Recall, this adds no new powers to the UTM. Tape 1 will initially hold the input state MW. Tell the UTM to copy W onto tape 2. Writing automata to copy and shift input states is straightforward. Note M and W are easy to find it s the only part of the input that is separated by three 1 s. Tell the UTM to copy the initial state q 0 onto tape 3. Again, easy to find.

Input Universal TM Picture So far we have W used to be here. And of course, M and W actually occupy many cells. # M # # # # # # # # # # #... The init state of the TM State of M # W # # # # # # # # # # #... # q 0 # # # # # # # # # # #...... q 0 q 1 q 4 q 2 q 3

Universal TM Operation (cont.) 1. Tell the UTM to move the head of tape 2 to the first simulated tape cell of the TM. 2. UTM now finds the transition on tape 1 that corresponds to the current state (on tape 3) and the current cell value (on tape 2). 3. Execute this transition as follows. 1. Change the contents of tape 2 to reflect the new cell value. (i.e., update W) 2. Move the tape head on tape 2 in the direction indicated. i.e., move right or left to the next (or previous) simulated tape cell of the TM. 3. Change the contents of tape 3 to the new state. 4. Repeat until can t find a transition (in which case it halts and rejects) or enters accepting state (halt and accept). Sweet! (And phew!)

Taking Stock Ok, we have a Universal TM that can simulate any other TM. So now, to show that we have a Universal CA, we just have to prove it is equivalent to a Universal TM. In other words, that will prove that the CA can calculate any algorithm. And next, we do that for the Game of Life!