Nachklausur zur Vorlesung Vertiefung Theoretische Informatik Wintersemester

Size: px
Start display at page:

Download "Nachklausur zur Vorlesung Vertiefung Theoretische Informatik Wintersemester"

Transcription

1 Prof. Dr. Viorica Sofronie-Stokkermans Dipl.-Inform. Markus Bender AG Formale Methoden und Theoretische Informatik Fachbereich Informatik Universität Koblenz-Landau Hinweise Nachklausur zur Vorlesung Vertiefung Theoretische Informatik Wintersemester Name: Vorname: Matrikelnummer: Studiengang: Legen Sie Ihren Studentenausweis und ein Ausweisdokument mit Lichtbild (Personalausweis, Pass, Führerschein) auf den Tisch. Schalten Sie Ihr Handy aus. Prüfen Sie Ihr Exemplar der Klausur auf Vollständigkeit (9 Aufgaben). Schreiben Sie mit einem dokumentenechten, schwarzen oder blauen Stift. Es sind keine Hilfsmittel erlaubt. Weitere leere Blätter sind bei der Aufsicht erhältlich. Diese sind mit Namen und Matrikelnummer zu beschriften und müssen abgegeben werden. Heften Sie bei der Abgabe sämtliche Blätter zusammen. Blätter, die versehentlich nicht abgegeben wurden, können nicht nachträglich abgegeben werden. MUSTERLÖSUNG Viel Erfolg! Diese Musterlösung erhebt nicht den Anspruch absoluter Korrektheit. Aufgabe Σ Punkte erreicht von möglichen Note: Unterschrift:

2 Exercise 1 (7P + 6P + 5P + 20P + 3P = 41 Punkte) Remark: In Exercises wrong crosses lead to loss of points. The minimum number of points for each of the exercises is 0 (one cannot carry negative points into the next exercise). /7 P 1.1 Register Machines, Recursive Functions Please indicate (by crossing the right box) whether the following statements are true or false. In the WHILE program while x 1 0 do P end the number of times P is executed is not influenced by the fact that P changes x 1. The loop instruction can be simulated with a WHILE program. For every WHILE program there exists an equivalent WHILE-IF program with one while instruction only. There exist primitive recursive functions which are not µ-recursive. Every LOOP computable function is µ-recursive. For every µ-recursive function there exists a Turing machine which computes it. Every primitive recursive function is LOOP computable. 1.2 Complexity Theory Please indicate (by crossing the right box) whether the following statements are true, false, or open (not known in the scientific community). true false true false open If f is a computable function then DSPACE(f(n)) NSPACE(f(n)). Every NP-hard problem is in NP. NP = co-np. P = NP. Let L 1, L 2 be languages with L 1 pol L 2 and L 2 P. Then L 1 P. /6 P /5 P QBF (the problem of checking whether a quantified Boolean formula is true) is PSPACE-complete. 1.3 Decidability Please indicate (by crossing the right box) whether the following statements are true or false. The set {n M n halts on input n} (where M n is the Turing machine with Gödel number n) is undecidable. The Post correspondence problem over an alphabet Σ ( Σ 2) is undecidable The set of all valid formulae in propositional logic is decidable. The set of all valid formulae in first-order logic is decidable. It is decidable whether two context-free languages are equal. true false 1

