Primitive recursive functions: decidability problems

Size: px
Start display at page:

Download "Primitive recursive functions: decidability problems"

Transcription

1 Primitive recursive functions: decidability problems Armando B. Matos October 24, 2014 Abstract Although every primitive recursive (PR) function is total, many problems related to PR functions are undecidable. In this work we study several questions associated with PR functions and characterize their degree of undecidability. For instance, we show that the injectivity problem belongs to the class Π 0 1 \ 0 0 of the arithmetic hierarchy, while the surjectivity and the bijectivity problems belong to Π 0 2 \ (Σ 0 1 Π 0 1). It follows that these subclasses of PR functions can not be enumerated and thus cannot be characterized by an effective property. Several other PR decision problems are studied such as, problems related to the existence and number of zeros, and problems related to the size of the codomain. We consider a specific but important decision problem, does a given PR function has at least one zero?, and establish the necessary and sufficient input and output restrictions for decidability the frontiers of decidability of this problem. We also study undecidability results for a more general class of problems, namely existential first order logic with equality and composition of PR functions. A PR function as a part of an acyclic PR function graph is also studied. This setting may be useful to evaluate the relevance of a specific PR function as a component of a larger PR structure. 1

2 Contents 1 Introduction 3 2 Preliminaries Languages, reductions and the arithmetic hierarchy Decision problems Models of computation Primitive recursive functions Context free grammars Decision problems associated with PR functions Some undecidable problems Size of the codomain Injectivity, surjectivity, and bijectivity Primitive recursive versus partial recursive problems Frontiers of decidability: the HAS-ZEROS problem The meaning of restricted HAS-ZEROS problems The HAS-ZEROS-f g class of problems The HAS-ZEROS-h f class of problems The HAS-ZEROS-h f g class of problems A generalization: the output of g is a tuple Using HAS-ZEROS-h f g to analyze other decision problems Classifying a problem testing the properties of g and h Generalizations of the PR decision problems Existential first order logic with PR functions A PR function f in an acyclic PR structure: normal form Composition of f with itself Comment: on a paper by Stefan Kahrs 45 7 Conclusions and open problems 47 2

3 1 Introduction The primitive recursive (PR) functions form a vast and important enumerable sub-class of the class of recursive (total) functions. Its vastness is obvious from the fact that every total recursive function whose time complexity is bounded by a primitive recursive function is itself primitive recursive, while its importance is well expressed by the Kleene normal form Theorem [23, 3, 32] and by the fact that every recursively enumerable set can be enumerated by a primitive recursive function 1. The meta-mathematical and algebraic properties of PR functions have been widely studied, see for instance [23, 36, 34, 41, 37]. Special subclasses (such as unary PR functions, see for instance [35, 39]) and hierarchies (see for instance [18, 1, 28, 30, 2, 14] and [44, Ch. VI]) of PR functions were also analyzed. Efficiency lower bounds of primitive recursive algorithms have also been studied, see [4, 5, 6, 8, 30, 31, 12, 43, 42]. In this work we concentrate on decidability questions related to PR functions. There are several questions related to PR functions that are known to be undecidable. For instance, the question given a PR function f(x, y) and an integer x, is there some y such that f(x, y) = 0? is undecidable ([3]). In this paper we show that many other questions related to PR functions are undecidable, and classify their degree of undecidability according to the arithmetic hierarchy. Let us mention two examples of the problems studied in this work: does a given PR function have exactly one zero?, and is a given PR function surjective (onto)?. The undecidability of some of these problems has consequences. For instance, when studying reversible computations, it would be useful to have a method for enumerating the bijective PR functions. As we will see, that is not possible: although the set of PR functions is enumerable, the set of bijective PR functions is not: it belongs Π 0 2 \ (Σ0 1 Π0 1 ). We also study classes of PR problems in which a PR function f is a part of a larger PR system S. We obtained a simple decidability condition for the case in which S(x) = h(f(g(x))), where g and h are fixed PR functions, but not for the general case illustrated in Figure 1 (page 4). Organization and contents of the paper. The main concepts and results needed for the rest of the paper are presented in Section 2 (page 5). The rest of the paper can be divided in two parts. 1 In the sense that, if L is recursively enumerable, there is a primitive recursive function f such that L {0} = {f(i) : i N}. 3

4 x f y S Figure 1: A PR function f is considered to be an important part of a complex structure S if the following problem is undecidable: instance: f, question: x : S(x) = 0?. We will show that an arbitrary acyclic system S containing one occurrence of f can always be reduced to the normal form illustrated in Figure 9 (page 43). Part I, specific problems In Section 3 (page 12) several decision problems associated with PR functions are studied. These problems include the existence of zeros, the equivalence of functions, domain problems, and problems related with the injectivity, surjectivity, and bijectivity of PR functions. For each of these problems the degree of undecidability is established in terms of their exact location in the in the arithmetic hierarchy; see Figures 2 (page 23) and 3 (page 23). Part II, classes of problems Suppose that the PR function f, the instance of a decision problem, is placed somewhere inside a larger PR system S, see Figure 1. In algebraic terms this means that S is obtained by composing fixed PR functions with the instance f. A more general form of composition, based on acyclic graphs is also studied, see Figure 8 (page 40). Then we ask an important question about y = S(x), namely, x : S(x) = 0? This is in fact a fundamental question: In terms of the Kleene normal form, the existence of a zero is the basic undecidable question, and it is intimately related in fact, equivalent to the halting problem. Many other decision problems can be reduced to this problem. The class of problems, parametrized by S, is: Instance: A PR function f. Question: Is there some x such that S(x) = 0? In some sense we can say that f can be considered an important component of S if (and only if) this problem is undecidable. 4

5 Part II of this work includes Section 4 (page 29), where we study the frontiers of decidability of the problem does a given PR function has at least one zero?. More precisely, we find the input and output restrictions that are necessary and sufficient for decidability; these restrictions are obtained by pre- or post-applying fixed PR functions to the PR function which is the instance of the problem. This is a particular form of the arbitrary composition described above. A more general setting in considered in Section 5 (page 36), where we study existential first order logic with equality and composition of PR functions and also acyclic PR structures. The problem of composing the instance PR function f with itself is also studied. Section 6 includes some comments on Kahrs enumeration method. The initial motivation for this work was to generalize Rice Theorem to PR functions. Rice Theorem is simple: for any non trivial mathematical property of a partial recursive function, it is undecidable whether the function, defined by a given description (or index), has that property. A version of Rice Theorem applicable to to PR functions is necessarily more complex because, unlike the case of partial recursive functions, only quantified questions can be undecidable. Questions like given a description of f, is f(2) = 5? are clearly decidable. A result of this paper that can be seen as a first step to such a Rice-like PR Theorem is Theorem 24 (page 34). 2 Preliminaries The notation used in this paper is straightforward. Iff denotes if and only if and def = denotes is defined as. The logical negation is denoted by. The complement of the set A is denoted by A, while the difference between the sets A and B is denoted by A \ B. A function f : A B is injective (or oneto-one) if x y implies f(x) f(y); it is surjective (or onto) if for every y B there is at least one x A such that f(x) = y; and it is bijective if it is both injective and surjective. By f 1 (y) we denote the set {x : f(x) = y}. The letters of the alphabet are denoted by 0, 1, a, b... ; the words by x, y... The length of the word x is denoted by x. For n 0, the sequence of arguments x 1, x 2,..., x n is denoted by x. A function f(x) with zero arguments (n = 0) is a constant. Definition 1 Let x = x 1,..., x n and y = y 1,..., y m ; by y = f(x) we mean that, for 1 i m, each of the y i is a function of x. We say that f is a multiple function. Some fixed computable bijection for coding words as integers is assumed. 5

6 We will use the following word order, where x and y are words, see for instance [27]. x < y iff (i) x < y or (ii) x = y and x < y in lexicographic order. 2.1 Languages, reductions and the arithmetic hierarchy The terms unsolvable, recursively unsolvable ([38]), and undecidable will be used interchangeably. It is assumed that the reader is familiar with the arithmetic hierarchy of languages (AH), see for instance [32, 38, 23, 26, 25, 24, 20]. The arithmetic hierarchy is used in this paper with the purpose of measuring the degree of undecidability of PR decision problems. This is usual in Recursion Theory, see for instance its use for rewriting problems studied in [10, 40]. This is similar to the classification of the difficulty of a (decidable) problem in the polynomial hierarchy (PH). The only important definitions and results that the reader should be aware are mentioned in the beginning of the Chapter 14 of [38], namely: A relation R is in the arithmetic hierarchy if R is recursive (Class Σ 0 0 = Π0 0 ) or if there is a recursive relation S such that R can be obtained from S by a finite sequence of complement and/or projection operations. Theorem I, page 302, Theorem III, page 307. The relationship between the classes of the AH (and of the PH) and the sequence of alternating quantifiers in the question associated with the decision problem. Se for instance Sections 14.1 and 14.2 of [38]. More precisely, a decision (or complexity problem) belongs to Σ 0 n or Π 0 n iff the formula of the associated question, written in prenex normal form, has n (alternating) quantifiers in the prefix, the outer one being, respectively, existential or universal (partial transcription from [32]). See for instance [32] (Definition IV.1.6, page 367), [38] (Chapter 14, Theorem I, page 302), and [13] (Chapter 7, Theorem 7.4, page 163). A relation R is in AH iff R is definable in elementary arithmetic (definition in [38]). This property justifies the name arithmetic for a hierarchy of relations or functions. In the literature the superscript 0 is sometimes omitted. We denote by the set Σ 0 0 = Π0 0 = 0 0. Thus the class of recursively enumerable, but not recursive sets is Σ 0 1 \. The following table lists some AH classes (languages) and the descriptions of the corresponding decision problems. 6

