Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize...

36
Decidability
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    214
  • download

    0

Transcript of Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize...

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

Decidability

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

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

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

Decidable problems concerning Regular languagesADFA={<B,w>| B is a DFA that accepts w }

Thm:ADFA is a decidable language

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

Proof: M=“On input <B,w>, where B is DFA

and w is a string:1. Simulate B on input w2. If the simulation ends in an accept state, accept. If it ends in a non-accepting state, reject.”

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

ANFA ={<B,w>| B is an NFA that accepts w}

Thm:ANFA is a decidable language.

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

Proof: N = “ On input <B,w> 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.192. Run TM M from the previous Thm on input <C,w>3. If M accepts, accept; otherwise reject. ”

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

AREX={<R,w>| R is a regular expression that generates string w }

Thm:AREX is a decidable language.

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

Proof: P= “ On input <R,w> 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.282. Run TM M on input <A,w>3. If Maccepts , accept ; if M rejects, reject. “

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

EDFA= {<A>| A is a DFA and L(A)=∅ }

Thm:EDFA is a decidable language

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

Proof: T= “ On input <A> 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. “

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

EQDFA={<A,B>: A and B are DFAs and

L(A)=L(B) } Thm:

EQDFA is a decidable language.

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

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 <A,B>, where A and B are DFAs:1. Construct DFA C as described2. Run the TM in the previous Thm on input

<C>.3. If accepts, accept; otherwise reject. “

))()(())()(()( BLALBLALCL

)(AL )(BL

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

Decidable problems concerning Context-free languages

ACFG={<G,w>: G is a CFG that generates

string w} Thm:

ACFG is a decidable language

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

Proof: S=“ On input <G,w>, 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. “

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

ECFG={<G>| G is a CFG and L(G)=∅ }

Thm:ECFG is a decidable language.

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

Proof: R = “On input <G>, where G is a CFG

1. Mark all terminal symbols in G2. Repeat until no new variables get marked:3. Mark all variables A with

AU1 …Uk

marked

4. If the start symbol is not marked, ACCEPT; else reject.

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

EQCFG={<G,H>| 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 EQDFA DOES NOT work

Thm:Every CFL is decidable.

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

Proof: Let G be a CFG for A and design a TM MG that

decides AMG =“On input w:

1. Run TM S on input <G,w>2. If this machine accepts, ACCEPTS;

otherwise REJECTS. “

Defined before

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

Halting Problem ATM={<M,w>| M is a TM and M accepts

w }

Thm:ATM is un-decidable .

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

(conti.) U=“On input <M,w>, 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 ATM but NOT decides it!

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

Diagonalization Method: (Georg Cantor in 1873)

A and B are the same size if there is a 1-1, onto function f : AB

fA B

f is 1-1 : f(a) ≠ f(b) ,

if a≠ b

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

Eg:N={1,2,3,…} E={2,4,6,…}

f(n)=2n

n 1 2 3 4 5 …f(n)

2 4 6 8 10 …

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

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

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

Eg:

countable : },:{ NnmQ nm

....

....

....

....

....

....

16

25

15

34

24

14

43

33

23

13

52

42

32

22

12

61

51

41

31

21

11

2

)2()1(

1)3()2( :

jijij

jijijji

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

Thm: R is uncountable

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

Proof: By contradiction.

Suppose there is a 1-1 onto f between N and R.

Thus x≠f(n) for any n ⇒

n f(n)

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)

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

ATM={<M,w>| M is a TM and M accepts w }

Thm:ATM is un-decidable.

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

Proof: Assume ATM is decidable.

Suppose H decides ATM and

H(<M,w>)= accept if M accepts w reject if M does not accept w

Define D= “ On input <M>, where M is a TM:

1. Run H on input < M,<M> >.2. Output the opposite of what H outputs

i.e. if H accepts, REJECT,and if H rejects, ACCEPT. “

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

(Proof conti.) D(<M>)= accept if M does not accept <M>

reject if M accepts <M>

D(<D>)= accept if D does not accept <D>reject if D accepts <D>

⇒ Thus, ATM is un-decidable.

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

1.

(i, j) is accept if Mi accepts <Mj>

<M1> <M2> <M3> <M4> …

M1 Accept

Accept

M2 Accept

Accept

Accept

Accept

M3

M4 Accept

Accept

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

2.

(i, j) is the value of H on input <Mi ,<Mj>>.

<M1> <M2> <M3> <M4> …

M1 Accept

Reject

Accept

Reject

M2 Accept

Accept

Accept

Accept

M3 Reject

Reject

Reject

Reject

M4 Accept

Accept

Reject

Reject

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

3.<M1> <M2> <M3> <M4> … <D> …

M1 Accept

Reject

Accept

Reject

Accept

M2 Accept

Accept

Accept

Accept

Accept

M3 Reject

Reject

Reject

Reject

… Reject

M4 Accept

Accept

Reject

Reject

Accept

⋮ ⋮ ⋱

D Reject

Reject

Accept

Accept

??

⋮ ⋮ ⋱

Contradiction!

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

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.

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

Proof: “⇒ ”

If A is decidable, then both A and are Turing-recognizable.

A

No

YesMAx MAx

YesNo

YesNo

AM

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

(Proof conti.): “⇐ ”

If both A and are Turing-recognizable, let M1 recognize A and M2 recognize .

M decides A.

AA

M:M1

YesNoYe

s

YesM

2

x

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

Cor: is not Turing-recognizable.TMA