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

Size: px
Start display at page:

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

Transcription

1 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 problem Example: the problem of deciding if a string belongs to a language can be seen as the mathematical formalization of the recognition of a statement in a programming language

2 Computability 2 Recap (2) 2. Some formalisms are more powerful than others TMs can accept languages that are not recognizable by NDPDAs 3. No formalism (among the ones we have seen) is more powerful than TMs Some formalisms are as powerful as TMs (e.g., two-stack automata)

3 Computability 3 Some questions (1) Are the introduced formalisms adequate to capture the essence of a mechanical solver? Differential equations Finding a path in a graph Does the ability of a mechanism to solve a problem depend on the way the problem is formalized?

4 Some questions (2) Do there exist computing formalisms more powerful than TMs? Some (future) super computer? Once a problem has been suitably formalized, can we always solve it by means of some mechanical device? Do we have the answers? Computability 4

5 Computability 5 Computability theory We want to show that our formalisms are adequate for any particular problem to be solved mechanically What is a problem? We need to investigate the power of TMs (and equivalent formalisms) w.r.t. any other theoretical or practical computer device We study the limits of mechanical problem solving Can we mechanically solve any definable problem?

6 Computability 6 A historical aside Aristotle s analysis of inference patterns (syllogisms) remained the only logical paradigm for two millennia and forms the basis of modern propositional logic His aim was to develop a universal method of reasoning by which one could learn everything there is to know about reality Both Leibniz and Pascal (17 th century) realized that syllogistic analysis could be done mechanically By machines feasible even with the limited technology of their time! Leibniz dreamed of a calculus ratiocinator: when there are disputes among persons, we can simply say calculemus, without further ado, to see who is right

7 Our formalisms Several problems can be formalized as language recognition or translation problems x L? y= τ(x)? More precisely, every mathematical problem can be formalized as above Computability 7

8 Formalization of a mathematical problem Our formalisms are suitable for all problems with denumerable domains Elements of such a domain can be put in a bijective correspondence with the elements of N The original problem is reduced to computing a function f: N N Computability 8

9 Example Problem: find a solution to a system of equations of the type a 1 x 1 +a 2 x 2 =c 1 b 1 x 1 +b 2 x 2 =c 2 where a 1, a 2, b 1, b 2, c 1, c 2 are integers It can be seen as computing a function f:z 6 Q 2 (integers and rational numbers respectively), defined as f(a 1, a 2, b 1, b 2, c 1, c 2 )=<r 1, r 2 > where r 1, r 2 are the values for the unknowns that solve the equations Computability 9

10 Computability 10 Recognition vs translation Recognition and translation are two formulations of a problem that can be reduced to one another From translation to recognition If I have a machine that can solve all problems of the form y = τ(x) and I wish to use it to solve the problem x L?, it suffices to define τ(x) = if x L then 1 else 0 From recognition to translation If I have a machine that can solve all problems of the form x L?, I can define the language L τ ={x$y y= τ(x)} For a fixed x, I can enumerate all possible strings y over the output alphabet and for each of them ask the machine if x$y L τ Sooner or later, if τ(x) is defined, I will find the string for which the machine answers positively The procedure is longish But here we are not concerned with the length of the computation

11 Remarks All the examined formalisms are discrete Denumerable mathematical domains defined in a finite way but this is in agreement with digital technologies The class of problems that can be solved by a TM is independent of the chosen alphabet (as long as it has at least two symbols) Computability 11

12 TMs and programming languages Given a TM M it is possible to build a Pascal (or C or FORTRAN or ) program that simulates M The computer runs the program with an arbitrarily large amount of memory Given any Pascal (or ) program it is possible to build a TM that computes the same function computed by the program TMs have the same expressive power as high-level programming languages Computability 12

13 Computability 13 Church s thesis (part I) There is no formalism to model any mechanical calculus that is more powerful than the TM or equivalent formalisms It is not a theorem (in principle, it should be checked every time anyone comes up with a new computational model)

14 Computability 14 Algorithms Algorithm is a fundamental concept in computer science Intuitively, by algorithm we mean a procedure to solve problems by means of an automatic computing device also seen as an abstract way to represent computer programs In summary, the notion of algorithm captures the notion of abstract sequence of commands to solve a problem in a mechanical way

15 (Informal) Properties of algorithms (1) 1. The sequence of statements must be finite 2. Any statement must be executable by some mechanical computing processor 3. The computing processor is provided with a memory to store intermediate results 4. Computation is discrete Information is coded digitally Computation proceeds through discrete steps Computability 15

16 Computability 16 (Informal) Properties of algorithms (2) 5. Algorithms are executed deterministically 6. There is no finite bound on input and output data 7. There is no bound on the available amount of storage required to perform computations 8. There is no bound on the number of discrete steps required to perform a computation

17 Computability 17 Church s thesis (part II) Any algorithm can be coded in terms of a TM (or an equivalent formalism) No algorithm can solve problems that cannot be solved by a TM: the TM is the most powerful computer that we have and will ever have!