3 1.4 Register Machines, Recursive Functions, Complexity Please indicate (by crossing the right box) whether the following statements are true or false and give a brief justification of your answer (this can for instance be an example or a counterexample). For each correct cross you get 1 point; for the correct justification you get 1 additional point. Every µ-recursive function is primitive recursive. f(n) = µi(n + i = 0) is µ recursive but not defined everywhere, hence not primitive recursive true false There exist total functions which are not LOOP computable. The Ackerman function is a total function but is not primitive recursive and therefore is not LOOP computable. Every WHILE computable function is total. { undefined if l = m or l = n f(l, m, n) = m l + n l otherwise is clearly WHILE computable, but not total. Every total function is WHILE computable. { 1 if the Turing machine M n halts on input n h(n) = 0 otherwise is clearly total, but not computable and thus not WHILE computable. For every primitive recursive function g : N 2 N, the function f : N N defined by f(n) = µi(g(n, i) = 0) is primitive recursive. For g(n, i) = 1, f(n) is always undefined and can thus not be primitive recursive as primitive recursive functions are total. { 0 if n 3 = m The function f : N N N defined by: f(n, m) = 1 otherwise is primitive recursive. Case distinction is primitive recursive if all involved functions are primitive recursive. This is the case for f. g 1 (n, m) = 0 if h 1 (n, m) = (n 3 (m 2 + 1)) + f(n, m) = ((m 2 + 1) n 3 ) = 0 g 2 (n, m) = 1 if h 2 (n, m) = 1 h 1 (n, m) = 0 2

4 true false Let g 1, g 2 : N N N be a primitive { recursive function. Then the function ( i<m g1 (i, n) + g 2 (n, i) ) if m > 0 f : N N N defined by: f(n, m) = 0 if m = 0 is primitive recursive. If { g : N N N is primitive recursive then the function f(n, m) = i<m g(n, i) if m > 0 is primitive recursive. 0 if m = 0 In this case g(n, i) = g 1 (i, n) + g 2 (n, i)) is p.r. as g 1, g 2 are p.r.; the set of p.r. functions is closed under omitting and repeating arguments and under composition; and + is p.r. Let f : N N be defined by f(n) = n 5. Then every language in DTIME(f(n)) is decidable. A computable function f(n) that restricts the computation time can be used to force the termination of a TM. So we can use a TM to run the TM for the problem and keep track of the time. If the calculated limit is crossed, the overseeing TM terminates with output no as it knows that the simulated TM is in a loop. If there exists an NP-hard problem which is in P then P = NP. If an NP-hard problem is in P then all the problems in NP can be reduced to this NP-hard problem in polynomial time, and thus they all can be solved in polynomial time. Therefore all the problems in NP are in P. /20 P Let L be a language. If we give a polynomial-time reduction from 3-SAT to L we may conclude that L is NP-complete. From the fact that 3-SAT is reducible to L in polynomial time, we know that L is NP-hard. To be NP-complete, L has to be in NP. This can not be deduced from the given information. Example: There is a PTIME reduction from 3-SAT to FO-SAT, the language of satisfiable formulae in first-order logic. The latter language is undecidable and thus not NP-complete. 1.5 Indicate the relationships between the classes LOOP, WHILE part, GOTO part, TM part, P and F part µ. P = LOOP F part µ = WHILE part = GOTO part = TM part /3 P /41 P 3

5 LOOP/WHILE/GOTO code In the context of this exam, register machine instructions and register machine programs for the languages LOOP, WHILE and GOTO are defined as follows: LOOP prog ::= LOOP instr ; LOOP prog LOOP instr LOOP instr ::= ass loop reg do LOOP prog end if cond then LOOP prog else LOOP prog end if cond then LOOP prog end WHILE prog ::= WHILE instr ; WHILE prog WHILE instr WHILE instr ::= ass while reg = 0 do WHILE prog end if cond then WHILE prog else WHILE prog end if cond then WHILE prog end GOTO prog ::= nat num : GOTO instr ; GOTO prog nat num : GOTO instr GOTO instr ::= ass goto nat num if reg = 0 goto nat num ass ::= reg := nat num reg := reg reg := nat num op reg reg := reg op nat num reg := reg op reg reg ::= x 1 x 2 x 3... nat num ::= cond ::= reg rel reg reg rel nat num op ::= + rel ::= = You are allowed to define and use auxiliary LOOP/WHILE/GOTO programs. You are not allowed to use any other LOOP/WHILE/GOTO instruction or LOOP/WHILE/GOTO programs. Summary In LOOP programs you can use the following instructions: x i := c P 1 ; P 2 if x i = c then P 1 end if x i = c then P 1 else P 2 end x i := x j loop x i do P 1 end if x i c then P 1 end if x i c then P 1 else P 2 end x i := c op x j if x i = x j then P 1 end if x i = x j then P 1 else P 2 end x i := x j op c if x i x j then P 1 end if x i x j then P 1 else P 2 end x i := x j op x k (where x i, x j are registers, c N, op {+,, }, and P 1, P 2 are LOOP programs) In WHILE and WHILE-IF programs you can use the following instructions: x i := c P 1 ; P 2 if x i = c then P 1 end if x i = c then P 1 else P 2 end x i := x j while x i 0 do P 1 end if x i c then P 1 end if x i c then P 1 else P 2 end x i := c op x j if x i = x j then P 1 end if x i = x j then P 1 else P 2 end x i := x j op c if x i x j then P 1 end if x i x j then P 1 else P 2 end x i := x j op x k (where x i, x j are registers, c N, op {+,, }, and P 1, P 2 are WHILE programs) In GOTO programs you can use the following instructions: x i := c x i := c op x j goto l x i := x j x i := x j op c if x i = 0 goto l x i := x j op x k (where x i, x j are registers, c N, op {+,, }, and l is a label) A GOTO program has the form l 1 : B 1,..., l k : B k (k 1) where B 1,..., B k are GOTO instructions and l 1,..., l k are labels. 4

6 Exercise 2 (3P + 3P + 2P = 8 Punkte) Let f : N N N be defined as follows: { 0 if m = 0 or n = 0 f(m, n) = (m + 4) n+1 4 n otherwise a) Write a WHILE program which computes f. If it is not possible to write a WHILE program for f say so and justify why it is not possible. x 3 := x 1 x 2 ; if x 3 = 0 then x 3 := 0 else x 3 := x 1 + 4; x 4 := x 2 ; x 5 := x 3 ; x 6 := 1; while x 4 0 do x 5 := x 5 x 3 ; x 6 := x 6 4; x 4 := x 4 1 end; x 3 := x 5 x 6 ; x 5 := 0; x 6 := 0 end /3 P 5

7 b) Write a GOTO program which computes f. If it is not possible to write a GOTO program for f say so and justify why it is not possible. 1 : x 3 := x 1 x 2 ; 2 : if x 3 = 0 goto 14; 3 : x 3 := x 1 + 4; 4 : x 4 := x 2 ; 5 : x 5 := x 3 ; 6 : x 6 := 1; 7 : if x 4 = 0 goto 12; 8 : x 5 := x 5 x 3 ; 9 : x 6 := x 6 4; 10 : x 4 := x 4 1; 11 : goto 7; 12 : x 3 := x 5 x 6 ; 13 : x 5 := 0; 14 : x 6 := 0 /3 P 6

8 c) Write a LOOP program which computes f. If it is not possible to write a LOOP program for f say so and justify why it is not possible. x 3 := x 1 x 2 ; if x 3 = 0 then x 3 := 0 else x 3 := x 1 + 4; x 5 := x 3 ; x 6 := 1; loop x 2 do x 5 := x 5 x 3 ; x 6 := x 6 4 end; x 3 := x 5 x 6 ; x 5 := 0; x 6 := 0 end /8 P 7

9 8

10 Exercise 3 (3P + 4P + 3P = 10 Punkte) Let P be the following WHILE program: x 5 := x 1 x 2 ; x 5 := x 5 + x 3 ; x 5 := 1 x 5 ; while x 5 0 do end; x 5 := x x 4 := x 1 + x 2 ; x 6 := x 3 ; while x 6 0 do end x 7 := x 4 ; x 5 := x 1 + x 2 ; x 4 := 0; while x 5 0 do end; x 4 := x 4 + x 7 ; x 5 := x 5 1 x 6 := x 3 1; x 7 := 0 a) Enter the value that is calculated by P for the given inputs into the table I) II) III) x x x Output 4 undef. 4 /3 P /4 P b) Determine the function f : N N N N computed by P. undefined if n 3 = 0 and (n 2 = 0 or n 3 = 0) (n 1 + n 2 ) if n 3 = 0 and n 2 > 0 and n 1 > 0 f(n 1, n 2, n 3 ) = (n 1 + n 2 ) 2 if n 3 = 1 undefined if n 3 > 1 9

