Examples of Unlimited Register Machine programs for Turingcomputable

Similar documents
(a) Definition of TMs. First Problem of URMs

Lecture 13: Turing Machine

Lecture notes on Turing machines

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

Undecibability. Hilbert's 10th Problem: Give an algorithm that given a polynomial decides if the polynomial has integer roots or not.

Tape encoding of lists of numbers

Lecture 14: Recursive Languages

TURING MAHINES

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Turing Machines Part Two

ECE 695 Numerical Simulations Lecture 2: Computability and NPhardness. Prof. Peter Bermel January 11, 2017

Turing Machines and the Church-Turing Thesis

Causes of Ineradicable Spurious Predictions in Qualitative Simulation

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Register machines L2 18

Turing Machines Decidability

Chapter 6: Turing Machines

CST Part IB. Computation Theory. Andrew Pitts

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

Introduction to Quantum Computing

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

6.8 The Post Correspondence Problem

Theory of Computer Science

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

Most General computer?

CA320 - Computability & Complexity

CS20a: Turing Machines (Oct 29, 2002)

IV. Turing Machine. Yuxi Fu. BASICS, Shanghai Jiao Tong University

Decidable Languages - relationship with other classes.

Theory of Computation Lecture Notes. Problems and Algorithms. Class Information

COMPUTING THE BUSY BEAVER FUNCTION

CS 275 Automata and Formal Language Theory

Models of Computation. by Costas Busch, LSU

ECS 120 Lesson 15 Turing Machines, Pt. 1

Turing Machines (TM) The Turing machine is the ultimate model of computation.

FINAL EXAM FOR PHIL 152 MICHAEL BEESON

highlights proof by contradiction what about the real numbers?

CSE 4111/5111/6111 Computability Jeff Edmonds Assignment 3: Diagonalization & Halting Problem Due: One week after shown in slides

AN INTRODUCTION TO COMPUTABILITY THEORY

Introduction. Foundations of Computing Science. Pallab Dasgupta Professor, Dept. of Computer Sc & Engg INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Solutions to Homework Assignment 2

Great Theoretical Ideas in Computer Science. Lecture 7: Introduction to Computational Complexity

Computation Theory, L 9 116/171

Well-Founded Iterations of Infinite Time Turing Machines

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

MACHINE COMPUTING. the limitations

Parallelism and Machine Models

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff

15 th Annual Harvard-MIT Mathematics Tournament Saturday 11 February 2012

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb)

CSCC63 Worksheet Turing Machines

ON COMPUTAMBLE NUMBERS, WITH AN APPLICATION TO THE ENTSCHENIDUGSPROBLEM. Turing 1936

Lecture 13: Foundations of Math and Kolmogorov Complexity

Theory of Computation

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

α-recursion Theory and Ordinal Computability

The P versus NP Problem. Dean Casalena University of Cape Town CSLDEA001

Midterm II : Formal Languages, Automata, and Computability

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage?

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA

ENEE 459E/CMSC 498R In-class exercise February 10, 2015

Predicate Logic - Undecidability

258 Handbook of Discrete and Combinatorial Mathematics

1 Showing Recognizability

VI. Church-Turing Thesis

Theory of Computation

Decidability (What, stuff is unsolvable?)

CMPSCI 250: Introduction to Computation. Lecture #15: The Fundamental Theorem of Arithmetic David Mix Barrington 24 February 2014

Intro to Theory of Computation

Ordinal Computability

CS154, Lecture 12: Kolmogorov Complexity: A Universal Theory of Data Compression

Chapter-2 Relations and Functions. Miscellaneous

The Church-Turing Thesis

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Models of Computation, Recall Register Machines. A register machine (sometimes abbreviated to RM) is specified by:

Please give details of your answer. A direct answer without explanation is not counted.

Introduction to Turing Machines. Reading: Chapters 8 & 9

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Great Theoretical Ideas in Computer Science. Lecture 9: Introduction to Computational Complexity

Opleiding Informatica

Lecture 14 Rosser s Theorem, the length of proofs, Robinson s Arithmetic, and Church s theorem. Michael Beeson

X-machines - a computational model framework.

Chapter 8. Turing Machine (TMs)

Complexity Theory Part I

Automata Theory (2A) Young Won Lim 5/31/18

CSE 105 THEORY OF COMPUTATION

Computable Functions

CS 275 Automata and Formal Language Theory

Infinite Time Register Machines

Universal Turing Machine. Lecture 20

On some Metatheorems about FOL

CS21 Decidability and Tractability

Complexity Theory Part II

Theory of Computation

Introduction to Turing Machines

Self-reference in computability theory and the universal algorithm

Transcription:

Examples of Unlimited Register Machine programs for Turingcomputable functions 18 February 2012 at 13:01 Public It will be a matter of interest for me over the next few months to formulate (and collect) numerous examples of basic URM programs to implement simple Turing-computable functions. I'll do this here. Background: Unlimited Register Machines (URMs) were introduced into the mathematical literature in the early 1960s as an easier version of Turing machines to work with. (Detailed history and references can be found here:http://en.wikipedia.org/wiki/register_machine). Turing machines (and URMs) are idealized computers for the study of the algorithmic computability of functions. The idea is that not all functions are able to be computed algorithmically. Those functions that ARE algorithmically computable are called Turing-computable and for such functions it is possible to write a program which will implement them on a Turing machine (or equivalently a URM) in a finite number of steps. According to the famous Church-Turing Thesis, the class of algorithmically computable functions is precisely the class of functions which are recursive (a recursive function is one that can be obtained from certain more basic functions by certain elementary operations implemented a finite number of times). I want to use this note to practise formulating (and also just to collect) specific examples of short URM programs which will implement simple Turing-computable functions. The basic features of the type of URM programs I am interested in are summarised in the following printed note (the sample URM program given here is one that performs addition of two numbers):

------------------------------------------------------------------------------------------------------------------------------------------------- EXAMPLE 1 The following URM program computes three partial functions which I will discuss below (a partial function is a function whose domain is a subset of Nᵏ, the k-dimensional Cartesian product of the set of natural numbers. A function whose domain is the whole of Nᵏ is a total function): 1. J(1, 3, 6) 2. S(2) 3. S(2) 4. S(3) 5. J(1, 1, 1) 6. C(2, 1) This is what one obtains when this program is implemented with the input (2, 1, 1):

To work out the partial function f¹ we consider an initial input n. In the first pass we would have R 2 go from 0 to 2, and R 3 go from 0 to 1. In the next pass R 2 goes to 4, and R 3 goes to 2. This continues until R 2 contains 2n and R 3 contains n. This will occur for any non-negative n, so this partial function is actually total and we have f¹(n) = 2n. To work out the partial function f² we consider an initial input (n 1, n 2 ). In the first pass we would have R 2 go from n 2 to n 2 +2, and R 3 go from 0 to 1. In the next pass R 2 goes to n 2 +4, and R 3 goes to 2. This continues until R 2 contains 2n 1 + n 2, and R 3 contains n 1. This will occur for any non-negative n 1 and n 2, so the function is total and we have f²(n 1, n 2 ) = 2n 1 + n 2. Finally, to work out the partial function f³ we assume initial input (n 1, n 2, n 3 ). We can see straight away that if n 3 > n 1 the program will never halt. Therefore the function is not defined for such values and cannot be a total function. If n 1 = n 3 the output will be n 2. And if n 1 > n 3 we will have R 2 going to n 2 +2(n 1 -n 3 ), and R 3 going to n 1. Therefore this function is not total and we have: f³(n 1, n 2, n 3 ) = n 2 +2(n 1 -n 3 ) for n 1 > n 3 ; f³(n 1, n 2, n 3 ) = n 2 for n 1 = n 3 ; f³(n 1, n 2, n 3 ) is undefined for n 1 < n 3. ----------------------------------------------------------------------------------------------------------------------------------------------- EXAMPLE 2 The following URM program computes the function f(n) = n if n is odd, and f(n) = 0 if n is even: 1. J(1, 2, 8) 2. S(2) 3. J(1, 2, 8) 4. S(2) 5. J(1, 2, 7) 6. J(1, 1, 2) 7. Z(1) = 0 For example, the following is obtained with the input (3, 0): And the following is obtained with the input (4, 0):

------------------------------------------------------------------------------------------------------------------------------------------------ EXAMPLE 3 The following URM program computes the function f(n, m) = n if n m, f(n, m) = m otherwise. In other words, it computes min(n, m). 1. J(1, 2, 7) 2. J(1, 3, 7) 3. J(2, 3, 6) 4. S(3) 5. J(1, 1, 2) 6. C(2, 1) For example, the following is obtained with the input (2, 3): And the following is obtained with the input (3, 2):

Note that to compute max(n, m), i.e., the function f(n, m) = n if n m, f(n, m) = m otherwise, it is only necessary to switch around the last digits in the Jump commands in lines 2 and 3, so the jump command in line 2 now goes to line 6, while the jump command in line 3 now goes to (non-existent) line 7. No other changes are needed. ----------------------------------------------------------------------------------------------------------------------------------------------- EXAMPLE 4 The following URM program computes the function f(n, m) = nm. In other words, it carries out multiplication. 1. J(1, 4, 14) 2. J(2, 4, 13) 3. C(1, 3) 4. Z(1) 5. S(1) 6. S(4) 7. J(3, 4, 9) 8. J(1, 1, 5) 9. S(5) 10. J(2, 5, 14) 11. Z(4) 12. J(1, 1, 5) 13. Z(1) For example, the following is obtained with the input (2, 3):

-------------------------------------------------------------------------------------------------------------------------------------------------