18 Computability 18 Important question (and partial answer) Which are the problems that can be solved algorithmically (or, with an equivalent term, automatically )? Answer: These are exactly the problems that can be solved by the (relatively simple) TM!

19 TM: open questions (by now) TM = device to solve a given predefined problem A TM can be seen as an abstract, special-purpose non-programmable computer Questions: Can TMs model programmable computers? Can TMs compute all functions from N to N? Computability 19

20 Algorithmic enumeration A set S can be algorithmically enumerated (E) if we can find a bijection between S and N E : S N E can be calculated through an algorithm (i.e., a TM by Church s thesis) Example: Algorithmic enumeration of {a,b} * ε a b aa ab ba bb aaa aab Computability 20

21 Important fact TMs can be algorithmically enumerated We need to show the algorithm that does it Some hypotheses (no loss of generality): Single tape TM Fixed alphabet A (e.g., A = 3, A = {0, 1, _}) Computability 21

22 Enumerating TMs (1) Example: TMs with two states The possible transition functions are 0 1 _ 0 1 _ q 0 q 0 q 1 q 1 <q 0, 0, S> MT 0 MT 1 NB: TMs differ also by their final states With 2 states there are 2 2 =4 possible sets of final states Computability 22

23 Enumerating TMs (2) How many transition functions of 2-state TMs? δ: Q A Q A {R,L,S} { } In general: how many functions f: D R? R D ( x D we have R choices} so with Q = 2, A = 3, ( ) (2 3) = 19 6 transition functions of TMs with 2 states Considering the 2 2 choices for the final states, we have TMs Let us sort these TMs: {M 0, M 1, M } Computability 23

24 Enumerating TMs (3) Analogously we can sort the ( ) (3 3) 2 3 TMs with 3 states and so on. We obtain an enumeration E: {TMs} N The enumeration E is algorithmic (or effective): we can always write a program in C (i.e., a TM ) that, given n, produces the n-th TM and vice versa E(M) is called the Gödel number of M and E a Gödelization Computability 24

25 Computability 25 Some conventions Since we are speaking of numbers, the following will be considered equivalent: Problem Computing a function f: N N Moreover: f y = function computed by the y-th TM

26 Computability 26 First answer Can TMs model programmable computers? Yes! Consider the Universal Turing Machine (UTM) The UTM computes the function g(y,x)=f y (x) f y (x) = function computed by the y-th TM on input x

27 Computability 27 The UTM is a TM UTM does not seem to belong to the family {M y } because f y is a function of one variable, while g is a function of two variables but we know that N N N ( x + y)( x + y + 1) d ( x, y) = + 2 x

28 Computability 28 How does the UTM work? (1) We can encode g(y,x) as a g^(n) = g(d -1 (n)), with n=d(y,x), <y,x>=d -1 (n) d and d -1 are both computable Organization of a UTM that computes g^ Given n it computes d -1 (n) =<y,x> Then it builds the transition function of M y (by computing E -1 (y)) and stores it on the tape of the UTM: $ q a q a S $....

29 How does the UTM work? (2) In another tape portion we store an encoding of the configuration of M y # q # NB: The special symbols (#, $, states, ) are used as separators and do not occur elsewhere At the end, the UTM leaves on the tape f y (x) if and only if M y terminates its computation on x Computability 29

30 Computability 30 Remarks The TM is a very abstract and simple model of a computer Let us continue the analogy: TM: computer with a single, hard-coded program An ordinary TM always executes the same algorithm, i.e., it always computes the same function UTM: computer with program stored in memory: y = program x = input to the program

31 Computability 31 Second answer Can TMs compute all functions from N to N? More precisely does the UTM compute all functions from N to N? No, there are functions that cannot be computed by any UTM I.e., by Church s thesis: there are problems that cannot be solved algorithmically It is not only an intuition, we can prove it

32 Cardinalities of sets of functions Two interesting questions: How many functions f: N N are there? Which are the functions f y : N N? Let us start with how many : {f: N N} {f: N {0,1} } {f: N N } {f: N {0,1} } = (N) = 2 א 0 א 0 = cardinality of the set N of all natural numbers read aleph-naught or aleph-zero 2 א 0 = cardinality of the set R of all real numbers Computability 32

33 Problems vs Solutions The set of problems: {f: N N } {f: N {0,1} } = (N) = 2 א 0 The set of functions computed by TM {f y : N N} is by definition denumerable NB: E: {M y } N induces E^: N {f y } not one-to-one (in many cases f y = f z, with z y) but it suffices to be able to state that {f y : N N} = א 0 < 2 א 0 most of the problems cannot be solved algorithmically! There are many more problems than programs! Computability 33

34 Computability 34 Definable problems In order to define a problem we need to use a sentence (string) of some language: f(x) = x 2 f(x) = x g(z)dz a the number that multiplied by itself is equal to y Any language is a subset of A *, which is a denumerable set The set of the problems that can be defined is also denumerable Question: {Solvable Problems} = {Definable Problems}? Certainly {Solvable Problems} {Definable Problems}