11 c) Use the transformation presented in the lecture to construct a GOTO program which has the same semantics as P. 1 : x 5 := x 1 x 2 ; 2 : x 5 := x 5 + x 3 ; 3 : x 5 := 1 x 5 ; 4 : if x 5 = 0 goto 7; 5 : x 5 := x 5 + 1; 6 : goto 4; 7 : x 4 := x 1 + x 2 ; 8 : x 6 := x 3 ; 9 : if x 6 = 0 goto 20; 10 : x 7 := x 4 ; 11 : x 5 := x 1 + x 2 ; 12 : x 4 := 0; 13 : if x 5 = 0 goto 17; 14 : x 4 := x 4 + x 7 ; 15 : x 5 := x 5 1; 16 : goto 13; 17 : x 6 := x 3 1; 18 : x 7 := 0; 19 : goto 9; 20 : x 7 := 0 /3 P /10 P 10

12 Recursive functions We use the following notation: is function composition. if j k, π k j is the projection function defined by π k j (n 1,..., n k ) = n j. (+1) : N N is defined by: (+1)(n) = n + 1. { 0 if n = 0 ( 1) : N N is defined by: ( 1)(n) = n 1 otherwise : N N N is defined for all n 1, n 2 N by: (n 1, n 2) = n 1 n 2. + : N N N is defined for all n 1, n 2 N by: +(n 1, n 2) = n 1 + n 2. : N N N is defined for all n 1, n 2 N by: (n 1, n 2) = n 1 n 2 = for all s, k N, c k s : N k N is defined for all n N k by: c k s(n) = s. { 0 if n 1 n 2 n 1 n 2 otherwise In what follows we will assume known that all the functions above are primitive recursive. We also assume known that definitions by case distinction and definitions using the bounded µ operator (as defined in the lecture, in which only primitive functions are used) define primitive recursive functions. Exercise 4 (2P + 2P + 2P = 6 Punkte) Determine the arity of the following recursive functions by drawing a circle around the corresponding number. Give a brief justification for your answer. I) f 1 = PR[c 1 3, (π3 2, (π3 1, π3 3 ))] arity of f 1 : From fact that the constant function c 1 3 appears in g and that the projections π3 x appear in h, g has arity one and h has arity three. This implies that f 1 has arity two. 11

13 II) f 2 (n) = µ i<42 i (g 2 (n, i) = 0) with g 2 = (+ (c 3 42, π3 3 )) (c1 3, (π1 1, π1 1 ), c1 3 ) arity of g 2 : arity of f 2 : The functions c 1 3, (π1 1, π1 1 ) and c1 3 are evaluated first, and the usage of c1 3 and π1 1 indicates that these functions expect one argument. Thus the arity of g 2 is one. As g 2 has the additional argument i in comparison to f 2, the arity of f 2 is zero. III) f 3 = µg 3 with g 3 = (π 3 1, (π3 2, π3 3 )) arity of g 3 : arity of f 3 : From fact that the projections π 3 x in g 3 have arity three, it follows, that g 3 has arity three. As g 3 has the additional argument i in comparison to f 3, the arity of f 3 is two. /6 P 12