7 AH class Σ 0 1 Σ 0 1 \ Π 0 1 Π 0 1 \ Σ 0 2 \ (Σ0 1 Π0 1 ) Decision problem Semi-decidable Undecidable, semi-decidable Complement of a semi-decidable problem Undecidable, complement of a semi-decidable problem Neither semi-decidable nor the complement of a semi-decidable problem, but expressible as x y : P (x, y), where P is decidable (see the references to the AH cited above) and x and y represent tuples of variable. Given this correspondence, we will sometimes abuse the language, using an AH class to denote either a decision problem or the corresponding language. Definition 2 (many-one, PR reduction) Suppose that the languages L and M are defined over the alphabets Σ L and Σ M respectively. L reduces (many-one) to M, L m M, if there is a primitive recursive function f : Σ L Σ M such that x L if and only if f(x) M. If L m M, 1. M implies L. Proof. To decide if x L compute f(x) and use the decision algorithm for f(x) M. 2. L m M. Proof. x L iff f(x) M is the same as x L iff f(x) M. 3. M Σ 0 1 implies L Σ0 1. Proof. Assuming that M is enumerable, use the following procedure to enumerate L Y loop Enumerate the next element y of M. Y Y {y}. Consider the next element x of Σ L. Compute f(x). If f(x) Y, list x. For every x < x that was not listed, if f(x ) = y, list x. endloop 4. M Π 0 1 implies L Π0 1. Proof. Use properties 2 and 3. Note. Properties 3 and 4 imply Property 1. A set P is m -complete in the class C if P C and Q m P for every Q C. 7