35 Computability 35 Example The halting problem I build a program I give it some input data I know that in general the program might not terminate its execution (it could run into a loop ) Can I determine (in advance) if this will occur? This problem can be expressed in terms of TMs: Given a function g(y,x) = 1 if f y (x), g(y,x) = 0 if f y (x) = Is there a TM that computes g?

36 Computability 36 Which problems can be solved? A TM that computes g does not exist That s why a computer (which is a program) cannot warn us that the program we just wrote will run into an infinite loop on certain data (while it can easily report a missing } ) Some examples: Determining whether an arithmetic expression is well parenthesized is a solvable (decidable) problem Determining whether a given program will run into an infinite loop on a given input is an algorithmically unsolvable (undecidable) problem

37 Proof methods Proof by induction This technique can be used, e.g., to show that an FSA is coherent with the language it is defined for Constructive proof Proof by contradiction. There are other useful approaches Computability 37

38 Computability 38 Proofs by diagonalization (1) The original diagonalization argument was used by Georg Cantor in 1891 to prove that R has greater cardinality than N It is used to prove the undecidability of some famous problems The notion of proof by diagonalization refers to a common pattern

39 Computability 39 Proofs by diagonalization (2) Informally, it obtains a contradiction when there exists a set of functions A B which is indexed by A. If f k is the function indexed by k A, a diagonalization argument is f f f f " f f f f (1) (1) (1) (1) " f f f f (2) (2) (2) (2) " f f f f The diagonal of the array is the list of values given by f k (k) (3) (3) (3) (3) " f f f f (4) (4) (4) (4) " # # # # #!

40 Proofs by diagonalization (3) We define the diagonal element as a function d:a B that differs from the diagonal at every value. d is a function A B, so it appears on the list but it also differs from every member of the list at the diagonal hence we have a contradiction Computability 40

41 Computability 41 Informally No TM can decide whether, for a generic TM M and a generic input x, M halts on input x Here by halts, we mean halts in a final state NB: It is always possible to build a TM that will eventually terminate if and only if it reaches a final state (emulation)

42 Computability 42 Formally No TM can compute the total function g: N N {0,1} defined as g(y,x)= if f y (x) then1 else 0 f y (x) means that M y comes to halt in a final state on reading x so that f y (x) is defined

43 Computability 43 Proof (1) It employs a typical diagonal technique Let us assume (by contradiction) that g(y,x) = if f y (x) then 1 else 0 is computable From g, let us define function h such that h(x) = if g(x,x) = 0 then 1 else g(x,x) = 0 corresponds to f x (x) = If g were computable then h would be computable too

44 Proof (2) Notice that if h is computable then h = f i for some i. Let us compute h in i If h(i) = f i (i) = 1 then g(i,i) = 0, that is, f i (i)= CONTRADICTION If h(i) = f i (i) = then g(i,i) = 1 that is, f i (i) CONTRADICTION Computability 44

45 An important lemma (1) The function h (x)=if f x (x) then 1 else 0 is not computable It is not a corollary, but a lemma of the previous claim (halting problem) This result cannot be derived from the previous one Computability 45

46 Computability 46 An important lemma (2) Notice that h (x) is a special case of function g(y,x) g(y,x) = if f y (x) then 1 else 0 because h (x)=g(x,x) and g was just proved to be uncomputable The uncomputability of h(x) is not an immediate consequence of the uncomputability of g(y,x): If a problem is unsolvable, then a special case of it might be solvable e.g., some properties that cannot be decided for recursively enumerable languages can be decided for regular languages Instead, a generalization of an unsolvable problem is necessarily unsolvable If a problem is solvable, a generalization of it might be unsolvable But any specialization of it is certainly solvable

47 Another important result (1) The function k(y) = 1 if f y is total, i.e., k(y) = if ( x N f y (x) ) then 1 else 0 is not computable This problem presents a quantification w.r.t. all possible input data. In some cases we could be able to establish, for a fixed value of variable x, whether f y (x) perhaps even for every single, fixed value of x without however being able to answer the question is f y a total function? Computability 47

48 Another important result (2) From a practical viewpoint, this problem is (perhaps) even more relevant than the previous one Given a (generic) program, we want to know if it will terminate the execution for every input data or if it may, for some data, run into an endless loop In the halting problem, instead, we were interested in knowing whether a given (generic) program with some given (generic) input data terminates Computability 48

49 Computability 49 Proof (1) Standard technique: diagonal + contradiction, with some technicalities. Hypothesis: k(y) = if ( x N f y (x) ) then 1 else 0 is computable and (by definition) total Then define g(x) = w = index (Gödel number) of the x-th TM (in E) that computes a total function If k is computable and total, then so is g: compute k(0), k(1),, let w 0 be the first value such that k(w 0 ) = 1, then let g(0) = w 0 ; then let g(1) = w 1, w 1 being the second value such that k(w 1 ) = 1; the procedure is algorithmic; furthermore, since there are infinitely many total functions, g(x) is certainly defined for each x, hence it is total.

