 # Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before.

## Presentation on theme: "Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before."— Presentation transcript:

Decidability

Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before we can find an algorithm solution A glimpse of the unsolvable can stimulate your imagination and help you gain an important perspective on computation

Decidable problems concerning Regular languages A DFA ={ | B is a DFA that accepts w } Thm: A DFA is a decidable language

Proof: M=“On input, where B is DFA and w is a string: 1. Simulate B on input w 2. If the simulation ends in an accept state, accept. If it ends in a non-accepting state, reject.”

A NFA ={ | B is an NFA that accepts w} Thm: A NFA is a decidable language.

Proof: N = “ On input where B is an NFA, and w is a string: 1. Convert NFA B to an equivalent DFA C using the procedure in Thm. 1.19 2. Run TM M from the previous Thm on input 3. If M accepts, accept; otherwise reject. ”

A REX ={ | R is a regular expression that generates string w } Thm: A REX is a decidable language.

Proof: P= “ On input where R is a regular expression and w is a string. 1. Convert R to an equivalent DFA A by the procedure given in Thm 1.28 2. Run TM M on input 3. If M accepts, accept ; if M rejects, reject. “

E DFA = { | A is a DFA and L(A)= ∅ } Thm: E DFA is a decidable language

Proof: T= “ On input where A is a DFA: 1. Mark the start state of A. 2. Repeat until no new state get marked: 3. Mark any state that has a transition coming into it from any state that is already marked. 4. If no accept state is marked, accept; otherwise reject. “

EQ DFA ={ : A and B are DFAs and L(A)=L(B) } Thm: EQ DFA is a decidable language.

Proof: L(C) = ∅ iff L(A)=L(B) L(C) is regular, since regular languages are closed under complementation, union, and intersection. F= “ On input, where A and B are DFAs: 1. Construct DFA C as described 2. Run the TM in the previous Thm on input. 3. If accepts, accept; otherwise reject. “

Decidable problems concerning Context-free languages A CFG ={ : G is a CFG that generates string w} Thm: A CFG is a decidable language

Proof: S=“ On input, where G is a CFG and w is a string: 1. Convert G to Chomsky normal form. 2. List all derivations with 2n-1 steps, where n is the length of w. 3. If any of these derivations generate w, accept; otherwise reject. “

E CFG ={ | G is a CFG and L(G)= ∅ } Thm: E CFG is a decidable language.

Proof: R = “On input, where G is a CFG 1. Mark all terminal symbols in G 2. Repeat until no new variables get marked: 3. Mark all variables A with A  U 1 …U k marked 4. If the start symbol is not marked, ACCEPT; else reject. ”

EQ CFG ={ | G and H are CFL’s and L(G)=L(H) } Not decidable Note that CFL is NOT closed under complementation or intersection. So the same technique for EQ DFA DOES NOT work Thm: Every CFL is decidable.

Proof: Let G be a CFG for A and design a TM M G that decides A M G =“On input w: 1. Run TM S on input 2. If this machine accepts, ACCEPTS; otherwise REJECTS. “ Defined before

Halting Problem A TM ={ | M is a TM and M accepts w } Thm: A TM is un-decidable.

(conti.) U=“On input, where M is a TM and w is a string: 1. Simulate M on input w. 2. If M ever enters its accept state, accept; if M ever enters reject state, reject. “ U recognizes A TM but NOT decides it!

Diagonalization Method: (Georg Cantor in 1873) A and B are the same size if there is a 1-1, onto function f : A  B f AB f is 1-1 : f(a) ≠ f(b), if a ≠ b

Eg: N={1,2,3,…} E={2,4,6,…} f(n)=2n n12345… f(n)246810…

Def: A is countable if either it is finite or it has the same size as N.

Eg:

Thm: R is uncountable

Proof: By contradiction. Suppose there is a 1-1 onto f between N and R. Thus x ≠ f(n) for any n ⇒ nf(n) 1234⋮ 1234⋮ 3.14159 ⋯ 55.5555 ⋯ 0.1234 ⋯ 0.5000 ⋯ ⋮ x=0.4201 ⋯ The i-th digit of x is not equal to the i-th of f(i)

A TM ={ | M is a TM and M accepts w } Thm: A TM is un-decidable.

Proof: Assume A TM is decidable. Suppose H decides A TM and H( )= accept if M accepts w reject if M does not accept w Define D= “ On input, where M is a TM: 1. Run H on input >. 2. Output the opposite of what H outputs i.e. if H accepts, REJECT, and if H rejects, ACCEPT. “

(Proof conti.) D( )= accept if M does not accept reject if M accepts D( )= accept if D does not accept reject if D accepts ⇒ Thus, A TM is un-decidable.

1. (i, j) is accept if M i accepts <M1><M1><M2><M2><M3><M3><M4><M4> ⋯ M1M1 Accept M2M2 M3M3 M4M4 ⋮

2. (i, j) is the value of H on input >. <M1><M1><M2><M2><M3><M3><M4><M4> ⋯ M1M1 AcceptRejectAcceptReject M2M2 Accept M3M3 Reject M4M4 Accept Reject ⋮

3. <M1><M1><M2><M2><M3><M3><M4><M4> ⋯ ⋯ M1M1 AcceptRejectAcceptRejectAccept M2M2 M3M3 Reject ⋯ ⋯ M4M4 Accept Reject Accept ⋮⋮⋱ DReject Accept ?? ⋮⋮⋱ Contradiction!

Turing-unrecognizable language: A language is co-Turing-recognizable if it is the Complement of a Turing-recognizable language. Thm: A language is decidable iff it is both Turing- recognizable and co-Turing-recognizable.

Proof: “ ⇒ ” If A is decidable, then both A and are Turing-recognizable. No Yes MAMA xMAMA x No Yes No

(Proof conti.): “ ⇐ ” If both A and are Turing-recognizable, let M 1 recognize A and M 2 recognize. M decides A. M: M1M1 Yes No Yes M2M2 x

Cor: is not Turing-recognizable.

Download ppt "Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before."

Similar presentations