8 2.2 Decision problems The following three well known decision problems are undecidable, but semidecidable, i.e. they belong to the class Σ 0 1 \ [3, 19, 32, 9]. Definition 3 HP, halting problem. Instance: a Turing machine T and a word x. Question: does the computation T (x) halt? Definition 4 SHP, self halting problem. Instance: a Turing machine T. Question: does the computation T (i) halt, where i is a Gödel index of T? Definition 5 PCP, Post correspondence problem. Instance: two finite sets of non-null words, {x 1,..., x n } and {y 1,..., y n }, defined over the same finite alphabet with at least two letters. Question: is there a finite non-null sequence i 1,..., i k such that x i1 x i2... x ik = y i1 y i2... y ik? Another important undecidable problem is the following. Definition 6 TOTAL, is a function total? Instance: a partial recursive function f(x) given by a Turing machine T. Question: Is f(x) defined for every x? Theorem 1 The language associated with the TOTAL problem belongs to the class Π 0 2 \ (Σ0 1 Π0 1 ). Proof. (See for instance [33]). (i) L TOTAL Π 0 2. The TOTAL question, with instance f(x), can be written x t : (F (x, t) = 1) where F (x, t) is the PR function { 0 if T (x) does not converge in t steps F (x, t) = 1 otherwise and T is a Turing machine that computes f. (ii) L TOTAL Σ 0 1. Reduction ( HP) m TOTAL: using a Turing machine T that computes f, define g as follows (using the S mn Theorem) g x (t) def = f(x, t) = { 1 if T (x) does not converge in t steps undefined otherwise Clearly g x is a total function iff T (x) does not halt. (iii) L TOTAL Π

9 Reduction HP m TOTAL: given the instance T, x of HP, define the function g(y) that (ignores the input y and) simulates the computation T (x); if it halts, the output is 0; if not, g(y) is undefined. The function g(y) is total iff the computation T (x) halts. 2.3 Models of computation Deterministic finite automata (DFA), Turing machines (TM), and Context free grammars (CFG) and examples of models of computation. In order to find the properties that a model of computation should satisfy, let us begin with an example. Every Turing machine M can be uniquely described by a word 2 d(m) that encodes its properties: states, initial state, final states, transition function. Alternatively a Turing machine can be described by its Gödel index. Thus, the descriptions of all Turing machines can be effectively enumerated by the following method, where for simplicity, we assume that the alphabet of the description is a, b. Successively generate in order all words x = ε, a, b, aa, ab,... Whenever x is the description of a Turing machine, output x. If i is a Gödel index of the Turing machine T, the partial function implemented by T is denoted by φ i or alternatively by {i}. When we write φ i (x) = y we mean two things: 1. The corresponding computation halts; we write (the computation corresponding to) φ i (x) halts ; instead of φ i (x) we can of course write {i}(x). 2. The output of the computation is y. The dovetailing technique Consider a recursively enumerable set of Turing machines M 1, M 2... and suppose that we want to list the outputs of all the computations M i (x) for some fixed x. That is, for every i, if the computation M i (x) halts, its output is listed. This can be effectively done by the following method: Successively simulate one step of computation for each machine, in the following order Machine: M 1 M 1 M 2 M 1 M 2 M 3 M 1 M 2 M 3 M 4 M 1... Step: (1) (2) (1) (3) (2) (1) (4) (3) (2) (1) (5) Note that every machine M i is completely simulated: either forever or until it halts. During this simulation, whenever some machine M i halts, print its output. 2 In fact by an infinity of equivalent words. 9

10 Properties of a model of computation The fundamental assumptions associated with the intuitive idea of model of computation are the following. Assumption 1 Every instance of a model of computation is codified in a word such that (i) There is an algorithm that tests if a given word is a valid characterization of an instance of the model. As a consequence, the set of valid characterizations is effectively enumerable. (ii) From a valid word it is be possible to effectively extract the semantic properties of the instance it represents. We may for instance conclude that no model of computation characterizes the set of total recursive functions because that set is not enumerable (see for instance [33]). 2.4 Primitive recursive functions It is assumed that the reader is familiar with the classical definition of primitive recursive functions [3, 32], with the usage of register languages to characterize those functions (particularly with the Loop language [28, 29]), and with the Kleene normal form theorem [23, 3]. The binary function defined below is PR { x y if x y x y = 0 otherwise The following property will be useful. Property 1 Let a and b be arbitrary integers. (a b) + (b a) = 0. Then a = b if and only if The S mn Theorem will often be used without mention. Theorem 2 (S mn Theorem) Given a Gödel numbering ϕ of PR functions, there is a PR function s of two arguments such that: for every Gödel number p of a partial recursive function f(x, y) with two arguments, x, y : f(x, y) = ϕ s(p,x) (y). In the sequel the function ϕ s(p,x) (y) will often be denoted by f x (y). 2.5 Context free grammars The language generated by the context-free grammar (CFG) G is denoted by L(G). A CFG G is ambiguous if there is at least one word in L(G) with 10

11 more than one leftmost derivation. In this definition we can replace leftmost derivation by parsing tree. The symbols and will be used with the usual meaning. Definition 7 A CFG is ε-free if it has no productions of the form A ε. Theorem 3 For every CFG G there is an ε-free grammar G such that L(G ) = L(G) \ {ε}. Theorem 4 For every CFG G there is a primitive recursive parser that recognizes L(G). Proof. In an ε-free grammar, w z implies w z. To see if x L(G), we can use a brute force search in which every derivation that contains the same word twice, S... w... w..., is discarded, i.e. the search tree is pruned. A PR bound on the length of every possible derivation can thus be established and this algorithm can be implemented as a primitive recursive function. Definition 8 Given a CFG G, the extended grammar G is the CFG that contains all the letters, non-terminals, and productions of G plus the productions S C, C c, and C Cc where S is the initial symbol of G (and of G ), C is a new non-terminal symbol, c is a new letter. We say that G is an extended context free grammar or E-CFG. The problem of deciding if a given E-CFG is ambiguous is called the E-CFG ambiguity problem, or E-CFG-amb. Clearly, G is ambiguous iff G is ambiguous, and L(G ) = L(G) {c, cc, ccc...} (disjoint union). Theorem 5 The E-CFG ambiguity problem is undecidable. Proof. We reduce PCP to the E-CFG ambiguity problem. Let the PCP instance be {x 1,..., x n }, {y 1,..., y n } (n 1) and let a 1,..., a n, and c be new letters. Consider the E-CFG G S A B C A x i Aa i x i a i for i = 1, 2..., n B y i Ba i y i a i for i = 1, 2..., n C c Cc In G every derivation is leftmost. There are at most two possible derivations of a word not containing the letter c, starting with S A and S B. Due to the presence on the right of the new letters a i, they correspond to a solution of the PCP problem. Conversely, if the PCP has a solution, the E-CFG G is ambiguous. 11

12 3 Decision problems associated with PR functions We study the decidability of some problems in which one (f) or two (f and g) primitive recursive functions are given as the instance. First, in Section 3.1, we study several problems related to the existence of zeros of the function f and to the equivalence of the functions f and g, then, in Section 3.2, some properties related to the codomain of f are studied, and finally, in Section 3.3 we prove results associated to the injectivity, surjectivity, and bijectivity of f. The reader can find a summary of some of these results in Figure 2 (page 23). In Section 3.4 (page 22) we consider also the case in which the instance is a partial recursive function and compare the two cases. Figures 5 (page 25) and 6 (page 30) contain a summary of this comparision. 3.1 Some undecidable problems Several decision problems related with the zeros and the equivalence of PR functions are studied. They are all proved to be undecidable. In particular we present a new proof of the undecidability of the PR equivalence problem Problems In the decision problems listed below the corresponding class in the arithmetic hierarchy is listed. In every case it is assumed that a PR function is specified by a primitive recursive index. Definition 9 In the following decision problems the specification of the particular instance is: a primitive recursive function f(x, y), and the value of x. Using the S mn Theorem (page 10), this instance is equivalent 3 to the simpler form a primitive recursive function g(y). This form will be often used. HAS-ZEROS, f(x, y) has at least one zero. Question: Is there some y such that f(x, y) = 0? Class: Σ 0 1 \, Theorem 6 (page 14). EXACTLY-ONE-ZERO. Question: Does f(x, y) have exactly one zero? Class: Σ 0 2 \ (Σ0 1 Π0 1 ), Theorem 7 (page 14). AT-LEAST-k-ZEROS. Question: Does f(x, y) have at least k 0 s? (k 1 fixed). Class: Σ 0 1 \, Theorem 8 (page 15). 3 Where g(y) f x(y). 12

13 EXACTLY-k-ZEROS. Question: Does f(x, y) have exactly k zeros? (k 1 fixed). Class: Σ 0 2 \ (Σ0 1 Π0 1 ), Theorem 9 (page 15). EQUAL-NEXT. Question: Is there some y such that f(x, y) = f(x, y + 1)? Class: Σ 0 1 \, Theorem 10 (page 15). ZERO-FUNCTION. Question: Is f(x, y) the 0(y) 0 function? Class: Π 0 1 \, Theorem 11 (page 15). -ZEROS. Question: Does f(x, y) have infinitely many zeros? Class: Π 0 2 \ (Σ0 1 Π0 1 ), Theorem 12 (page 16). Definition 10 EQUAL-AT-ONE-POINT, functions equal at one point. Instance: primitive recursive functions f(x) and g(x). Question: Is there an input x such that f(x) = g(x)? Class: Σ 0 1 \, Theorem 13 (page 16). Definition 11 EQUIVALENCE. Instance: primitive recursive functions f(x) and g(x). Question: Is f(x) = g(x) for every x? Class: Π 0 1 \, Theorem 14 (page 16). We also consider the equivalence of f to any particular (i.e. fixed) primitive recursive function. Definition 12 Problem EQUIVALENCE i for each i N. Comment. For each problem the value i N is fixed. Instance: primitive recursive function f(x). Question: Is f(x) = φ i (x) for every x? Class: Π 0 1 \, Theorem 16 (page 17) Polynomials and the HAS-ZEROS problems For each instance f(x) of the HAS-ZEROS problem there is an integer (with integer coefficients) polynomial p(x 1,..., x n ), such that p has a zero iff f(x) has a zero. Let us begin by quoting [11]. In an unpublished and undated manuscript from the 1930s found in Gödel s Nachlass and reproduced in Vol. III of the Collected Works, he showed that every statement of the form x : R(x) with R primitive recursive [relation] is equivalent to one in the form x 1,..., x n y 1,..., y m : [p(x 1,... x n, y 1... y m ) = 0] 13

14 in which the variables range over natural numbers and p is a polynomial with integer coefficients; it is such problems that Gödel referred to as Diophantine in the Gibbs lecture. It follows from the later work on Hilbert s 10th problem by Martin Davis, Hilary Putnam, Julia Robinson and in the end Yuri Matiyasevich that, even better, one can take m = 0 in such a representation, when the = relation is replaced by [that is, x : R(x) iff x : P (x) 0]. In terms of PR functions, a PR relation R(x) can be represented by a PR function f(x) such that R(x) holds iff f(x) 0. This is of course one, among many, possible representations. We have (with m = 0) the equivalences x : R(x) x 1,..., x n : [p(x 1,... x n ) 0] x : f(x) 0 x 1,..., x n : [p(x 1,... x n ) 0] x : f(x) = 0 x 1,..., x n : [p(x 1,... x n ) = 0] Thus, given that there is an algorithm that computes p from f, and relatively to the decidability of the HAS-ZEROS problem, an arbitrary PR function is no more general than a (multiple variable) integer polynomial Results Theorem 6 The HAS-ZEROS problem is undecidable but semi-decidable (see [3]). Proof. The semi-decidability is obvious. The undecidability follows from two facts: the Kleene normal form Theorem and the undecidability of the halting problem. Corollary 1 Let f(x 1,..., x n, y) and g(x 1,..., x n, y) be primitive recursive functions, with n 1. The following problem is undecidable but semi-decidable: given x 1,..., x n, is there some y such that f(x 1,..., x n, y) = g(x 1,..., x n, y)? Proof. Using the S mn Theorem (page 10), we replace f(x, y) and g(x, y) by f(y) and g(y) respectively. Property 1 (page 10) says that f(y) = g(y) iff (f(y) g(y)) + (g(y) f(y)) = 0. The result follows from Theorem 6 (page 14) Theorem 7 The language associated with the EXACTLY-ONE-ZERO problem is Σ 0 2 \ (Σ0 1 Π0 1 ). Proof. In Σ 0 2. Given the PR function f(x), the question associated with the problem can be expressed as x x : [(f(x) = 0) (x x f(x ) 0)]? which shows that the language belongs to Σ 0 2. Not in Π 0 1. Reduce HAS-ZEROS to EXACTLY-ONE-ZERO: 14

15 let f be the instance of HAS-ZEROS. Define g as { 0 if f(x) = 0 and [x g(x) = < x f(x ) 0] 1 otherwise Clearly g is PR and f has at least one zero iff g has exactly one zero. Thus the problem EXACTLY-ONE-ZERO is undecidable and is not the complement of a semi-decidable problem. Not in Σ 0 1. Reduce (HAS-ZEROS) to EXACTLY-ONE-ZERO: let f be the instance of (HAS-ZEROS). Define g as 0 if x = 0 g(x) = 1 if x 1 and f(x 1) 0 0 if x 1 and f(x 1) = 0 The function g has exactly one zero iff the function f has no zeros. It follows that EXACTLY-ONE-ZERO is not a semi-decidable problem. Theorem 8 The AT-LEAST-k-ZEROS problem is undecidable but semi-decidable. Proof. The AT-LEAST-k-ZEROS problem is clearly semi-decidable and HAS- ZEROS (instance f(x)) reduces easily to AT-LEAST-k-ZEROS (instance g(x)) if we define for each x 0 g(kx) = g(kx + 1) =... = g(kx + (k 1)) = f(x) so that each zero of f corresponds to k zeros of g. Theorem 9 For every k 1 the language associated with the EXACTLY-k- ZEROS problem is in Σ 0 2 \ (Σ0 1 Π0 1 ). Proof. Similar to the proof of Theorem 7. Theorem 10 The EQUAL-NEXT problem is undecidable but semi-decidable. Proof. Let g(x) def = (f(x + 1) f(x)) + (f(x) f(x + 1)) and h(x) def = i=x 1 i=0 f(i). We have g(x) = 0 iff f(x) = f(x + 1) and h(x) = h(x + 1) iff f(x) = 0. It follows that HAS-ZEROS m EQUAL-NEXT and EQUAL-NEXT m HAS-ZEROS. The proposition follows. Theorem 11 The language associated with the problem ZERO-FUNCTION is in Π 0 1 \. Proof. The complement of ZERO-FUNCTION is semi-decidable (belongs to the class Σ 0 1 ) so that ZERO-FUNCTION belongs to Π

16 Undecidability (not in ): reduce HAS-ZEROS to (ZERO-FUNCTION). Given an instance f of HAS-ZEROS, define the function g as { 0 if f(x) 0 g(x) = 1 if f(x) = 0 Clearly, g is PR; also g has at least one zero iff f has at least one nonzero. Theorem 12 The language associated with the problem -ZEROS is in Π 0 2 \ (Σ 0 1 Π0 1 ). Proof. In Π 0 2. The question associated with the problem can be expressed as m x : (x m) (f(x) = 0)? or: m x, y : (x = m + y) (f(x) = 0)? Not in Π 0 1 :. Reduction HAS-ZEROS to -ZEROS: let f be an instance of HAS-ZEROS. Define g as { 0 if x, written in binary notation is in 10 g(x) = n 1(0 + 1) and f(n) = 0 1 otherwise where the standard notation for regular expressions is used. Clearly, f(x) has at least one zero iff g(x) has infinitely many zeros. Not in Σ 0 1. Reduction (HAS-ZEROS) m -ZEROS: let f be an instance of (HAS-ZEROS). Define g as { 1 if f(x g(x) = ) = 0 for some x x 0 otherwise The function f(x) has no zero iff g(x) has infinitely many zeros. Theorem 13 The EQUAL-AT-ONE-POINT problem is undecidable but semidecidable. Proof. Easy, consider the PR function (f(x) g(x)) + (g(x) f(x)). Theorem 14 The EQUIVALENCE problem is undecidable; its complement is semi-decidable. Proof. The complement of the EQUIVALENCE problem is clearly semi-decidable. Two CFG languages are equal iff the functions defined by the corresponding parsers are equal. A CFG parser can be written as an primitive recursive algorithm having as input an integer that codes the words of the alphabet and an output which is either 0 (reject) or 1 (accept), see Theorem 4 (page 11). Thus, as the CFG language equivalence is undecidable (see for instance [21]), the EQUIVALENCE problem is also undecidable. 16

17 Another proof. The following function is PR Given the description d(m) of a Turing machine T and an input x, the following function is primitive recursive 4. { 0 if M(x) has halted by time t f(d(m), x, t) = 1 otherwise We reduce the SHP to EQUIVALENCE. The function { f 0 if M(d(M)) has halted by time t (d(m), t) = 1 otherwise is also PR. Given d(m), instance of the SHP, the computation φ d(m) (d(m)) does not halt iff the unary function f (d(m), t) (with d(m) fixed, t is the argument) is equivalent to the zero function 0(t); this is a particular case of EQUIVALENCE. Thus EQUIVALENCE cannot be decidable. In fact, the last sentence of the proof above gives us another very simple proof: Theorem 11 (page 15) shows that a particular case of EQUIVALENCE is already undecidable; thus, so is EQUIVALENCE. A reduction of EQUIVALENCE to ZERO-FUNCTION is also possible: by Property 1 (page 10) f(y) = g(y) iff (f(y) g(y)) + (g(y) f(y)) = 0. Thus EQUIVALENCE reduces to ZERO-FUNCTION. Theorem 15 For every integer i the problem EQUIVALENCE i is undecidable; its complement is semi-decidable. Proof. We only prove the undecidability of EQUIVALENCE i, the other part is easy (see the proof of Theorem 14). Let i be any fixed integer. We reduce ZERO-FUNCTION to EQUIVALENCE i. Let f be an instance of ZERO-FUNCTION. Define the primitive recursive function g(x) = f(x) + φ i (x). Clearly, the function f is the zero function 0(x) iff g(x) is equivalent to φ i (x). We can further generalize Theorem 16, considering the equality of the functions f(x) and φ i (x), not for all x N but only for an infinite PR predetermined subset of the domain. By this, and anticipating the terminology used in Section 4, page 29, we mean that there is a fixed primitive recursive function g, such that the equality f(y) = φ i (y) is only considered for the values y = g(x) with x N. Theorem 16 For every integer i and for every primitive recursive function g with infinite domain, the problem is f(y) = φ i (y) for every y in the codomain of g? is undecidable; its complement is semi-decidable. Proof. (Brief sketch). Consider the problem is f(g(x)) = 0 for every x N?. Note that f(g(x)) has a zero iff (f(y) 1) + 1 is not zero for all y in the 4 The function f is related to one PR function of the Kleene normal form, namely to the function under the scope of the unbounded minimization operator. 17

18 codomain of g. Assume that this codomain is infinite and continue the proof as in Theorem 16, but using the idea of the proof of Theorem 22, page Size of the codomain The size of the codomain cod(f) of a PR function f may determine if a problem belonging to a certain class (see Section 4.2, page 32) is decidable or not. We study two decision problems related with this size. In the following problems, the instance is the PR function f. The problem INFINITE-CODOMAIN is also mentioned in Section 4.7 (page 35). Problem CODOMAIN-k, Finite, fixed size codomain, where k is any fixed positive integer. Question: Does the codomain of f have size k? Class: Π 0 1 \ for k = 1 (Theorem 17, page 18) Class: Σ 0 2 \ (Σ0 1 Π0 1 ) for k 2 (Theorem 18, page 18) Theorem 17 For k = 1 the language associated with the problem CODOMAIN-k belongs to the class Π 0 1 \. Proof. A positive answer to CODOMAIN-k for k = 1 can be expressed as x : (f(x) = f(0)), so that CODOMAIN-k for k = 1 is in Π 0 1. Reduce ZERO-FUNCTION to CODOMAIN-k (k = 1) as follows. Given an instance f of ZERO-FUNCTION consider the instance g of CODOMAIN-k { g(0) = 0 g(x) = f(x 1) for x 1 The function g has codomain with size 1 iff f(x) 0. Thus CODOMAIN-k (k = 1) is undecidable. Theorem 18 For any integer k 2 the language associated with the problem CODOMAIN-k belongs to the class Σ 0 2 \ (Σ0 1 Π0 1 ). Proof. In Σ 0 2. A positive answer to CODOMAIN-k can be expressed as a expression; we exemplify for the case k = 2 y 1, y 2, x 1, x 2 z : (f(x 1 ) = y 1 ) (f(x 2 ) = y 2 ) (y 1 y 2 ) (f(z) = y 1 f(z) = y 2 ) so that CODOMAIN-k is in Σ 0 2 for any k 2. Not in Σ 0 1. Reduce ZERO-FUNCTION to CODOMAIN-k: let f be an instance of ZERO-FUNCTION. Define g as { x for 0 x < k g(x) = 2kf(x k) for x k Clearly cod(g) = k iff f(x) 0. Thus CODOMAIN-k is not in Σ 0 1 (Property 4, page 7). 18

19 Not in Π 0 1. Reduce ( ZERO-FUNCTION) to CODOMAIN-k: let f be an instance of ( ZERO-FUNCTION). For each x N define the k values g(kx + i) = { 0 if f(x) = 0 i if f(x) 0 (for 0 i < k) Clearly cod(g) = k iff f(x) 0 for some x. Thus CODOMAIN-k is not in Π 0 1 (Property 3, page 7). Problem FINITE-CODOMAIN, finite codomain Question: Is the codomain of f finite? Theorem 19 FINITE-CODOMAIN belongs to the class Σ 0 2 \ (Σ0 1 Π0 1 ). Proof. In Σ 0 2. The FINITE-CODOMAIN statement can be expressed as m x : f(x) m. Not in Σ 0 1. Reduce ZERO-FUNCTION to FINITE-CODOMAIN: let f be an instance of ZERO-FUNCTION. Define g as { 0 if f(0) = f(1) =... = f(x) = 0 g(x) = x otherwise The codomain of g is finite (with size 1) iff f(x) 0. It follows that FINITE-CODOMAIN is not in Σ 0 1. Not in Π 0 1. Reduce HAS-ZEROS to FINITE-CODOMAIN: use the function { 0 if f(y) 0 for some y x g(x) = x otherwise The codomain of g is finite iff f(x) is nonzero for some x. It follows that FINITE-CODOMAIN is not in Π 0 1. The problem INFINITE-CODOMAIN is the negation of the problem FINITE-CODOMAIN. It follows from Theorem 19 that INFINITE-CODOMAIN belongs to the class Π 0 2 \ (Σ0 1 Π0 1 ). 3.3 Injectivity, surjectivity, and bijectivity The problems of deciding if a given PR function is injective, surjective, or bijective are considered in this section. First we define the three problems studied in this section. Definition 13 INJECTIVE, primitive recursive injectivity. Instance: a PR function f, specified by a Loop program. Question: is f an injective function? Definition 14 ONTO, primitive recursive surjectivity. 19

20 Instance: a PR function f, specified by a Loop program. Question: is f a surjective function? Definition 15 BIJECTIVE, primitive recursive bijectivity. Instance: a PR function f, specified by a Loop program. Question: is f a bijective function? Clearly, if the INJECTIVE and the ONTO problems were decidable then BI- JECTIVE would also be decidable. However, all these problems are undecidable (with various degrees of undecidability) Injectivity We will use the following lemma to prove that the problem of determining if a given PR function is injective is undecidable. Lemma 1 For every CFG G there is a PR function f G whose input is an integer n that codifies some word d and with the following output. f G (n) = y if n codifies a word d which is a leftmost derivation of some word x in G; suppose that the integer y codifies the word x, say y = c(x), and assume that y starts with 10. This situation is illustrated in the following diagram. n d f G G x y = N Σ Σ N f G (n) = 11n if d is not a leftmost derivation in G. Proof. The PR function f G checks if n codifies a leftmost derivation of a word x. If it does, the result is the integer y = c(x) = Otherwise, the result is the integer 11n. Theorem 20 The problem INJECTIVE is undecidable, being the complement of a semi-decidable problem, that is, it belongs to the class Π 0 1 \. As a consequence of this result the injective PR functions can not be effectively enumerated and can not be characterized by a model of computation, see Assumption 1 (page 10). Proof. The INJECTIVE statement can be expressed as m, n : (m n) (f(m) f(n)) 20

21 This INJECTIVE belongs to the class Π 0 1. The E-CFG ambiguity problem, E-CFG-amb (page 11) is undecidable and the set of E-CFG ambiguous grammars belongs to Σ 0 1. We reduce E-CFG-amb to INJECTIVE. Let G be an E-CFG. Using Lemma 1, define a PR function f G as described in the Lemma. It is clear that G is ambiguous iff the function f G is not injective. Thus INJECTIVE is not decidable Surjectivity and bijectivity An instance f of ONTO can be expressed as y x : f(x) = y. It follows the problem is in the class Π 0 2. An instance f of BIJECTIVE can be expressed as y, x 1, x 2 x : [f(x) = y] [x 1 x 2 f(x 1 ) f(x 2 )] Thus BIJECTIVE also belongs to the class Π 0 2. We first prove that neither of these two problems is semi-decidable, and then that neither is the complement of a semi-decidable problem Neither problem is semi-decidable Given the description d(m) of a Turing machine T and an input x, the following function is PR. { 0 if M(x) is halted at time t f(d(m), x, t) = 1 otherwise Given a Turing machine M described by d(m), the function g below is also PR. { 0 if f(d(m), d(m), t) = 0 [M(d(M)) is halted at time t] g(t) = t if f(d(m), d(m), t) = 1 [otherwise] Notice that M(d(M)) diverges iff the PR function g is surjective; thus, we have a reduction SHP m ONTO (1) As the self-halting problem is undecidable but semi-decidable, we have proved that ONTO is undecidable and not semi-decidable otherwise SHP would be semi-decidable, which is false (see also the Property 4 in page 7). Thus, ONTO Σ 0 1 Note that the function g defined above also satisfies: g is a bijection iff M(d(M)) diverges, so we also have a reduction SHP m BIJECTIVE (2) which proves that BIJECTIVE Σ

22 Neither problem is the complement of a semi-decidable problem Consider now the PR function h(t) { t t0 the computation M(d(M)) halted at time t h(t) = 0 t 0 not halted at time t Clearly h(t) is surjective iff the the answer to the HP is yes, so that we have a reduction SHP m ONTO (3) As the self-halting problem is undecidable but semi-decidable, we have proved that ONTO is not the complement of a semi-decidable problem, ONTO Π 0 1. Finally, consider the PR function 0 if the computation M(d(M)) halts at time t h(t) = t + 1 not halted yet t otherwise (halted before t) As an example, we list the first values of h(t) in two cases. First, when the computation M(d(M)) diverges: and then when it halts at time 5: t : h(t) : t : h(t) : We see that h(t) is bijective iff the the answer to the HP is yes, so that we have a reduction SHP m BIJECTIVE (4) Thus BIJECTIVE Π 0 1. Note. This reduction could also have been used to prove that ONTO Π 0 1. The table in Figure 2 (page 23) summarizes our undecidability results about PR functions. The reductions used in the proofs of this section are represented in Figure 4 (page 24). 3.4 Primitive recursive versus partial recursive problems It is interesting to compare the degree of undecidability of the same problem about a function f in two cases: (i) f if primitive recursive, (ii) f is partial recursive. Theorem 21 Let A be a PR decision problem corresponding to the question does a given PR function have the property P? and let X be any decision 22

23 Num PR problem Class Proof 1 HAS-ZEROS Σ 0 1 \ page 14 2 EXACTLY-ONE-ZERO Σ 0 2 \ (Σ0 1 Π0 1 ) page 14 3 AT-LEAST-k-ZEROS Σ 0 1 \ page 15 4 EXACTLY-k-ZEROS Σ 0 2 \ (Σ0 1 Π0 1 ) page 15 5 ZERO-FUNCTION Π 0 1 \ page ZEROS Π 0 2 \ (Σ0 1 Π0 1 ) page 16 7 CODOMAIN-k, k = 1 Π 0 1 \ page 18 8 CODOMAIN-k, k 2 Σ 0 2 \ (Σ0 1 Π0 1 ) page 18 9 FINITE-CODOMAIN Σ 0 2 \ (Σ0 1 Π0 1 ) page INJECTIVE Π 0 1 \ page ONTO Π 0 2 \ (Σ0 1 Π0 1 ) Section BIJECTIVE Π 0 2 \ (Σ0 1 Π0 1 ) Section Figure 2: Some decision problems studied in this paper. In every problem the instance is a PR function. The problems are numbered (first column, in this color) for reference in Figure 3, page 23. Π 0 2 6, 11,12 2, 4, 8, 9 Σ 0 2 Π 0 1 5, 7, (decidable problems) 1, 3 Σ 0 1 Figure 3: Location in the arithmetic hierarchy of the problems mentioned in Figure 2, page 23. The problem numbers (1 to 12 in this color) refer to the numbers in the first column of Figure 2. 23

24 PCP SHP SHP E-CFG-amb INJECTIVE ONTO BIJECTIVE ONTO BIJECTIVE Figure 4: Reductions used in the proofs of Section 3.3. problem. If X m A, then X m A, where A corresponds to the question does a given partial recursive function have the property P?. Proof. Let f be the function corresponding to the reduction X m A. The image by f of a (positive or negative) instance x of X is a PR function, thus it is also a partial function. So, we can use the same function f for the reduction X m A. Let F (x, t) be the Boolean function that outputs true iff the computation f(x) halts at time t. We should have some care when dealing with a partial recursive function f because when we say something like f(x) = 0 we really mean two things: (i) the computation of f(x) converges and (ii) its output is 0. We now justify the classes in the last column of Figure 5 (page 25). 1. f(0) = 0: well known result. 2. TOTAL: see Theorem 1, page HAS-ZEROS: well known result. 4. NO-ZEROS, f has no zeros. The statement can be expressed as [ x, t : F (x, t) f(x) = 0] Thus it belongs to Π 0 1. We describe a reduction SHP m NO-ZEROS: let n be an instance of SHP; define { 0 if φn (n) halts in time t g(t) = 1 otherwise The function g has no zeros iff φ n (n) does not halt. We conclude that NO-ZEROS belongs to Π 0 1 \. 5. EXACTLY-ONE-ZERO: it is easy to see that this problems belongs to the same class as HALTS-ONE whose question is is f(x) defined for exactly one value of x?. The statement corresponding to HALTS-ONE is x, t : F (x, t) [ y : (y x) ( t : F (y, t))] 24

25 Problem f is primitive rec. f is partial rec. f(0) = 0 Σ 0 1 \ TOTAL Π 0 2 \ (Σ0 1 Π0 1 ) = HAS-ZEROS Σ 0 1 \ Σ0 1 \ = NO-ZEROS Π 0 1 \ Π0 1 \ = EXACTLY-ONE-ZERO Σ 0 2 \ (Σ0 1 Π0 1 ) Σ0 2 \ (Σ0 1 Π0 1 ) = AT-LEAST-k-ZEROS Σ 0 1 \ Σ0 1 \ = EXACTLY-k-ZEROS Σ 0 2 \ (Σ0 1 Π0 1 ) Σ0 2 \ (Σ0 1 Π0 1 ) ZERO-FUNCTION Π 0 1 \ Π0 2 \ (Σ0 1 Π0 1 ) = -ZEROS Π 0 2 \ (Σ0 1 Π0 1 ) Π0 2 \ (Σ0 1 Π0 1 ) CODOMAIN-k, k = 1 Π 0 1 \ Π0 2 \ (Σ0 1 Π0 1 ). CODOMAIN-k, k 2 Σ 0 2 \ (Σ0 1 Π0 1 ) Π0 2 \ (Σ0 1 Π0 1 ) = INJECTIVE Π 0 1 \ Π0 1 \ = ONTO Π 0 2 \ (Σ0 1 Π0 1 ) Π0 2 \ (Σ0 1 Π0 1 ). = BIJECTIVE Π 0 2 \ (Σ0 1 Π0 1 ) Π0 2 \ (Σ0 1 Π0 1 ). Figure 5: The degree of undecidability of some decision problems about a function f. Two cases are compared: f is a primitive recursive function (PR) and f is a partial recursive function. The symbol means that the partial recursive function problem is more undecidable than the corresponding PR problem. The symbols = and mean equally undecidable (in the same class of the ARithmetic Herarchy) or incomparable. 25

26 or x, t y, t : F (x, t) [(y x) ( F (y, t))] Thus, HALTS-ONE (and EXACTLY-ONE-ZERO) belong to the class Σ 0 2. (ii) EXACTLY-ONE-ZERO Σ 0 1. Reduction ( HP) m EXACTLY-ONE-ZERO: Let T, x be the instance of HP where the Turing machine T computes f. Define g as follows g x (t) def = f(x, t) = 0 if t = 0 1 if T (x) does not converge in t steps 0 otherwise Clearly g x (t) has exactly one zero iff T (x) does not halt. (iii) EXACTLY-ONE-ZERO Π 0 1. Reduction HP m EXACTLY-ONE-ZERO: given the instance T, x of HP, define the function g(y) that, for y = 0 outputs 0; and for y 0 simulates the computation T (x); if it halts, the output is 0; if not, g(y) is undefined. The function g(y) has exactly one zero iff the computation T (x) halts. Thus EXACTLY-ONE-ZERO belongs to Σ 0 2 \ (Σ0 1 Π0 1 ). 6. AT-LEAST-k-ZEROS (k fixed): easy to show that it is in Σ 0 1 ( dovetailing technique); HAS-ZEROS reduces easily to AT-LEAST-k-ZEROS, see the proof of Theorem 8 (page 15). 7. EXACTLY-k-ZEROS (k fixed): proof similar to EXACTLY-ONE-ZERO, see item 5. For instance, the statement corresponding to HALTS-TWO 5 can be written x 1, x 2, t 1, t 2 y, t : F (x 1, t 1 ) F (x 2, t 2 ) [(y x 1 ) (y x 2 ) ( F (y, t))] Thus EXACTLY-k-ZEROS belongs to Σ 0 2. As in item 5, both HP and HP can be reduced to EXACTLY-k-ZEROS. It follows that EXACTLY-k-ZEROS belongs to Σ 0 2 \ (Σ0 1 Π0 1 ). 8. ZERO-FUNCTION: The corresponding question can be expressed as [ [ x, t : F (x, t) (f(x) 0)] [ x t : F (x, t)] ] so that ZERO-FUNCTION belongs to Π 0 2. HP with instance n reduces to ZERO-FUNCTION using the function { 0 if φn (n) converges f(x) = undefined otherwise (The input is ignored) HP with instance n reduces to ZERO-FUNCTION 5 Which is equivalent (in the sense that each one reduces to the other) to the problem AT- LEAST-k-ZEROS for k = 2. 26

27 using the function { 0 if φn (n) does not converge in t steps f(t) = 1 otherwise It follows that ZERO-FUNCTION belongs to Σ 0 2 \ (Σ0 1 Π0 1 ). 9. -ZEROS: In Π 0 2. The question associated with the problem can be expressed as m x, t : (x m) F (x, t) (f(x) = 0) or: m x, y, t : (x = m + y) F (x, t) (f(x) = 0) Thus -ZEROS belongs to Π 0 2. By Theorem 21 (page 22) the reductions used in the proof of Theorem 12 (page 16) are also valid in this case. It follows that -ZEROS (for partial recursive functions) belongs to Π 0 2 \ (Σ0 1 Π0 1 ). 10. CODOMAIN-k, k = 1: can be expressed as the negation of (1) {}}{ [ x, t : F (x, t)] (2) {}}{ x, x, t, t, : F (x, t) F (x, t ) f(x) f(x ) The part (1) means f it is the totally undefined function while part (2) means there are at least two values for which f is defined and has different results. We can rewrite this logical statement, which is the negation of CODOMAIN-k for k = 1, as x 1, x 2, t 1, t 2 x, t : [ F (x, t)] [F (x 1, t 1 ) F (x 2, t 2 ) f(x 1 ) f(x 2 )] Thus CODOMAIN-k for k = 1 belongs to Π 0 2. We reduce SHP to (CODOMAIN-k, k = 1). Let n be the instance of SHP. Define f(t) = 0 if t = 0 0 if φ n (n) does not converge in t steps (t 1) 1 otherwise (t 1) Clearly φ n (n) diverges iff the codomain of f has size 1. Now reduce SHP to (CODOMAIN-k, k = 1). Let n be the instance of SHP. Define { undefined if φn (n) does not converge in t steps f(t) = 0 otherwise The computation φ n (n) halts iff the codomain of f has size 1. CODOMAIN-k for k = 1 belongs to Π 0 2 \ (Σ0 1 Π0 1 ). Thus 11. CODOMAIN-k, k 2: we exemplify for the case k = 2, the cases k 3 27

28 being similar. The negation of the statement is [ x, t : F (x, t)] size=0 [ x, t x, t : P (x, t, x, t )] size=1 [ x 1, x 2, x 3, t 1, t 2, t 3 : Q(x 1, x 2, x 3, t 1, t 2, t 2 )] size 3 where P (x, t, x, t ) denotes and Q(x 1, x 2, x 3, t 1, t 2, t 2 ) denotes F (x, t ) (F (x, t ) f(x ) = f(x )) F (x 1, t 1 ) F (x 2, t 2 ) F (x 3, t 3 ) f(x 1 ) f(x 2 ) f(x 2 ) f(x 3 ) f(x 3 ) f(x 1 ) The negation of the statement can be rewritten as x, t, x 1, x 2, x 3, t 1, t 2, t 3 x, t, x, t : F (x, t) P Q where the arguments of P and Q have been omitted. It follows that CODOMAIN-k for k = 2 belongs to Π 0 2. To prove that CODOMAIN-k for k = 2 is not in Π 0 1, reduce SHP (instance n) to CODOMAIN-k, k = 2 0 if t = 0 f(t) = 0 if φ n (n) did not converge in t 1 steps (t 1) 1 if φ n (n) converges in t 1 steps (t 1) (the case f(0) = 0 is considered because the possibility of convergence for t = 0). The function f has codomain with size 2 iff φ n (n). To prove that CODOMAIN-k for k = 2 is not in Σ 0 1, reduce SHP (instance n) to CODOMAIN-k, k = 2 0 if t = 0 1 if t = 1 f(t) = 0 if φ n (n) did not converge in t 2 steps (t 2) 2 if φ n (n) converges in t 2 steps (t 1) The function f has codomain with size 2 iff φ n (n). 12. FINITE-CODOMAIN: 13. : the function f diverves at infinitely many points. It can be stated as It follows that belongs to Π 0 3. Unfinished. n m t : (m n) ( F (m, t)) (a) Reductions TOTAL m and m TOTAL? (b) The problem is f defined at least at one point? is Σ

29 (c) The negation can be expressed as m : f m is total. The corresponding parameterized problem is given f and m, is f m total?. 14. INJECTIVE: for partial recursive functions the INJECTIVE statement can be expressed as [ x, y, t, t : F (x, t) F (y, t ) (f(x) = f(y))] (5) where F (x, t) has the same meaning as before (page 24). Notice that in a logic statement like this, when we talk about f(x) we implicitly assume that t : F (x, t); however this assumption, and a similar assumption for f(y), are already included in (5). It is easy to see that INJECTIVE is undecidable. Thus it belongs to the class Π 0 1 \. 15. ONTO: for partial recursive functions the ONTO statement can be expressed as y x, t : F (x, t) (f(x) = y) Thus ONTO is in Π 0 2. As PR functions are partial recursive functions, the reductions (1) (page 21) and (3) (page 22) are also valid here. It follows that, as in the PR function case, ONTO belongs to the class Π 0 2 \ (Σ0 1 Π0 1 ). 16. BIJECTIVE: for partial recursive functions the BIJECTIVE statement can be expressed as y, x, x 1, x 2 t : F (x, t) f(x) = y [(x 1 x 2 ) f(x 1 ) f(x 2 )] Note that this implies x t : F (x, t), so that we can talk about f(x 1 ) and f(x 2 ) without more proviso. Thus BIJECTIVE is in Π 0 2. As PR functions are partial recursive functions, the reductions (2) (page 21) and (4) (page 22) are also valid here. It follows that, as in the PR function case, BIJECTIVE belongs to the class Π 0 2 \ (Σ0 1 Π0 1 ). 4 Frontiers of decidability: the HAS-ZEROS problem In this section we consider the problem of determining whether a given unary PR function has at least one zero. As explained below, the function which is studied is a restriction of a general PR function f. The set of possible input (argument) values and the set of outputs will be restricted. We will find necessary and sufficient conditions for decidability of the problem does the modified function has a zero?. A possible way of restricting the inputs of a PR function f is to pre-apply to f some PR function 6 g. The outputs of f can be similarly restricted by post-applying to f some fixed PR function h. Both operations restrict the 6 We use a different text font for fixed PR functions like g and h. 29

Primitive recursive functions

Primitive recursive functions Primitive recursive functions Decidability problems Only pages: 1, 2, 3, 5, 23, 30, 43, 49 Armando Matos LIACC, UP 2014 Abstract Although every primitive recursive (PR) function is total, many problems

More information

About the relationship between formal logic and complexity classes

About the relationship between formal logic and complexity classes About the relationship between formal logic and complexity classes Working paper Comments welcome; my email: armandobcm@yahoo.com Armando B. Matos October 20, 2013 1 Introduction We analyze a particular

More information

What are the recursion theoretic properties of a set of axioms? Understanding a paper by William Craig Armando B. Matos

What are the recursion theoretic properties of a set of axioms? Understanding a paper by William Craig Armando B. Matos What are the recursion theoretic properties of a set of axioms? Understanding a paper by William Craig Armando B. Matos armandobcm@yahoo.com February 5, 2014 Abstract This note is for personal use. It

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

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

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability The Turing Machine Computability Motivating idea Build a theoretical a human computer Likened to a human with a paper and pencil that can solve problems in an algorithmic way The theoretical provides a

More information

Theory of Computation (IX) Yijia Chen Fudan University

Theory of Computation (IX) Yijia Chen Fudan University Theory of Computation (IX) Yijia Chen Fudan University Review The Definition of Algorithm Polynomials and their roots A polynomial is a sum of terms, where each term is a product of certain variables and

More information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages

More information

TURING MAHINES

TURING MAHINES 15-453 TURING MAHINES TURING MACHINE FINITE STATE q 10 CONTROL AI N P U T INFINITE TAPE read write move 0 0, R, R q accept, R q reject 0 0, R 0 0, R, L read write move 0 0, R, R q accept, R 0 0, R 0 0,

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012 Decision Problems with TM s Look at following sets: Lecture 31: Halting Problem CSCI 81 Spring, 2012 Kim Bruce A TM = { M,w M is a TM and w L(M)} H TM = { M,w M is a TM which halts on input w} TOTAL TM

More information

Final exam study sheet for CS3719 Turing machines and decidability.

Final exam study sheet for CS3719 Turing machines and decidability. Final exam study sheet for CS3719 Turing machines and decidability. A Turing machine is a finite automaton with an infinite memory (tape). Formally, a Turing machine is a 6-tuple M = (Q, Σ, Γ, δ, q 0,

More information

Limits of Computability

Limits of Computability Limits of Computability Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at Wolfgang Schreiner

More information

Informal Statement Calculus

Informal Statement Calculus FOUNDATIONS OF MATHEMATICS Branches of Logic 1. Theory of Computations (i.e. Recursion Theory). 2. Proof Theory. 3. Model Theory. 4. Set Theory. Informal Statement Calculus STATEMENTS AND CONNECTIVES Example

More information

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes These notes form a brief summary of what has been covered during the lectures. All the definitions must be memorized and understood. Statements

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THURSDAY APRIL 3 REVIEW for Midterm TUESDAY April 8 Definition: A Turing Machine is a 7-tuple T = (Q, Σ, Γ, δ, q, q accept, q reject ), where: Q is a

More information

CS154, Lecture 10: Rice s Theorem, Oracle Machines

CS154, Lecture 10: Rice s Theorem, Oracle Machines CS154, Lecture 10: Rice s Theorem, Oracle Machines Moral: Analyzing Programs is Really, Really Hard But can we more easily tell when some program analysis problem is undecidable? Problem 1 Undecidable

More information

4.2 The Halting Problem

4.2 The Halting Problem 172 4.2 The Halting Problem The technique of diagonalization was discovered in 1873 by Georg Cantor who was concerned with the problem of measuring the sizes of infinite sets For finite sets we can simply

More information

Opleiding Informatica

Opleiding Informatica Opleiding Informatica Tape-quantifying Turing machines in the arithmetical hierarchy Simon Heijungs Supervisors: H.J. Hoogeboom & R. van Vliet BACHELOR THESIS Leiden Institute of Advanced Computer Science

More information

6.8 The Post Correspondence Problem

6.8 The Post Correspondence Problem 6.8. THE POST CORRESPONDENCE PROBLEM 423 6.8 The Post Correspondence Problem The Post correspondence problem (due to Emil Post) is another undecidable problem that turns out to be a very helpful tool for

More information

Functions on languages:

Functions on languages: MA/CSSE 474 Final Exam Notation and Formulas page Name (turn this in with your exam) Unless specified otherwise, r,s,t,u,v,w,x,y,z are strings over alphabet Σ; while a, b, c, d are individual alphabet

More information

CMPS 217 Logic in Computer Science. Lecture #17

CMPS 217 Logic in Computer Science.   Lecture #17 CMPS 217 Logic in Computer Science https://courses.soe.ucsc.edu/courses/cmps217/spring13/01 Lecture #17 1 The Complexity of FO-Truth on a Structure Structure A Complexity of Th(A) Structure of the natural

More information

Decidability: Church-Turing Thesis

Decidability: Church-Turing Thesis Decidability: Church-Turing Thesis While there are a countably infinite number of languages that are described by TMs over some alphabet Σ, there are an uncountably infinite number that are not Are there

More information

Computability Crib Sheet

Computability Crib Sheet Computer Science and Engineering, UCSD Winter 10 CSE 200: Computability and Complexity Instructor: Mihir Bellare Computability Crib Sheet January 3, 2010 Computability Crib Sheet This is a quick reference

More information

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010) http://math.sun.ac.za/amsc/sam Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics 2009-2010 Lecture notes in progress (27 March 2010) Contents 2009 Semester I: Elements 5 1. Cartesian product

More information

CS481F01 Solutions 8

CS481F01 Solutions 8 CS481F01 Solutions 8 A. Demers 7 Dec 2001 1. Prob. 111 from p. 344 of the text. One of the following sets is r.e. and the other is not. Which is which? (a) { i L(M i ) contains at least 481 elements }

More information

CSCI3390-Lecture 6: An Undecidable Problem

CSCI3390-Lecture 6: An Undecidable Problem CSCI3390-Lecture 6: An Undecidable Problem September 21, 2018 1 Summary The language L T M recognized by the universal Turing machine is not decidable. Thus there is no algorithm that determines, yes or

More information

Automata Theory and Formal Grammars: Lecture 1

Automata Theory and Formal Grammars: Lecture 1 Automata Theory and Formal Grammars: Lecture 1 Sets, Languages, Logic Automata Theory and Formal Grammars: Lecture 1 p.1/72 Sets, Languages, Logic Today Course Overview Administrivia Sets Theory (Review?)

More information

CSCE 551: Chin-Tser Huang. University of South Carolina

CSCE 551: Chin-Tser Huang. University of South Carolina CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Church-Turing Thesis The definition of the algorithm came in the 1936 papers of Alonzo Church h and Alan

More information

Undecidable Problems and Reducibility

Undecidable Problems and Reducibility University of Georgia Fall 2014 Reducibility We show a problem decidable/undecidable by reducing it to another problem. One type of reduction: mapping reduction. Definition Let A, B be languages over Σ.

More information

ACS2: Decidability Decidability

ACS2: Decidability Decidability Decidability Bernhard Nebel and Christian Becker-Asano 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem

More information

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops. and their languages } Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops. } Some languages are Turing-recognizable, but not

More information

Theory of Computer Science

Theory of Computer Science Theory of Computer Science D6. Decidability and Semi-Decidability Malte Helmert University of Basel May 4, 2016 Overview: Computability Theory Computability Theory imperative models of computation: D1.

More information

17.1 The Halting Problem

17.1 The Halting Problem CS125 Lecture 17 Fall 2016 17.1 The Halting Problem Consider the HALTING PROBLEM (HALT TM ): Given a TM M and w, does M halt on input w? Theorem 17.1 HALT TM is undecidable. Suppose HALT TM = { M,w : M

More information

UNIT-VIII COMPUTABILITY THEORY

UNIT-VIII COMPUTABILITY THEORY CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the

More information

Computability Theory. CS215, Lecture 6,

Computability Theory. CS215, Lecture 6, Computability Theory CS215, Lecture 6, 2000 1 The Birth of Turing Machines At the end of the 19th century, Gottlob Frege conjectured that mathematics could be built from fundamental logic In 1900 David

More information

uring Reducibility Dept. of Computer Sc. & Engg., IIT Kharagpur 1 Turing Reducibility

uring Reducibility Dept. of Computer Sc. & Engg., IIT Kharagpur 1 Turing Reducibility uring Reducibility Dept. of Computer Sc. & Engg., IIT Kharagpur 1 Turing Reducibility uring Reducibility Dept. of Computer Sc. & Engg., IIT Kharagpur 2 FINITE We have already seen that the language FINITE

More information

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES Contents i SYLLABUS UNIT - I CHAPTER - 1 : AUT UTOMA OMATA Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 2 : FINITE AUT UTOMA OMATA An Informal Picture of Finite Automata,

More information

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages COMP/MATH 300 Topics for Spring 2017 June 5, 2017 Review and Regular Languages Exam I I. Introductory and review information from Chapter 0 II. Problems and Languages A. Computable problems can be expressed

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described

More information

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

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK COMS11700 Undecidability Department of Computer Science, University of Bristol Bristol, UK 4 April 2014 COMS11700: Undecidability Slide 1/29 Decidability We are particularly interested in Turing machines

More information

Non-emptiness Testing for TMs

Non-emptiness Testing for TMs 180 5. Reducibility The proof of unsolvability of the halting problem is an example of a reduction: a way of converting problem A to problem B in such a way that a solution to problem B can be used to

More information

Halting and Equivalence of Program Schemes in Models of Arbitrary Theories

Halting and Equivalence of Program Schemes in Models of Arbitrary Theories Halting and Equivalence of Program Schemes in Models of Arbitrary Theories Dexter Kozen Cornell University, Ithaca, New York 14853-7501, USA, kozen@cs.cornell.edu, http://www.cs.cornell.edu/~kozen In Honor

More information

Homework 8. a b b a b a b. two-way, read/write

Homework 8. a b b a b a b. two-way, read/write Homework 8 309 Homework 8 1. Describe a TM that accepts the set {a n n is a power of 2}. Your description should be at the level of the descriptions in Lecture 29 of the TM that accepts {ww w Σ } and the

More information

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam ECS 120: Theory of Computation Handout MT UC Davis Phillip Rogaway February 16, 2012 Midterm Exam Instructions: The exam has six pages, including this cover page, printed out two-sided (no more wasted

More information

Theory Bridge Exam Example Questions

Theory Bridge Exam Example Questions Theory Bridge Exam Example Questions Annotated version with some (sometimes rather sketchy) answers and notes. This is a collection of sample theory bridge exam questions. This is just to get some idea

More information

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms First-Order Logic 1 Syntax Domain of Discourse The domain of discourse for first order logic is FO structures or models. A FO structure contains Relations Functions Constants (functions of arity 0) FO

More information

Notes for Lecture Notes 2

Notes for Lecture Notes 2 Stanford University CS254: Computational Complexity Notes 2 Luca Trevisan January 11, 2012 Notes for Lecture Notes 2 In this lecture we define NP, we state the P versus NP problem, we prove that its formulation

More information

Reductions in Computability Theory

Reductions in Computability Theory Reductions in Computability Theory Prakash Panangaden 9 th November 2015 The concept of reduction is central to computability and complexity theory. The phrase P reduces to Q is often used in a confusing

More information

The Unsolvability of the Halting Problem. Chapter 19

The Unsolvability of the Halting Problem. Chapter 19 The Unsolvability of the Halting Problem Chapter 19 Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing Machines D and SD A TM M with

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 1 Course Web Page www3.cs.stonybrook.edu/ cse303 The webpage contains: lectures notes slides; very detailed solutions to

More information

258 Handbook of Discrete and Combinatorial Mathematics

258 Handbook of Discrete and Combinatorial Mathematics 258 Handbook of Discrete and Combinatorial Mathematics 16.3 COMPUTABILITY Most of the material presented here is presented in far more detail in the texts of Rogers [R], Odifreddi [O], and Soare [S]. In

More information

PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2

PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2 PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2 Neil D. Jones DIKU 2005 14 September, 2005 Some slides today new, some based on logic 2004 (Nils Andersen) OUTLINE,

More information

CS 125 Section #10 (Un)decidability and Probability November 1, 2016

CS 125 Section #10 (Un)decidability and Probability November 1, 2016 CS 125 Section #10 (Un)decidability and Probability November 1, 2016 1 Countability Recall that a set S is countable (either finite or countably infinite) if and only if there exists a surjective mapping

More information

Decidability (What, stuff is unsolvable?)

Decidability (What, stuff is unsolvable?) University of Georgia Fall 2014 Outline Decidability Decidable Problems for Regular Languages Decidable Problems for Context Free Languages The Halting Problem Countable and Uncountable Sets Diagonalization

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Nachum Dershowitz & Yishay Mansour. Tel Aviv University. May 17 22, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

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

Undecibability. Hilbert's 10th Problem: Give an algorithm that given a polynomial decides if the polynomial has integer roots or not. Undecibability Hilbert's 10th Problem: Give an algorithm that given a polynomial decides if the polynomial has integer roots or not. The problem was posed in 1900. In 1970 it was proved that there can

More information

This is logically equivalent to the conjunction of the positive assertion Minimal Arithmetic and Representability

This is logically equivalent to the conjunction of the positive assertion Minimal Arithmetic and Representability 16.2. MINIMAL ARITHMETIC AND REPRESENTABILITY 207 If T is a consistent theory in the language of arithmetic, we say a set S is defined in T by D(x) if for all n, if n is in S, then D(n) is a theorem of

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. May 11/13, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Lecture 1: The arithmetic hierarchy

Lecture 1: The arithmetic hierarchy MODEL THEORY OF ARITHMETIC Lecture 1: The arithmetic hierarchy Tin Lok Wong 8 October, 2014 [These theorems] go a long way to explaining why recursion theory is relevant to the study of models of arithmetic.

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 15 Ana Bove May 17th 2018 Recap: Context-free Languages Chomsky hierarchy: Regular languages are also context-free; Pumping lemma

More information

Theory of Computer Science. Theory of Computer Science. D8.1 Other Halting Problem Variants. D8.2 Rice s Theorem

Theory of Computer Science. Theory of Computer Science. D8.1 Other Halting Problem Variants. D8.2 Rice s Theorem Theory of Computer Science May 15, 2017 D8. Rice s Theorem and Other Undecidable Problems Theory of Computer Science D8. Rice s Theorem and Other Undecidable Problems Malte Helmert University of Basel

More information

The complexity of recursive constraint satisfaction problems.

The complexity of recursive constraint satisfaction problems. The complexity of recursive constraint satisfaction problems. Victor W. Marek Department of Computer Science University of Kentucky Lexington, KY 40506, USA marek@cs.uky.edu Jeffrey B. Remmel Department

More information

V Honors Theory of Computation

V Honors Theory of Computation V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant

More information

Chap. 4 Computability

Chap. 4 Computability THEORY OF COMPUTATION Formal Languages, Automata, and Complexity Chap. 4 Computability J. Glenn Brokshear The Benjamin/Cummings Pub. Comp., Inc. 1989 1 4.1 Foundation of Recursive Function Theory computation

More information

Section 14.1 Computability then else

Section 14.1 Computability then else Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible algorithms. Example (Turing machines). Associate

More information

The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc.

The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc. The Pumping Lemma For every regular language L, there is a number l 1 satisfying the pumping lemma property: All w L with w l can be expressed as a concatenation of three strings, w = u 1 vu 2, where u

More information

1 Computational Problems

1 Computational Problems Stanford University CS254: Computational Complexity Handout 2 Luca Trevisan March 31, 2010 Last revised 4/29/2010 In this lecture we define NP, we state the P versus NP problem, we prove that its formulation

More information

Bjorn Poonen. MSRI Introductory Workshop on Rational and Integral Points on Higher-dimensional Varieties. January 18, 2006

Bjorn Poonen. MSRI Introductory Workshop on Rational and Integral Points on Higher-dimensional Varieties. January 18, 2006 University of California at Berkeley MSRI Introductory Workshop on Rational and Integral Points on Higher-dimensional Varieties January 18, 2006 The original problem H10: Find an algorithm that solves

More information

Chapter 2 Algorithms and Computation

Chapter 2 Algorithms and Computation Chapter 2 Algorithms and Computation In this chapter, we first discuss the principles of algorithm and computation in general framework, common both in classical and quantum computers, then we go to the

More information

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65 Undecidable Problems Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, 2018 1/ 65 Algorithmically Solvable Problems Let us assume we have a problem P. If there is an algorithm solving

More information

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland Discrete Mathematics W. Ethan Duckworth Fall 2017, Loyola University Maryland Contents 1 Introduction 4 1.1 Statements......................................... 4 1.2 Constructing Direct Proofs................................

More information

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas. 1 Chapter 1 Propositional Logic Mathematical logic studies correct thinking, correct deductions of statements from other statements. Let us make it more precise. A fundamental property of a statement is

More information

Further discussion of Turing machines

Further discussion of Turing machines Further discussion of Turing machines In this lecture we will discuss various aspects of decidable and Turing-recognizable languages that were not mentioned in previous lectures. In particular, we will

More information

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online

More information

Computability THEORY OF COMPUTATION

Computability THEORY OF COMPUTATION 11/27/14 9-1 Computability 1 Computability THEORY OF COMPUTATION Formal Languages, Automata, and Complexity J. Glenn Brokshear The Benjamin/Cummings Pub. Comp., Inc. 1989 1.1 Foundation of Recursive Function

More information

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

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar Turing Machine A Turing machine is an abstract representation of a computing device. It consists of a read/write

More information

DM17. Beregnelighed. Jacob Aae Mikkelsen

DM17. Beregnelighed. Jacob Aae Mikkelsen DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................

More information

Large Numbers, Busy Beavers, Noncomputability and Incompleteness

Large Numbers, Busy Beavers, Noncomputability and Incompleteness Large Numbers, Busy Beavers, Noncomputability and Incompleteness Food For Thought November 1, 2007 Sam Buss Department of Mathematics U.C. San Diego PART I Large Numbers, Busy Beavers, and Undecidability

More information

An Intuitively Complete Analysis of Gödel s Incompleteness

An Intuitively Complete Analysis of Gödel s Incompleteness An Intuitively Complete Analysis of Gödel s Incompleteness JASON W. STEINMETZ (Self-funded) A detailed and rigorous analysis of Gödel s proof of his first incompleteness theorem is presented. The purpose

More information

ECS 120 Lesson 18 Decidable Problems, the Halting Problem

ECS 120 Lesson 18 Decidable Problems, the Halting Problem ECS 120 Lesson 18 Decidable Problems, the Halting Problem Oliver Kreylos Friday, May 11th, 2001 In the last lecture, we had a look at a problem that we claimed was not solvable by an algorithm the problem

More information

GTI. Undecidability. Total Recall 3. Halting. Undecidability. A. Ada, K. Sutner Carnegie Mellon University. Spring 2018

GTI. Undecidability. Total Recall 3. Halting. Undecidability. A. Ada, K. Sutner Carnegie Mellon University. Spring 2018 GTI Undecidability A. Ada, K. Sutner Carnegie Mellon University Spring 2018 1 Cardinality Halting Undecidability Total Recall 3 A set A is finite countably infinite uncountable bijection {0, 1,..., n 1}

More information

SD & Turing Enumerable. Lecture 33: Reductions and Undecidability. Lexicographically Enumerable. SD & Turing Enumerable

SD & Turing Enumerable. Lecture 33: Reductions and Undecidability. Lexicographically Enumerable. SD & Turing Enumerable SD & Turing Lecture 33: Reductions and Undecidability CSCI 81 Spring, 2012 Kim Bruce Theorem: A language is SD iff it is Turing enumerable. Proof: Spose L is Turing enumerable. Show L is SD. Let w be input.

More information

Theory of Computation - Module 4

Theory of Computation - Module 4 Theory of Computation - Module 4 Syllabus Turing Machines Formal definition Language acceptability by TM TM as acceptors, Transducers - designing of TM- Two way infinite TM- Multi tape TM - Universal Turing

More information

Handbook of Logic and Proof Techniques for Computer Science

Handbook of Logic and Proof Techniques for Computer Science Steven G. Krantz Handbook of Logic and Proof Techniques for Computer Science With 16 Figures BIRKHAUSER SPRINGER BOSTON * NEW YORK Preface xvii 1 Notation and First-Order Logic 1 1.1 The Use of Connectives

More information

Theory of Computer Science

Theory of Computer Science Theory of Computer Science D1. Turing-Computability Malte Helmert University of Basel April 18, 2016 Overview: Course contents of this course: logic How can knowledge be represented? How can reasoning

More information

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:

More information

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181. Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität

More information

Recap (1) 1. Automata, grammars and other formalisms can be considered as mechanical devices to solve mathematical problems

Recap (1) 1. Automata, grammars and other formalisms can be considered as mechanical devices to solve mathematical problems Computability 1 Recap (1) 1. Automata, grammars and other formalisms can be considered as mechanical devices to solve mathematical problems Mathematical problems are often the formalization of some practical

More information

Notes on Satisfiability-Based Problem Solving. First Order Logic. David Mitchell October 23, 2013

Notes on Satisfiability-Based Problem Solving. First Order Logic. David Mitchell October 23, 2013 Notes on Satisfiability-Based Problem Solving First Order Logic David Mitchell mitchell@cs.sfu.ca October 23, 2013 Preliminary draft. Please do not distribute. Corrections and suggestions welcome. In this

More information

Mathematics Review for Business PhD Students

Mathematics Review for Business PhD Students Mathematics Review for Business PhD Students Anthony M. Marino Department of Finance and Business Economics Marshall School of Business Lecture 1: Introductory Material Sets The Real Number System Functions,

More information

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY No part of this publication may be reproduced or distributed in any form or any means, electronic, mechanical, photocopying, or otherwise without the prior permission of the author. GATE SOLVED PAPER Computer

More information

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

ON COMPUTAMBLE NUMBERS, WITH AN APPLICATION TO THE ENTSCHENIDUGSPROBLEM. Turing 1936 ON COMPUTAMBLE NUMBERS, WITH AN APPLICATION TO THE ENTSCHENIDUGSPROBLEM Turing 1936 Where are We? Ignoramus et ignorabimus Wir mussen wissen Wir werden wissen We do not know We shall not know We must know

More information

CST Part IB. Computation Theory. Andrew Pitts

CST Part IB. Computation Theory. Andrew Pitts Computation Theory, L 1 1/171 CST Part IB Computation Theory Andrew Pitts Corrections to the notes and extra material available from the course web page: www.cl.cam.ac.uk/teaching/0910/comptheory/ Introduction

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Decidability, Undecidability and Reducibility; Codes, Algorithms and Languages CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario,

More information

1 Showing Recognizability

1 Showing Recognizability CSCC63 Worksheet Recognizability and Decidability 1 1 Showing Recognizability 1.1 An Example - take 1 Let Σ be an alphabet. L = { M M is a T M and L(M) }, i.e., that M accepts some string from Σ. Prove

More information

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4 Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form: A BC A a S ε B and C aren t start variables a is

More information

16.1 Countability. CS125 Lecture 16 Fall 2014

16.1 Countability. CS125 Lecture 16 Fall 2014 CS125 Lecture 16 Fall 2014 16.1 Countability Proving the non-existence of algorithms for computational problems can be very difficult. Indeed, we do not know how to prove P NP. So a natural question is

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. April 18/ May 2, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information