50 Computability 50 Proof (2) g is also strictly monotonic: w x+1 > w x ; hence g -1 is also a function, strictly monotonic too, but not total: g -1 (w) is defined only if w is the Gödel number of a total function Then: 1. We define h(x) = f g(x) (x) + 1 = f w (x) + 1 f w is computable and total hence so is h 2. Therefore, we have h = f w i for some w i since h is total, g -1 (w i ), let g -1 (w i ) = x i What is the value of h(x i )? h(x i ) = f g(xi )(x i ) + 1 = f wi (x i ) + 1 (from (1)) h = f wi h(x i ) = f wi (x i ) (from (2)) Contradiction!

51 Computability 51 Solvability and solutions (1) Observation: knowing that a problem is solvable does not mean that we know how to solve it (and what the solution is) In mathematics we often have non-constructive proofs: one shows that a mathematical object exists, but does not compute it In our case: a problem is solvable if there exists a TM that solves it for some problems one can reach the conclusion that there exists a TM that solves them, but despite this one cannot build it A trivial case: the problem consists of answering a question with a yes/no answer (a so-called closed question): Is it true that the number of atoms in the universe is ? Is it true that the perfect chess game will end in a draw? (before ) Is it true that ( x,y,z,w N x y +z y =w y y>2)?.

52 Computability 52 Solvability and solutions (2) In the previous examples, one knows a priori that the answer is either Yes or No though one does (did) not know which one it is Problem = function; solve a problem = compute a function What function can one associate with the previous problems? If one encodes TRUE=1; FALSE=0, all the above problems are expressed by one of the following two functions: f 1 (x) = 1, x, f 2 (x) = 0, x Both functions are computable More abstractly: g(10,20) = 1 if f 10 (20), g(10,20) = 0 if f 10 (20) = g(100,200) = 1 if f 100 (200), g(100,200) = 0 if f 100 (200) = g(7,28) = 1 if f 7 (28), g(7,28) = 0 if f 7 (28) =. As standalone problems, these are all solvable However, we do not necessarily know the solution

53 Non-trivial examples (1) Let us now consider less trivial cases: f(x) = x-th digit of the decimal expansion of π f is computable (we know algorithms (TMs) to compute it) Let us investigate the computability of the following function g(x) = if in π exactly x consecutive 5 digits then 1 else 0 By computing the sequence (π = ) {f(0) = 3, f(1) = 1, f(2) = 4, f(3) = 1, f(4) = 5, f(5) = 9, } We get g(1) = 1 In general the plot of function g will be something like: x 5 y 9 10 Computability 53

54 Computability 54 Non-trivial examples (2) For some value of x we might find that g(x) = 1 More so, if g(x)=1, sooner or later we will find it, if we are patient But could we conclude that, for instance, g( ) = 0 if after computing f( ) we have not (yet) found consecutive 5 s? Can we rule out the following conjecture? For every x, by producing a sufficiently long sequence of π, sooner or later we will find x consecutive 5 s If this conjecture were true, then it would follow that g is the constant function g(x) = 1 x, and we could conclude that we can compute g. In conclusion, at the current state of the art, we can neither conclude that g is computable, nor that it is not.

55 Computability 55 Non-trivial examples (3) Now consider the following slight modification of g: h(x) =if in π at least x consecutive 5 s then 1 else 0 if g(x) = 1 then also h(x) = 1; Notice however that if, for some x, h(x) = 1, then h(y)=1 y x. The plot of h is like one the following two: 1) h(x) = 1 x 2) x h(x) h(x) = 1 x x = 0 x > x

56 Computability 56 Non-trivial examples (4) Then h certainly is in the following set of functions {h h (x) = 1 x x h (x) = 0 x x x x Each function in this set is trivially computable > x} {h h(x) = 1 x} for any fixed x it is immediate to construct a TM that computes h ; similarly for h x Therefore h is certainly computable there exists a TM that computes it Can we compute h? (more precisely stated: Do we know which of the functions in the above set is h?) No (at the moment): among the infinite TM s that compute the functions of the above set we do not know which is the right one!

57 Computability 57 Decision problem A decision problem is a question that has two possible answers: yes or no. The question is about some input. Examples: Given a graph G and a set of vertices K, is K a clique? Given a graph G and a set of edges M, is M a spanning tree? Given a set of axioms, a set of rules, and a formula, is the formula provable under the axioms and rules?

58 Semidecidability A problem is semidecidable if there is an algorithm that says yes if the answer is yes however it may loop forever if the answer is no. Let us consider again the example of the halting problem in a TM It is undecidable, but it is semidecidable: if the TM stops, sooner or later we will find out How can we obtain a semidecidability result? Computability 58

59 Computability 59 Example: does a TM halt for some value? The problem of determining if z f x (z) is semidecidable Sketch of the proof If we compute f x (0) and find f x (0) then the answer is yes; What if the computation of f x (0) does not terminate and f x (1) : how can we find out?

60 Sketch of proof Then we use the following trick (once more a diagonal technique): We simulate 1 execution step of f x (0): if we stop, then the answer is yes; Otherwise we can simulate one computation step of f x (1); Again, if it does not stop, we can simulate 2 steps of f x (0); next, 1 step of f x (2); 2 steps of f x (1); 3 of f x (0); and so on, according to the scheme in the figure: input argument z n. of steps Computability 60