14 Exercise 5 (3P + 2P + 3P = 8 Punkte) Define which function is computed by the following recursive functions. Give a brief justification for your answer. I) f 1 = PR[ (π 1 1, π1 1 ), + ( (π3 1, c3 5 ), π3 3 )] f 1 (n, m) = n 5 m + (n n) Definition by primitive recursion: f 1 (n, 0) = g(n) = n n f 1 (n, m + 1) = h(n, m, f(n, m)) = (n 5) + f(n, m) f 1 (n, m) = n 5 m + n 2 /3 P II) f 2 : N N N defined by f 2 (n, m) = µ i<m i ((n + n) i = 0) f 2 (n, m) = { 2n if 2n < m 0 otherwise The bounded µ operator { is defined as follows: i 0 if g(n, i 0 ) = 0 and for all j < i 0 g(n, j) 0 µ i<m i(g(n, i) = 0) := 0 if g(n, j) 0 for all 0 < j < m or m = 0 This definition implies, that f 2 (n, m) is 2n if 2n < m. For 2n m we have to check under which circumstances (n + n) i = 0 holds. As i has to be strictly smaller than m by the definition of the bounded µ operator and as 2n m, there is no i such that (n + n) i = 0 holds. Thus f 2 (n, m) = 0 for 2n m. 13

15 III) f 3 : N N defined by f 3 (n) = µ i ( g(n, i) = 0 ) n 1 if i = 0 where g(n, i) = µj((n + i) (j + 1) = 0) if i = 1 n i if i 2 f 3 (n) = { 0 if n = 0 or n = 1 n if n 2 The µ operator is defined as follows: i 0 if g(n, i 0 ) = 0 and for all µi(g(n, i) = 0) := j < i 0 g(n, j) is defined and not 0 undefined otherwise The following cases need to be considered: (1) n = 0: Then g(0, 0) = 0, so f 3 (0) = 0. (2) n = 1: Then g(1, 0) = 0, so f 3 (1) = 0. (3) n 2: (a) i = 0: g(n, 0) = n 1 0 (but at least g(n, 0) is defined). (b) i = 1: Examine µj((n + i) (j + 1) = 0), i.e. check under which circumstances (n + i) (j + 1) becomes 0. As i = 1, (n + i) (j + 1) becomes 0, when j = n. As n > 0 it follows that µj((n + i) (j + 1) > 0 and thus g(n, 1) 0. (c) i 2: As n i = 0 if i = n, g(n, n) = 0. Since g(n, 0), g(n, 1),..., g(n, n 1) are defined but not 0, f 3 (n) = n for n 2. /3 P /8 P 14

16 Exercise 6 (5 Punkte) Let f : N N be defined as follows: 2 if n = 0 7 if n = 1 f(n) = 5 if n = 2 (2 + f(n 3)) (7 + f(n 1)) (5 + f(n 2)) if n 3 Is f primitive recursive? Justify your answer. We can use simultaneous recursion to show that f is primitive recursive: f 1 (0) = 2 f 2 (0) = 7 f 3 (0) = 5 f 1 (n + 1) = f 2 (n) f 2 (n + 1) = f 3 (n) f 3 (n + 1) = (2 + f 1 (n)) (7 + f 3 (n)) (5 + f 2 (n)) f(n) = f 1 (n) The functions used to define f 1, f 2, f 3, namely: g 1 = 2, g 2 = 7, g 3 = 5, h 1 (n, k 1, k 2, k 3 ) = k 2, h 2 (n, k 1, k 2, k 3 ) = k 3, h 3 (n, k 1, k 2, k 3 ) = (2 + k 1 ) (7 + k 3 ) (5 + k 2 ) are primitive recursive We know that functions defined by simultaneous recursion using primitive recursive functions are primitive recursive. Therefore, f 1, f 2, f 3 are primitive recursive, hence f is primitive recursive. /5 P /5 P 15

17 16

18 Exercise 7 (2P + 2P + 2P = 6 Punkte) a) State the theorem of Rice (the formal variant). Let P be a non-trivial property of languages of type 0, i.e. P L 0Σ. Then I(P ) = {n M n accepts a language L P } is undecidable b) In what follows, L(M n ) is the language accepted by the Turing machine M n. For each of the languages L below answer the following questions: (i) Can the theorem of Rice be used to prove that L is undecidable? Justify your answer. If the theorem of Rice can be used to prove undecidability give the proof. (ii) Is the language decidable? If yes, explain why. I) L = {n L(M n ) is in L 0 } (i): L = I(P ), where P = {L L L 0Σ } = L 0Σ. Hence P is trivial, and therefore, the theorem of Rice is not applicable. (ii): In fact, L is decidable as it is easy to construct a Turing machine that decides L as the Turing machine just needs to print yes for every input. 17

19 II) L = {n L(M n ) is infinite or contains an odd number of words}. (i): L = I(P ), where P = {L L 0Σ L is infinite or contains an odd number of words}. Yes, the theorem of Rice can be used, as P is clearly in L 0Σ and it is non-trivial, i.e. that P L 0Σ. Indeed: {a} P, thus P {a, aa} P, thus P L 0Σ (ii): Since L = I(P ) = {n L(M n ) P }, from the theorem of Rice it follows that L is undecidable. /6 P 18

20 Exercise 8 (2P + 1P + 1P + 2P = 6 Punkte) a) State the Post correspondence problem. A correspondence system P is a finite rule set over an alphabet Σ. P = {(p 1, q 1 ),..., (p n, q n )} with p i, q i Σ An index sequence I = i 1... i m of P is a sequence with 1 i k n for all k {1,..., m}. A solution for P is a sequence of indices I = i 1...i m such that p i1... p im = q i1... q im. The Post correspondence problem is the question whether a given correspondence system has a solution. b) Let G = (Σ, R) be a semi-thue system with Σ = {a, b, c} and R = {ac bb, b c, bc abc}. 1) Show that abc G bbc by writing all the steps and underlining the occurrence of the left hand side of the rule in the current word at every step. abc acc bbc /1 P 2) Construct the correspondence system P G,w,w as explained in the lecture, where w = abc and w = bbc. Assume that rule 4 is (X, Xw X) and rule 5 is (w XX, X). P G,w,w = {(ac, bb), (b, c), (bc, abc), (X, XabcX), (bbcxx, X), (a, a), (b, b), (c, c), (X, X)} /1 P 19

21 3) Construct a solution for P G,w,w with start 4 using the derivation abc G bbc. Construct the solution: p 4 = X q 4 = XabcX p = XabcX q = XabcXaccX p = XabcXaccX q = XabcXaccXbbcX p = XabcXaccXbbcXX q = XabcXaccXbbcXX p = q , thus the sequence is a solution. /6 P 20

22 Exercise 9 (2P + 2P + 4P + 2P = 10 Punkte) A company has n employees P = {p 1,..., p n }. It is known which persons work well together. This can be specified using for instance a list L containing sets {p i, p j } describing pairs of employees that work well together. The goal is to build k teams. We are interested in the problem of deciding whether the employees can be organized in at most k teams such that every team consists only of employees which work well together. Consider the following language: TEAM = {(L, P, k) P is a finite set, L is a set consisting of sets {p i, p j } P, k N and the members of P can be organized in at most k teams such that if p i p j, and p i and p j are in the same team then {p i, p j } L (they work well together)} a) One of the two triples (L, P, k) below is an instance of TEAM. Which is this? ({{1, 4}, {2, 4}}, {1, 2, 3, 4}, 3) ({{2, 3}}, {1, 2, 3, 4}, 2) b) Is TEAM in NP? Justify your answer briefly (you do not need to construct a Turing machine). Yes it is. Given (L, P, k). One can guess a partition Q = {q 1,..., q r } of P with r k that contains at most k sets and then check in polynomial time, if those sets contain only employees that work well together. This can be done as follows: Iterate through Q and for every q Q check in L if q consists only of employees which work well together. Let n l = 2 L and n p = P. The size of the input is n l + n p + k. As Q = q 1... q k = P we know that q i k n p thus we know that we have to check less than k ( np(np+1) 2 ) < k n 2 p pairs. For each pair we need to check at most n l elements in L. The complexity is n l n 2 p k < (n l + n p + k) 2. 21

