12
UNIT-3 UNDECIDABILITY

UNIT-4

Embed Size (px)

DESCRIPTION

Undecidable

Citation preview

Page 1: UNIT-4

UNIT-3

UNDECIDABILITY

Page 2: UNIT-4

Undecidable problem about turing machine

• Reduction: Reduction is a used to prove whether given language is decidable or not.

• It is a technique in which if a problem P1 is reduced to a problem P2then any solution of P2 solves P1.

• in general, if we have algorithm to convert and instance of a problem P1 to instance of a problem P2 that have the same answer then it is called as P1 reduces P2.hence if P1 is not recursive then P2 is also not recursive.

• Similarly, if P1 is not recursively enumerable then P2 also is not recursively enumerable.

Page 3: UNIT-4

• Theorem:If P1 is reduced to P2 then• (i)if P1 is undecidable then P2 is also undecidable.• (ii) if P1 is non-RE then P2 is also non-RE.• Proof:• Consider an instance w of P1.then construct an

algorithm such that the algorithm takes instance w as input and converts it into another instance x of P2.

• then apply that algorithm to check whether x is in P2,if algorithm answers “yes” then that means x is in P2,similarly we can also say that w is in P1. Since we have obtained P2 after reduction of P1.

• similarly,if algorithm answers “no”then x is not in P2,that also means w is not in P1.this proves that if P1 is undecidable then P1 is also undecidable.

Page 4: UNIT-4

• We assume that P1 is non RE but P2 is RE.now construct an algorithm to reduce P1 to P2,but by this algorithm P2 will be recognized. That means there will be a turing machine that sya “yes” if the input is P2 but may or may not halt for the input which is not in P2.

• As we know that one can convert instance of w in P1 to an instance x in P2. Then apply a TM to check whether x is in P2.

• if x is accepted that also means w is accepted.This procedure describes a TM whose language is P1 if w is in P1 then x is also in P2 and if w is not in P1 then x is not in P2.

• This proves that if P1 is non-RE then P2 is also non-RE.

Page 5: UNIT-4

Empty and non-Empty language• There are two types of languages empty and non

empty.let Le denotes an empty language and Lne denotes non empty language.let w be a binary string and Mi be a TM.if L(Mi)=ɸ then Mi doesnot accept any input then w is in Le .similarly if L(Mi) is not empty language then w is in Lne.thus we can say that

• Both Le and Lne are complement of one another.

Page 6: UNIT-4

• Theorem: Lne are recursively enumerable.• Proof:To prove this, we simply need to prove

that there exists some TM which accepts Lne.To do this, we need to construct non deterministic Turing machine M that can be converted to deterministic Turing machine.

• The turing machine M accepts another Turing machine Mi as input.With the non deterministic capability M can guess the input w that can be accepted by Mi if Mi accepts w then M also accepts the input Mi.

Page 7: UNIT-4

• Thus if at all Mi accepts even one input,the M will guess that string and will accept Mi.But if L(Mi)=ɸ that means M can make no guess about the input string and therefore cannot accept Mi.This proves that there should be such a turing machine whose language L(Mi)≠ɸ,thus L(M)= Lne.

Page 8: UNIT-4

Halting Problem

• To state halting problem, consider the given configuration of a turing machine. The output of TM can be

• 1.Halt:the machine starting at this configuration will halt after a finite number of states.

• 2.No Halt:the machine starting at this configuration never reaches a halt state, no matter how long it runs it runs.

• Now the question arises based on these two observations:Given any functional matrix,input data tape and initial configuration,then is it possible to determine whether the process will ever halt?this is called HALTING PROBLEM.

• .

Page 9: UNIT-4

• That means we are asking for a procedure which enable us to solve the halting problem for every pair (machine,tape).the answer is “no”.That is the halting problem is unsolvable

• Now we will prove why its unsolvable. Let there exists halt when a description dT of T and tape t of T is given(that means the input to machine M1if T halt for input t, M1 also halts which is called accept halt. Similarly if T does not halt for input t then the M1 will halt which is called reject halt.

Page 10: UNIT-4

• Now we will consider another turing machine M2 which takes an input dT. it first copies dT and duplicates dT on its tape and then this duplicated tape information is given as input to machine M1 is a modified machine with the modification that whenever M1 is supposed to reach an accept halt, M2 loops forever.hence behavior of M2 is as given. It loops if T halts for input t= dT and halts if T does not halt for t= dT.the T is any arbitrary turing machine.

Page 11: UNIT-4

• As M2 itself is one turing machine we will take M2 =T.that means we will replace T by M2 from the above given machine

Page 12: UNIT-4

• Thus machine M2 halts for input dM2 if M2 which can tell whether any other TM will halt on particular input doesnot exist. Hence halting problem is unsolvable.