61 Computability 61 Conclusion There is a large number of undecidable problems that are semidecidable Typical example: runtime errors in programs Observe that the semidecidable problem is: The presence of the error (if there is an error I can find it) Not its absence! Important implications on verification by testing Famous statement by Dijkstra: testing can prove the presence of errors, not their absence

62 Recursive sets Let us focus on the problems stated in such a way that the answer is binary: Problem = does x belong to set S? (where S N) All binary problems can be (re)phrased in such a way Characteristic function of a set S: c S (x) = if x S then 1 else 0 A set S is recursive (or decidable) if and only if its characteristic function is computable c S is total by definition Computability 62

63 Computability 63 Recursively enumerable S is recursively enumerable (RE) (or semidecidable) if and only if: S is the empty set, or S is the image of a total, computable function g s S=I g S={x x=g S (y), y N} S={g S (0), g S (1), g S (2), } The term recursively enumerable comes from this enumeration and the term semidecidable can be explained intuitively: if x S then, by enumerating the elements of S, sooner or later one finds x and is able to get a correct (yes) answer to the question; but what if x S?

64 Theorem (½ + ½ = 1) (A) If S is recursive, then it is also RE (i.e., decidable is more demanding than semidecidable) (B) S is recursive if and only if both S itself and its complement S^ = N - S are RE Two semidecidabilities make a decidability Here, answering NO to a problem is exactly as difficult as answering YES to its complement Corollary: the class of decidable sets (languages, problems, ) is closed under complement Computability 64

65 Proof (A) Claim: Recursive -> RE If S is empty, it is RE by definition If S, let c s be its characteristic function since S, k S, therefore k c s (k) = 1 Let us define the generating function g s as follows: g s (x) = if c s (x) = 1 then x else k g s is total and computable, and I gs = S S is RE This is a non-constructive proof: We don t know whether S We don t require an algorithm to find a specific k We just know that g s exists if S : this is enough for us! Computability 65

66 Computability 66 Proof (B) (B) is equivalent to: (B.1) S recursive both S and S^ RE and (B.2) both S and S^ RE S recursive (B.1.1) S recursive S RE (part A) (B.1.2) S recursive c S (x) (= 1 if x S, c S (x) = 0 if x S) computable c S^(x) (= 0 if x S, c S (x) = 1 if x S) computable S^ recursive S^ RE (B.2) S RE construct the enumeration S={g S (0), g S (1), g S (2), } S^ RE construct S^={g S^(0), g S^(1), g S^(2), } but S S^ = N, S S^ = hence x N, y x=g S^(y) x=g S (y) ( z x=g S^(z) x=g S (z)) x belongs to one and only one of the two enumerations If one constructs the enumeration {g S (0),g S^(0), g S (1), g S^(1), g S (2), g S^(2), } one can certainly find in it any x: if x is at an odd position, then x S, if it is at an even position then x S^. Hence c S can be computed

67 Computability 67 A statement with practical impact Consider the set S with the following features: i S f i total (i.e., S contains only indexes of total computable functions) f total and computable i S f i = f (i.e., S contains all of them) S is the set of indexes of total computable functions then S is not RE Provable by diagonalization This means that there does not exist a RE formalism (Automata, grammars, recursive functions, ) that can define all computable total functions, and only them: FSAs define total computable functions, but not all of them; TMs define all computable functions, but including also the non-total ones Similarly, the C programming language allows one to code any algorithm, but also the nonterminating ones There is no subset of C that defines exactly all the terminating programs! The set of C programs in which for loops comply with given constraints that guarantee termination includes terminating programs only, but necessarily not all terminating programs

68 Computability 68 Getting rid of partial functions Let us extend a function, for instance by extending N with a new value { }, or simply by assigning f a conventional value when f is undefined The trick does not work, because of the following result: There is no total computable function that is an extension of the following function (computable but not total) g(x) = if f x (x) then f x (x) + 1, otherwise One can take any partial function and make it total, but in doing that one may lose computability Again, provable by diagonalization

69 Computability 69 Another useful result Theorem S is RE S = D h, with h computable and partial: S = {x h(x) } and S is RE S = I g, with g computable and partial: S = {x x = g(y), y N} We can now show that there exist semidecidable sets that are not decidable K = {x f x (x) } is semidecidable because K = D h with h(x) = f x (x). We know however that the characteristic function of K, c K (x) = if f x (x) then 1 else 0 is not computable K is not decidable

70 Computability 70 Conclusion P(N) Recursive sets RE sets Note that inclusions are all strict RE sets (i.e., languages recognized by TMs) are not closed w.r.t. complement

71 Closure properties Language family Formalism Union Intersection Complement c Set difference * Kleene star. Concatenation Regular FSA, NDFSA reg. exp. reg. gram. Deterministic context-free DPDA X X X X X Contextfree NDPDA Contextfree gram. X X X Recursively enumerable TM, NDTM General gram. X X Contextsensitive Contextsensitive gram. Recursive (Decider)

72 Computability 72 Kleene s fixed-point theorem Let t be a total and computable function. Then it is always possible to find an integer p such that f p =f t(p) Function f p is called a fixed point of t