23 c) In the lecture we studied the k-colorability problem: k-colorability = {G G = (V, E) is an undirected graph which is colorable with at most k colors such that if v i, v j V have the same color and v i v j then {v i, v j } E} Let f be the map which associates with every undirected graph G = (V, E) where V = {v 1,..., v m } the tuple (L G, P G, k G ) where: L G = { {v i, v j } v i, v j V, {v i, v j } E}, P G = V, k G = 3 Prove that f defines a polynomial reduction of 3-colorability to TEAM. Proof: G = (V, E) 3-colorability G is colored with at most three colors in such way that if v i, v j V have the same color and v i v j then {v i, v j } E There exists a partition Q = {q 1, q 2, q 3 } of P G = V such that for every q Q, all the elements of q have the same color There exists a partition Q = {q 1, q 2, q 3 } of P G = V such that for every q Q, for all v i, v j q k with v i v j, {v i, v j } E f(g) = ({ {v i, v j } v i, v j V, {v i, v j } E}, V, 3) TEAM In addition, we can easily show that f can be computed in polynomial time as constructing the complement of E and copying of V can clearly be done in polynomial time. /4 P d) We know that the 3-colorability problem is an NP-complete problem. Prove or refute the following: TEAM is an NP-complete problem. Yes TEAM is NP complete. In (2) we have shown that TEAM is in NP. In (3) we have shown that TEAM is NP-hard by giving a polynomial reduction of the NP-hard problem 3-colorability to TEAM. As a problem is NP-complete iff it is NP-hard and in NP, TEAM is NP-complete. /10 P 22

Klausur zur Vorlesung Vertiefung Theoretische Informatik Sommersemester 2016

Klausur zur Vorlesung Vertiefung Theoretische Informatik Sommersemester 2016 Prof. Dr. Viorica Sofronie-Stokkermans Dipl.-Inform. Markus Bender AG Formale Methoden und Theoretische Informatik Fachbereich Informatik Universität Koblenz-Landau Klausur zur Vorlesung Vertiefung Theoretische

More information

Klausur zur Vorlesung Vertiefung Theoretische Informatik Sommersemester

Klausur zur Vorlesung Vertiefung Theoretische Informatik Sommersemester Prof. Dr. Viorica Sofronie-Stokkermans Dipl.-Inform. Markus Bender AG Formale Methoden und Theoretische Informatik Fachbereich Informatik Universität Koblenz-Landau Hinweise Klausur zur Vorlesung Vertiefung

More information

Advanced Topics in Theoretical Computer Science

Advanced Topics in Theoretical Computer Science Advanced Topics in Theoretical Computer Science Part 5: Complexity (Part II) 30.01.2014 Viorica Sofronie-Stokkermans Universität Koblenz-Landau e-mail: sofronie@uni-koblenz.de 1 Contents Recall: Turing

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

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

Theory of Computer Science. Theory of Computer Science. D7.1 Introduction. D7.2 Turing Machines as Words. D7.3 Special Halting Problem

Theory of Computer Science. Theory of Computer Science. D7.1 Introduction. D7.2 Turing Machines as Words. D7.3 Special Halting Problem Theory of Computer Science May 2, 2018 D7. Halting Problem and Reductions Theory of Computer Science D7. Halting Problem and Reductions Gabriele Röger University of Basel May 2, 2018 D7.1 Introduction

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

CSCE 551 Final Exam, April 28, 2016 Answer Key

CSCE 551 Final Exam, April 28, 2016 Answer Key CSCE 551 Final Exam, April 28, 2016 Answer Key 1. (15 points) Fix any alphabet Σ containing the symbol a. For any language L Σ, define the language a\l := {w Σ wa L}. Show that if L is regular, then a\l

More information

6.045 Final Exam Solutions

6.045 Final Exam Solutions 6.045J/18.400J: Automata, Computability and Complexity Prof. Nancy Lynch, Nati Srebro 6.045 Final Exam Solutions May 18, 2004 Susan Hohenberger Name: Please write your name on each page. This exam is open

More information

Primitive recursive functions: decidability problems

Primitive recursive functions: decidability problems 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.

More information

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page. 6.045J/18.400J: Automata, Computability and Complexity March 30, 2005 Quiz 2 Prof. Nancy Lynch Please write your name in the upper corner of each page. Problem Score 1 2 3 4 5 6 Total Q2-1 Problem 1: True

More information

Organische Chemie IV: Organische Photochemie

