Download presentation
Presentation is loading. Please wait.
Published byElijah Logan Modified over 9 years ago
1
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck
2
Decidability Definition: A language is decidable if there is a TM that accepts all words in the language and rejects all words not in the language In particular it always halts in finite time For a Turing machine M the language accepted by M is the set of x on which M accepts (denoted by L M )
3
Example U={,x: M accepts x} – Universal Language (inputs acc. by the universal TM) U is not decidable: HALT · U – Note: decider must be correct and halt on all inputs Reduction: Map,x to,x – where N is the machine that simulates M, and if M halts, then N accepts (N never rejects),x 2 HALT,,x 2 U
4
Decidability The complement of L is the set of strings that is not in L (over the same alphabet) Observation: L is decidable if and only if C(L) is decidable – simply switch acceptance with rejecting Corollary: If L is not decidable then C(L) is also not decidable Example: EMPTY={ : L M = ; } is not decidable – Note this is not exactly the complement of NEMPTY, but the complement minus a computable set: {x: x is not a TM encoding}
5
Equivalence EQ={, : L M =L N } Theorem: EQ is not decidable Reduction from EMPTY Fix some TM N that never accepts Reduction maps to,
6
Closure If L is decidable and S is decidable then – Complement of L is decidable – L Å S is decidable – L [ S is decidable Corollary: – CH={ : M halts on no input} is not decidable CH=C(H)-{x: not encoding a TM}
7
Rice’s Theorem A (nontrivial) property P of languages is a subset of all languages – such that there is a language (accepted by a TM) with P and a language (accepted by a TM) without P Theorem: Let L(P)={ : L M has property P}, where P is a nontrivial property – Then: L(P) is not decidable Example: { : f M can be computed in polynomial time} – Note: M might not run in polynomial time Not an example: { : M runs 100 steps on the empty input}
8
Proof [Rice] We assume that ; does not have property P – Otherwise we use the complement of P Denote by A some TM such that L A has property P – Must exist since P is not trivial We show that U · L P Given, x we construct M x : – Simulate M on x – If M accepts x then simulate A on the input u to M x – If M does not accept x go into infinite loop Now:,x 2 U ) M accepts x ) M x accepts u iff A accepts u ) M x behaves like A and L(M x ) has property P,x not in U ) M x will not halt ) L(M x ) is empty, L(M x ) does not have property P
9
Nondeterminism Consider the set of languages that can be accepted by nondeterministic TM that always halt As before we can see that these can be simulated by deterministic TM that run in exponentially more time Corollary: Computability by deterministic and nondeterministic TM is the same as long as the TM must halt What if the NTM does not need to halt?
10
One-sided decisions For NP it does not matter if the NTM halts on inputs not in the language, because we have a time upper bound and can stop the machine after that time If there is no time bound we never know if the machine might still accept Definition: A language L is recognizable if there is a TM that accepts it (which might never stop on inputs outside of L).
11
Example Halting problem HALT Simply simulate M on x If M halts on x, accept Clearly: all,x that are in HALT are accepted, all other,x are not accepted Theorem: HALT is recognizable Similar: H={ : M accepts some x} is recognizable
12
Complements Theorem: – If L and C(L) are recognizable, then L is decidable Proof: – There are recognizers M and N for L and C(L) – Idea: simulate both in parallel Simulate M for a few steps, then N, then M again... – One of them stops: can make the decision – x 2 L then M accepts and our machine also accepts – x 2 C(L) then N accepts and our machine rejects
13
Complements Corollary: the following situations are possible: – L and C(L) both decidable – L recognizable but C(L) not recognizable and both not decidable – both L and C(L) not recognizable Example: HALT is not decidable but recognizable, hence C(HALT) not recognizable
14
Not recognizable Theorem: Assume L · S. If L is not recognizable then S is not recognizable – Proof: If S is recognizable, we can recognize L by computing the reduction and then using the recognizer for S Theorem: C(U) is not recognizable Proof: Enough to show that U is recognizable, since U is not decidable How? Simulate M on x.
15
Not recognizable Theorem: EQ is not recognizable – Reduction from C(H)={ : M halts on no x} – Given find N: N simulates M and accepts if M halts – Map to,, where S does not accept anything – Then: 2 C(H), N accepts nothing,, 2 EQ
16
Not recognizable Theorem: C(EQ) is not recognizable Proof: – C(EQ)={, : L M L N } – Reduction from C(U) – N: ignore input, simulate M on x, accept if M accepts – S: accept every input – Map, x to, – If M is in C(U) them M rejects x or never halts. Then N rejects or never halts on every input, then N and S do not accept the same language – If M is not in C(U), then M accepts x, then N accepts everything, then N and S accept the same language
17
Corollary There are languages such the neither L not C(L) are recognizable
18
Enumerable Definition: L is enumerable, if there is a Turing machine M that writes all strings in L to a special output tape – M has no input and runs forever Theorem: L is enumerable iff L is recognizable – Proof: ) : Enumerate L, test each output against x, once x is found, accept
19
Back direction of the proof Idea: loop over all inputs, and write the accepted ones to the output tape Problem: TM does not halt Solution: Dove-Tailing: – Loop over all strings x – Loop over all integers i – Simulate M on x for i steps. – If M accepts, write x to the output tape Clearly this machine eventually writes all recognized strings to the tape
20
Other problems? All problems so far concern Turing machines Any other undecidable problems? Example: Arithmetic – Given a sentence in Peano arithmetic, can it be proved from the Peano axiom [is it a theorem]? – Undecidable – Decidable: remove multiplication, still hard for doubly exponential time [Presburger arithmetic]
21
Hilbert’s 10 th problem A Diophantine equation is p(x 1,…,x n )=0, where p is a polynomial with integer coefficients Question: Are there integer solutions? Example: a n +b n =c n, are there integer solutions for n>2? – There are none, but this slide is too small for the proof… Theorem [Matiyasevich ’70]: The problem of solving Diophantine Equations is uncomputable
22
Example: Posts’ correspondence problem Given two sequences of strings – example: A=[a, ab, bba] and B=[baa, aa, bb] Can we find a set of indices such that the corresponding strings are the same(concatenated? Example: 3,2,3,1 – bba ab bba a = bb aa bb baa Problem is undecidable
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.