73 Rice s theorem Let F be a set of computable functions The set S of (the indices of) TMs that compute the functions of F S = { x f x F } is decidable if and only if either F = or F is the set of all computable functions in all nontrivial cases S is not decidable! Computability 73

74 Computability 74 Proof (1) By contradiction, suppose that S is recursive, F and F is not the set of all computable functions Let us consider the characteristic function c S of S c S (x) =if f x F then 1 else 0 By hypothesis, c S is computable, so by enumerating each TM M i, we can find (1) the first i S such that f i F and (2) the first j S such that f j F

75 Computability 75 Proof (2) Since c S is computable, then so is c S : c S (x)= if f x F then i else j (3) By Kleene s theorem, there exists an x such that f c S (x )=f x (4) There are two cases Suppose c S (x )=i then by (3) f x F, but by (4) f x = f i and by (1) f i F: contradiction. Suppose instead c S (x )=j, then by (3) f x F, but by (4) f x =f j and by (2) f j F: contradiction

76 From Rice s theorem Rice s theorem has strong negative implications: There is an endless list of interesting problems whose undecidability follows trivially from Rice s theorem For any chosen set F={g}, by Rice s theorem it is not decidable whether a generic given TM computes g or not Computability 76

77 Practically Program correctness: does P solve a given specified problem? (does M x compute the function that constitutes the set {f}?) Program equivalence (does M x compute the function that constitutes the set {f y }?) Does a program have any property concerning the function it computes (function with even values, function with a limited image, )? Computability 77

78 Computability 78 Problem reduction (1) A problem P is said to be reduced to a problem P if an algorithm for solving P is used to solve P, i.e.: P is solvable There is an algorithm that, for any given instance of P : 1. determines a corresponding instance of P 2. algorithmically builds the solution to the instance of P from the solution to the instance of P Example: Suppose the problem of searching an element in a set can be solved Then I can solve the problem of computing the intersection of two sets

79 Computability 79 Problem reduction (2) Formally: We want to check whether x S We are able to check whether y S If there is a computable, total function t such that x S t(x) S then we can answer the question x S? algorithmically

80 Computability 80 Reduction - the other way around The procedure can also work in the opposite way: We want to know whether we can solve x S We know that we cannot solve y S (S is not decidable) If we find a computable, total function t such that y S t(y) S then we can conclude that x S is not decidable

81 Computability 81 Another example of reduction We already used implicitly this way of reasoning several times: From the undecidability of the halting problem for TMs we derived in general the undecidability of the problem of termination of any computer computation: Consider a TM M y, an integer x, a C program P, an input file f We can build a C program P that simulates M y and we store x in an input file f P terminates its computation on f if and only if g(y,x) If we could decide if P terminates its computation on f then we could also solve the halting problem for the TM

82 Computability 82 A rather general mechanism (1) Is the problem does a generic program P access an uninitialized variable? decidable? Let us assume (by contradiction) that it is decidable Then we can consider the halting problem and reduce it to the following new problem: Given a generic program P^ that takes as input some generic data D, we can build a program P as follows: begin var x, y: P^; y := x end making sure that identifiers x and y are not used in P^ It is clear that the assignment statement y := x results in accessing an uninitialized variable, because x does not occur in P^ Hence the uninitialized variable x is accessed in P if and only if P^ terminates. If we could solve the problem of uninitialized variable access then we could also solve the termination problem, which we cannot

83 Computability 83 A rather general mechanism (2) The same technique can be applied to prove the undecidability of many other typical properties of program execution: Array indices out of bounds Division by 0 Dynamic type compatibility Typical runtime errors

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

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

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

Turing Machines, diagonalization, the halting problem, reducibility

Turing Machines, diagonalization, the halting problem, reducibility Notes on Computer Theory Last updated: September, 015 Turing Machines, diagonalization, the halting problem, reducibility 1 Turing Machines A Turing machine is a state machine, similar to the ones we have

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

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

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k. Complexity Theory Problems are divided into complexity classes. Informally: So far in this course, almost all algorithms had polynomial running time, i.e., on inputs of size n, worst-case running time

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

Models. Models of Computation, Turing Machines, and the Limits of Turing Computation. Effective Calculability. Motivation for Models of Computation

Models. Models of Computation, Turing Machines, and the Limits of Turing Computation. Effective Calculability. Motivation for Models of Computation Turing Computation /0/ Models of Computation, Turing Machines, and the Limits of Turing Computation Bruce MacLennan Models A model is a tool intended to address a class of questions about some domain of

More information

CS20a: Turing Machines (Oct 29, 2002)

CS20a: Turing Machines (Oct 29, 2002) CS20a: Turing Machines (Oct 29, 2002) So far: DFA = regular languages PDA = context-free languages Today: Computability 1 Church s thesis The computable functions are the same as the partial recursive

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

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

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

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

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

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

1 Definition of a Turing machine

1 Definition of a Turing machine Introduction to Algorithms Notes on Turing Machines CS 4820, Spring 2017 April 10 24, 2017 1 Definition of a Turing machine Turing machines are an abstract model of computation. They provide a precise,

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

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