Organische Chemie IV: Organische Photochemie Organische Chemie IV: Organische Photochemie Wintersemester 2014/15 Technische Universität München Klausur am 05.02.2015 Name, Vorname... Matrikel-Nr.... (Druckbuchstaben) geboren am... in...... (Eigenhändige

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

Exam Computability and Complexity

Exam Computability and Complexity Total number of points:... Number of extra sheets of paper:... Exam Computability and Complexity by Jiri Srba, January 2009 Student s full name CPR number Study number Before you start, fill in the three

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

Theory of Computer Science. D5.1 Introduction. Theory of Computer Science. D5.2 Primitive Recursion vs. LOOP. D5.3 µ-recursion vs.

Theory of Computer Science. D5.1 Introduction. Theory of Computer Science. D5.2 Primitive Recursion vs. LOOP. D5.3 µ-recursion vs. Theory of Computer Science May 2, 2016 D5. Primitive/µ-Recursion vs. LOOP-/WHILE-Computability Theory of Computer Science D5. Primitive/µ-Recursion vs. LOOP-/WHILE-Computability Malte Helmert University

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

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

Organische Chemie IV: Organische Photochemie

Organische Chemie IV: Organische Photochemie Organische Chemie IV: Organische Photochemie Wintersemester 2015/16 Technische Universität München Klausur am 19.02.2016 Name, Vorname... Matrikel-Nr.... (Druckbuchstaben) geboren am... in...... (Eigenhändige

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

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

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 17: conp, Oracles again, Space Complexity

CS154, Lecture 17: conp, Oracles again, Space Complexity CS154, Lecture 17: conp, Oracles again, Space Complexity Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode: Guess string

More information

Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12

Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12 Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12 Queen s University, Faculty of Arts and Science, School of Computing CISC-462 Final Exam, December XY, 2017 (Instructor: Kai Salomaa) INSTRUCTIONS

More information

Lecture 22: PSPACE

Lecture 22: PSPACE 6.045 Lecture 22: PSPACE 1 VOTE VOTE VOTE For your favorite course on automata and complexity Please complete the online subject evaluation for 6.045 2 Final Exam Information Who: You On What: Everything

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

Solutions to Old Final Exams (For Fall 2007)

Solutions to Old Final Exams (For Fall 2007) Solutions to Old Final Exams (For Fall 2007) CS 381 (Fall 2002, Fall 2004, Fall 2005, Fall 2006) Yogi Sharma Disclaimer: I, Yogi Sharma, do not claim these solution to be complete, or even to be absolutely

More information

Introduction to Turing Machines

Introduction to Turing Machines Introduction to Turing Machines Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 12 November 2015 Outline 1 Turing Machines 2 Formal definitions 3 Computability

More information

satisfiability (sat) Satisfiability unsatisfiability (unsat or sat complement) and validity Any Expression φ Can Be Converted into CNFs and DNFs

satisfiability (sat) Satisfiability unsatisfiability (unsat or sat complement) and validity Any Expression φ Can Be Converted into CNFs and DNFs Any Expression φ Can Be Converted into CNFs and DNFs φ = x j : This is trivially true. φ = φ 1 and a CNF is sought: Turn φ 1 into a DNF and apply de Morgan s laws to make a CNF for φ. φ = φ 1 and a DNF

More information

Lecture 14: Recursive Languages

Lecture 14: Recursive Languages Lecture 14: Recursive Languages Instructor: Ketan Mulmuley Scriber: Yuan Li February 24, 2015 1 Recursive Languages Definition 1.1. A language L Σ is called recursively enumerable (r. e.) or computably

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

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005 Complexity Theory Knowledge Representation and Reasoning November 2, 2005 (Knowledge Representation and Reasoning) Complexity Theory November 2, 2005 1 / 22 Outline Motivation Reminder: Basic Notions Algorithms

More information

Principles of Knowledge Representation and Reasoning

Principles of Knowledge Representation and Reasoning Principles of Knowledge Representation and Reasoning Complexity Theory Bernhard Nebel, Malte Helmert and Stefan Wölfl Albert-Ludwigs-Universität Freiburg April 29, 2008 Nebel, Helmert, Wölfl (Uni Freiburg)

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

(a) Definition of TMs. First Problem of URMs

(a) Definition of TMs. First Problem of URMs Sec. 4: Turing Machines First Problem of URMs (a) Definition of the Turing Machine. (b) URM computable functions are Turing computable. (c) Undecidability of the Turing Halting Problem That incrementing

More information

Answers to the CSCE 551 Final Exam, April 30, 2008

Answers to the CSCE 551 Final Exam, April 30, 2008 Answers to the CSCE 55 Final Exam, April 3, 28. (5 points) Use the Pumping Lemma to show that the language L = {x {, } the number of s and s in x differ (in either direction) by at most 28} is not regular.

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

Automata Theory CS S-FR2 Final Review

Automata Theory CS S-FR2 Final Review Automata Theory CS411-2015S-FR2 Final Review David Galles Department of Computer Science University of San Francisco FR2-0: Halting Problem e(m) e(w) Halting Machine takes as input an encoding of a Turing

More information

452 FINAL- VERSION E Do not open this exam until you are told. Read these instructions:

452 FINAL- VERSION E Do not open this exam until you are told. Read these instructions: 1 452 FINAL- VERSION E Do not open this exam until you are told. Read these instructions: 1. This is a closed book exam, though one sheet of notes is allowed. No calculators, or other aids are allowed.

More information

Database Theory VU , SS Complexity of Query Evaluation. Reinhard Pichler

Database Theory VU , SS Complexity of Query Evaluation. Reinhard Pichler Database Theory Database Theory VU 181.140, SS 2018 5. Complexity of Query Evaluation Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 17 April, 2018 Pichler

More information

Organische Chemie IV: Organische Photochemie

Organische Chemie IV: Organische Photochemie rganische Chemie IV: rganische Photochemie Sommersemester 2006 Technische Universität München Klausur am 04.08.2006 ame; Vorname... Matrikel-r.... (Druckbuchstaben) geboren am... in...... (Eigenhändige

More information

Lecture 21: Algebraic Computation Models

Lecture 21: Algebraic Computation Models princeton university cos 522: computational complexity Lecture 21: Algebraic Computation Models Lecturer: Sanjeev Arora Scribe:Loukas Georgiadis We think of numerical algorithms root-finding, gaussian

More information

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS CST.2014.6.1 COMPUTER SCIENCE TRIPOS Part IB Thursday 5 June 2014 1.30 to 4.30 pm COMPUTER SCIENCE Paper 6 Answer five questions. Submit the answers in five separate bundles, each with its own cover sheet.

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

Undecidability of the validity problem

Undecidability of the validity problem Undecidability of the validity problem We prove the undecidability of the validity problem for formulas of predicate logic with equality. Recall: there is an algorithm that given a formula of predicate

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

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes Complexity Theory 1 Complexity Theory 2 Complexity Theory Lecture 3 Complexity For any function f : IN IN, we say that a language L is in TIME(f(n)) if there is a machine M = (Q, Σ, s, δ), such that: L

More information

COMPLEXITY THEORY. Lecture 17: The Polynomial Hierarchy. TU Dresden, 19th Dec Markus Krötzsch Knowledge-Based Systems

COMPLEXITY THEORY. Lecture 17: The Polynomial Hierarchy. TU Dresden, 19th Dec Markus Krötzsch Knowledge-Based Systems COMPLEXITY THEORY Lecture 17: The Polynomial Hierarchy Markus Krötzsch Knowledge-Based Systems TU Dresden, 19th Dec 2017 Review: ATM vs. DTM Markus Krötzsch, 19th Dec 2017 Complexity Theory slide 2 of

More information

20.1 2SAT. CS125 Lecture 20 Fall 2016

20.1 2SAT. CS125 Lecture 20 Fall 2016 CS125 Lecture 20 Fall 2016 20.1 2SAT We show yet another possible way to solve the 2SAT problem. Recall that the input to 2SAT is a logical expression that is the conunction (AND) of a set of clauses,

More information

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II 2015-16, Max 80, Time 2 hr Name Entry No. Group Note (i) Write your answers neatly and precisely in the space provided with

More information

Predicate Logic - Undecidability

Predicate Logic - Undecidability CS402, Spring 2016 Undecidable Problems Does the following program halts? (1) N : n, total, x, y, z (2) n GetUserInput() (3) total 3 (4) while true (5) for x 1 to total 2 (6) for y 1 to total x 1 (7) z

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

SS BMMM01 Basismodul Mathematics/Methods Block 1: Mathematics for Economists. Prüfer: Prof. Dr.

SS BMMM01 Basismodul Mathematics/Methods Block 1: Mathematics for Economists. Prüfer: Prof. Dr. SS 2018 02.06.2018 1289BMMM01 Basismodul Mathematics/Methods Block 1: Mathematics for Economists Prüfer: Prof. Dr. Rainer Dyckerhoff Bitte füllen Sie die nachfolgende Zeile aus! Matrikelnummer (student

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

Complexity Theory Part I

Complexity Theory Part I Complexity Theory Part I Problem Problem Set Set 77 due due right right now now using using a late late period period The Limits of Computability EQ TM EQ TM co-re R RE L D ADD L D HALT A TM HALT A TM

More information

COMPLEXITY THEORY. PSPACE = SPACE(n k ) k N. NPSPACE = NSPACE(n k ) 10/30/2012. Space Complexity: Savitch's Theorem and PSPACE- Completeness

COMPLEXITY THEORY. PSPACE = SPACE(n k ) k N. NPSPACE = NSPACE(n k ) 10/30/2012. Space Complexity: Savitch's Theorem and PSPACE- Completeness 15-455 COMPLEXITY THEORY Space Complexity: Savitch's Theorem and PSPACE- Completeness October 30,2012 MEASURING SPACE COMPLEXITY FINITE STATE CONTROL I N P U T 1 2 3 4 5 6 7 8 9 10 We measure space complexity

More information

There are problems that cannot be solved by computer programs (i.e. algorithms) even assuming unlimited time and space.

There are problems that cannot be solved by computer programs (i.e. algorithms) even assuming unlimited time and space. Undecidability There are problems that cannot be solved by computer programs (i.e. algorithms) even assuming unlimited time and space. Proved by Alan Turing in 1936 What is a computer program/algorithm?

More information

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits Chris Calabro January 13, 2016 1 RAM model There are many possible, roughly equivalent RAM models. Below we will define one in the fashion

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

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine) CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM) Proposed by Alan Turing in 936 finite-state control + infinitely long tape A stronger

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ Today's learning goals Sipser Ch 3 Trace the computation of a Turing machine using its transition function and configurations.

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

1 PSPACE-Completeness

1 PSPACE-Completeness CS 6743 Lecture 14 1 Fall 2007 1 PSPACE-Completeness Recall the NP-complete problem SAT: Is a given Boolean formula φ(x 1,..., x n ) satisfiable? The same question can be stated equivalently as: Is the

More information

PROOFS IN PREDICATE LOGIC AND COMPLETENESS; WHAT DECIDABILITY MEANS HUTH AND RYAN 2.3, SUPPLEMENTARY NOTES 2

PROOFS IN PREDICATE LOGIC AND COMPLETENESS; WHAT DECIDABILITY MEANS HUTH AND RYAN 2.3, SUPPLEMENTARY NOTES 2 PROOFS IN PREDICATE LOGIC AND COMPLETENESS; WHAT DECIDABILITY MEANS HUTH AND RYAN 2.3, SUPPLEMENTARY NOTES 2 Neil D. Jones DIKU 2005 12 September, 2005 Some slides today new, some based on logic 2004 (Nils

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 3.3, 4.1 State and use the Church-Turing thesis. Give examples of decidable problems.

More information

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine) CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM)? Proposed by Alan Turing in 936 finite-state control + infinitely long tape A

More information

Technische Universität München Summer term 2010 Theoretische Informatik August 2, 2010 Dr. J. Kreiker / Dr. M. Luttenberger, J. Kretinsky SOLUTION

Technische Universität München Summer term 2010 Theoretische Informatik August 2, 2010 Dr. J. Kreiker / Dr. M. Luttenberger, J. Kretinsky SOLUTION Technische Universität München Summer term 2010 Theoretische Informatik August 2, 2010 Dr. J. Kreiker / Dr. M. Luttenberger, J. Kretinsky SOLUTION Complexity Theory Final Exam Please note : If not stated

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

CSCE 551 Final Exam, Spring 2004 Answer Key

CSCE 551 Final Exam, Spring 2004 Answer Key CSCE 551 Final Exam, Spring 2004 Answer Key 1. (10 points) Using any method you like (including intuition), give the unique minimal DFA equivalent to the following NFA: 0 1 2 0 5 1 3 4 If your answer is

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

Midterm II : Formal Languages, Automata, and Computability

Midterm II : Formal Languages, Automata, and Computability Midterm II 15-453: Formal Languages, Automata, and Computability Lenore Blum, Asa Frank, Aashish Jindia, and Andrew Smith April 8, 2014 Instructions: 1. Once the exam begins, write your name on each sheet.

More information

Finish K-Complexity, Start Time Complexity

Finish K-Complexity, Start Time Complexity 6.045 Finish K-Complexity, Start Time Complexity 1 Kolmogorov Complexity Definition: The shortest description of x, denoted as d(x), is the lexicographically shortest string such that M(w) halts

More information

Complexity Theory Final Exam

Complexity Theory Final Exam Technische Universität München Summer term 2010 Theoretische Informatik August 2, 2010 Dr. J. Kreiker / Dr. M. Luttenberger, J. Kretinsky Complexity Theory Final Exam Please note : If not stated otherwise,

More information

P vs. NP Classes. Prof. (Dr.) K.R. Chowdhary.

P vs. NP Classes. Prof. (Dr.) K.R. Chowdhary. P vs. NP Classes Prof. (Dr.) K.R. Chowdhary Email: kr.chowdhary@iitj.ac.in Formerly at department of Computer Science and Engineering MBM Engineering College, Jodhpur Monday 10 th April, 2017 kr chowdhary

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

Complexity: Some examples

Complexity: Some examples Algorithms and Architectures III: Distributed Systems H-P Schwefel, Jens M. Pedersen Mm6 Distributed storage and access (jmp) Mm7 Introduction to security aspects (hps) Mm8 Parallel complexity (hps) Mm9

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

CS 311 Sample Final Examination

CS 311 Sample Final Examination Name: CS 311 Sample Final Examination Time: One hour and fifty minutes This is the (corrected) exam from Fall 2009. The real exam will not use the same questions! 8 December 2009 Instructions Attempt all

More information

Expansions with P = NP. Christine Gaßner Greifswald

Expansions with P = NP. Christine Gaßner Greifswald Expansions with P = NP Greifswald Expansions with P = NP 1. 2. The complexity classes P Σ, NP Σ, DEC Σ 3. Why is it difficult to find an R with P ΣR = NP ΣR? 4. How to construct a relation R such that

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

DRAFT. Diagonalization. Chapter 4

DRAFT. Diagonalization. Chapter 4 Chapter 4 Diagonalization..the relativized P =?NP question has a positive answer for some oracles and a negative answer for other oracles. We feel that this is further evidence of the difficulty of the

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

Lecture 16: Time Complexity and P vs NP

Lecture 16: Time Complexity and P vs NP 6.045 Lecture 16: Time Complexity and P vs NP 1 Time-Bounded Complexity Classes Definition: TIME(t(n)) = { L there is a Turing machine M with time complexity O(t(n)) so that L = L(M) } = { L L is a language

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

On NP-Completeness for Linear Machines

On NP-Completeness for Linear Machines JOURNAL OF COMPLEXITY 13, 259 271 (1997) ARTICLE NO. CM970444 On NP-Completeness for Linear Machines Christine Gaßner* Institut für Mathematik und Informatik, Ernst-Moritz-Arndt-Universität, F.-L.-Jahn-Strasse

More information

Lecture 12: Mapping Reductions

Lecture 12: Mapping Reductions Lecture 12: Mapping Reductions October 18, 2016 CS 1010 Theory of Computation Topics Covered 1. The Language EQ T M 2. Mapping Reducibility 3. The Post Correspondence Problem 1 The Language EQ T M The

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

Week 3: Reductions and Completeness

Week 3: Reductions and Completeness Computational Complexity Theory Summer HSSP 2018 Week 3: Reductions and Completeness Dylan Hendrickson MIT Educational Studies Program 3.1 Reductions Suppose I know how to solve some problem quickly. How

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

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

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

SOLUTION: SOLUTION: SOLUTION:

SOLUTION: SOLUTION: SOLUTION: Convert R and S into nondeterministic finite automata N1 and N2. Given a string s, if we know the states N1 and N2 may reach when s[1...i] has been read, we are able to derive the states N1 and N2 may

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 and Complexity CISC462, Fall 2018, Space complexity 1

Computability and Complexity CISC462, Fall 2018, Space complexity 1 Computability and Complexity CISC462, Fall 2018, Space complexity 1 SPACE COMPLEXITY This material is covered in Chapter 8 of the textbook. For simplicity, we define the space used by a Turing machine

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

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions CS 6743 Lecture 15 1 Fall 2007 1 Circuit Complexity 1.1 Definitions A Boolean circuit C on n inputs x 1,..., x n is a directed acyclic graph (DAG) with n nodes of in-degree 0 (the inputs x 1,..., x n ),

More information

De Morgan s a Laws. De Morgan s laws say that. (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2.

De Morgan s a Laws. De Morgan s laws say that. (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2. De Morgan s a Laws De Morgan s laws say that (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2. Here is a proof for the first law: φ 1 φ 2 (φ 1 φ 2 ) φ 1 φ 2 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 0 a Augustus DeMorgan

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

Theory of Computation

Theory of Computation Theory of Computation Prof. Michael Mascagni Florida State University Department of Computer Science 1 / 33 This course aims to cover... the development of computability theory using an extremely simple

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