Decidable Languages - relationship with other classes.

Decidable Languages - relationship with other classes. CSE2001, Fall 2006 1 Last time we saw some examples of decidable languages (or, solvable problems). Today we will start by looking at the relationship between the decidable languages, and the regular and

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

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

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

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch] Undecidability Andreas Klappenecker [based on slides by Prof. Welch] 1 Sources Theory of Computing, A Gentle Introduction, by E. Kinber and C. Smith, Prentice-Hall, 2001 Automata Theory, Languages and

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

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

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

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus

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

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

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

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

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

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

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY RYAN DOUGHERTY If we want to talk about a program running on a real computer, consider the following: when a program reads an instruction,

More information

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever.   ETH Zürich (D-ITET) October, Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu ETH Zürich (D-ITET) October, 19 2017 Part 5 out of 5 Last week was all about Context-Free Languages Context-Free

More information

Turing Machines Part III

Turing Machines Part III Turing Machines Part III Announcements Problem Set 6 due now. Problem Set 7 out, due Monday, March 4. Play around with Turing machines, their powers, and their limits. Some problems require Wednesday's

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

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

Turing Machines. Lecture 8

Turing Machines. Lecture 8 Turing Machines Lecture 8 1 Course Trajectory We will see algorithms, what can be done. But what cannot be done? 2 Computation Problem: To compute a function F that maps each input (a string) to an output

More information

Context-free grammars and languages

Context-free grammars and languages Context-free grammars and languages The next class of languages we will study in the course is the class of context-free languages. They are defined by the notion of a context-free grammar, or a CFG for

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

1 Acceptance, Rejection, and I/O for Turing Machines

1 Acceptance, Rejection, and I/O for Turing Machines 1 Acceptance, Rejection, and I/O for Turing Machines Definition 1.1 (Initial Configuration) If M = (K,Σ,δ,s,H) is a Turing machine and w (Σ {, }) then the initial configuration of M on input w is (s, w).

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

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

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

Gödel s Incompleteness Theorem. Overview. Computability and Logic

Gödel s Incompleteness Theorem. Overview. Computability and Logic Gödel s Incompleteness Theorem Overview Computability and Logic Recap Remember what we set out to do in this course: Trying to find a systematic method (algorithm, procedure) which we can use to decide,

More information

Turing Machine Recap

Turing Machine Recap Turing Machine Recap DFA with (infinite) tape. One move: read, write, move, change state. High-level Points Church-Turing thesis: TMs are the most general computing devices. So far no counter example Every

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

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

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

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

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

Final Exam Comments. UVa - cs302: Theory of Computation Spring < Total

Final Exam Comments. UVa - cs302: Theory of Computation Spring < Total UVa - cs302: Theory of Computation Spring 2008 Final Exam Comments < 50 50 59 60 69 70 79 80 89 90 94 95-102 Total 2 6 8 22 16 16 12 Problem 1: Short Answers. (20) For each question, provide a correct,

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

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

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine There is no known model of computation more powerful than Turing Machines Definition of Algorithm:

More information

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

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 8 Nancy Lynch Today More undecidable problems: About Turing machines: Emptiness, etc. About

More information

Artificial Intelligence. 3 Problem Complexity. Prof. Dr. Jana Koehler Fall 2016 HSLU - JK

Artificial Intelligence. 3 Problem Complexity. Prof. Dr. Jana Koehler Fall 2016 HSLU - JK Artificial Intelligence 3 Problem Complexity Prof. Dr. Jana Koehler Fall 2016 Agenda Computability and Turing Machines Tractable and Intractable Problems P vs. NP Decision Problems Optimization problems

More information

Most General computer?

Most General computer? Turing Machines Most General computer? DFAs are simple model of computation. Accept only the regular languages. Is there a kind of computer that can accept any language, or compute any function? Recall

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

Turing Machines Decidability

Turing Machines Decidability Turing Machines Decidability Master Informatique 2016 Some General Knowledge Alan Mathison Turing UK, 1912 1954 Mathematician, computer scientist, cryptanalyst Most famous works: Computation model («Turing

More information

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

Turing Machines (TM) The Turing machine is the ultimate model of computation. TURING MACHINES Turing Machines (TM) The Turing machine is the ultimate model of computation. Alan Turing (92 954), British mathematician/engineer and one of the most influential scientists of the last

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 14: Applications of PCP Goal of this Lecture Our goal is to present some typical undecidability

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with

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

König s Lemma and Kleene Tree

König s Lemma and Kleene Tree König s Lemma and Kleene Tree Andrej Bauer May 3, 2006 Abstract I present a basic result about Cantor space in the context of computability theory: the computable Cantor space is computably non-compact.

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

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

Introduction to Languages and Computation

Introduction to Languages and Computation Introduction to Languages and Computation George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 400 George Voutsadakis (LSSU) Languages and Computation July 2014

More information

Peano Arithmetic. CSC 438F/2404F Notes (S. Cook) Fall, Goals Now

Peano Arithmetic. CSC 438F/2404F Notes (S. Cook) Fall, Goals Now CSC 438F/2404F Notes (S. Cook) Fall, 2008 Peano Arithmetic Goals Now 1) We will introduce a standard set of axioms for the language L A. The theory generated by these axioms is denoted PA and called Peano

More information

15-251: Great Theoretical Ideas in Computer Science Fall 2016 Lecture 6 September 15, Turing & the Uncomputable

15-251: Great Theoretical Ideas in Computer Science Fall 2016 Lecture 6 September 15, Turing & the Uncomputable 15-251: Great Theoretical Ideas in Computer Science Fall 2016 Lecture 6 September 15, 2016 Turing & the Uncomputable Comparing the cardinality of sets A B if there is an injection (one-to-one map) from

More information

DR.RUPNATHJI( DR.RUPAK NATH )

DR.RUPNATHJI( DR.RUPAK NATH ) Contents 1 Sets 1 2 The Real Numbers 9 3 Sequences 29 4 Series 59 5 Functions 81 6 Power Series 105 7 The elementary functions 111 Chapter 1 Sets It is very convenient to introduce some notation and terminology

More information

Theory of computation: initial remarks (Chapter 11)

Theory of computation: initial remarks (Chapter 11) Theory of computation: initial remarks (Chapter 11) For many purposes, computation is elegantly modeled with simple mathematical objects: Turing machines, finite automata, pushdown automata, and such.

More information

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer Science University of Virginia www.cs.virginia.edu/~njb2b/theory

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

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

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr. Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr. Chapter : Logic Topics:. Statements, Negation, and Compound Statements.2 Truth Tables and Logical Equivalences.3

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

CS 361 Meeting 26 11/10/17

CS 361 Meeting 26 11/10/17 CS 361 Meeting 26 11/10/17 1. Homework 8 due Announcements A Recognizable, but Undecidable Language 1. Last class, I presented a brief, somewhat inscrutable proof that the language A BT M = { M w M is

More information

Turing Machines. Wolfgang Schreiner

Turing Machines. Wolfgang Schreiner Turing Machines 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

CS 121, Section 2. Week of September 16, 2013

CS 121, Section 2. Week of September 16, 2013 CS 121, Section 2 Week of September 16, 2013 1 Concept Review 1.1 Overview In the past weeks, we have examined the finite automaton, a simple computational model with limited memory. We proved that DFAs,

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

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

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

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

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

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

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 1: Introducing Formal Languages Motivation I This course is about the study of a fascinating

More information

Theory of computation: initial remarks (Chapter 11)

Theory of computation: initial remarks (Chapter 11) Theory of computation: initial remarks (Chapter 11) For many purposes, computation is elegantly modeled with simple mathematical objects: Turing machines, finite automata, pushdown automata, and such.

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

Lecture Notes: The Halting Problem; Reductions

Lecture Notes: The Halting Problem; Reductions Lecture Notes: The Halting Problem; Reductions COMS W3261 Columbia University 20 Mar 2012 1 Review Key point. Turing machines can be encoded as strings, and other Turing machines can read those strings

More information

CISC 876: Kolmogorov Complexity

CISC 876: Kolmogorov Complexity March 27, 2007 Outline 1 Introduction 2 Definition Incompressibility and Randomness 3 Prefix Complexity Resource-Bounded K-Complexity 4 Incompressibility Method Gödel s Incompleteness Theorem 5 Outline

More information

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

CSE 4111/5111/6111 Computability Jeff Edmonds Assignment 3: Diagonalization & Halting Problem Due: One week after shown in slides CSE 4111/5111/6111 Computability Jeff Edmonds Assignment 3: Diagonalization & Halting Problem Due: One week after shown in slides First Person: Second Person: Family Name: Family Name: Given Name: Given

More information

Computability Theory

Computability Theory Computability Theory Cristian S. Calude May 2012 Computability Theory 1 / 1 Bibliography M. Sipser. Introduction to the Theory of Computation, PWS 1997. (textbook) Computability Theory 2 / 1 Supplementary

More information

ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS

ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS 1. Cardinal number of a set The cardinal number (or simply cardinal) of a set is a generalization of the concept of the number of elements

More information

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 27 CS 70 Discrete Mathematics for CS Spring 007 Luca Trevisan Lecture 7 Infinity and Countability Consider a function f that maps elements of a set A (called the domain of f ) to elements of set B (called

More information

Computation Histories

Computation Histories 208 Computation Histories The computation history for a Turing machine on an input is simply the sequence of configurations that the machine goes through as it processes the input. An accepting computation

More information

The purpose here is to classify computational problems according to their complexity. For that purpose we need first to agree on a computational

The purpose here is to classify computational problems according to their complexity. For that purpose we need first to agree on a computational 1 The purpose here is to classify computational problems according to their complexity. For that purpose we need first to agree on a computational model. We'll remind you what a Turing machine is --- you

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

Computational Theory

Computational Theory Computational Theory Finite Automata and Regular Languages Curtis Larsen Dixie State University Computing and Design Fall 2018 Adapted from notes by Russ Ross Adapted from notes by Harry Lewis Curtis Larsen

More information