BU CS 332 Theory of Computation Lecture 15: Reading: Undecidable - - PowerPoint PPT Presentation

bu cs 332 theory of computation
SMART_READER_LITE
LIVE PREVIEW

BU CS 332 Theory of Computation Lecture 15: Reading: Undecidable - - PowerPoint PPT Presentation

BU CS 332 Theory of Computation Lecture 15: Reading: Undecidable and Unrecognizable Languages Sipser Ch 4.2, 5.1 Reductions Mark Bun March 23, 2020 How can we compare sizes of infinite sets? Definition: Two sets have the same size if


slide-1
SLIDE 1

BU CS 332 – Theory of Computation

Lecture 15:

  • Undecidable and

Unrecognizable Languages

  • Reductions

Reading: Sipser Ch 4.2, 5.1

Mark Bun March 23, 2020

slide-2
SLIDE 2

How can we compare sizes of infinite sets?

Definition: Two sets have the same size if there is a correspondence (bijection) between them A set is countable if

  • it is a finite set, or
  • it has the same size as , the set of natural numbers

3/23/2020 CS332 ‐ Theory of Computation 2

slide-3
SLIDE 3

A general theorem about set sizes

Theorem: Let be a set. Then the power set does not have the same size as . Proof: Assume for the sake of contradiction that there is a correspondence Goal: Use diagonalization to construct a set that cannot be the output for any

3/23/2020 CS332 ‐ Theory of Computation 3

slide-4
SLIDE 4

Undecidable Languages

3/23/2020 CS332 ‐ Theory of Computation 4

slide-5
SLIDE 5

Problems in language theory

3/23/2020 CS332 ‐ Theory of Computation 5

𝐄𝐆𝐁

decidable

𝐃𝐆𝐇

decidable

𝐄𝐆𝐁

decidable

𝐃𝐆𝐇

decidable

𝐄𝐆𝐁

decidable

𝐔𝐍

?

𝐔𝐍

?

𝐔𝐍

?

𝐃𝐆𝐇

?

slide-6
SLIDE 6

Undecidability

These natural computational questions about computational models are undecidable I.e., computers cannot solve these problems no matter how much time they are given

3/23/2020 CS332 ‐ Theory of Computation 6

slide-7
SLIDE 7

An existential proof

Theorem: There exists an undecidable language over Proof: A simplifying assumption: Every string in

∗ is the

encoding

  • f some Turing machine

Set of all Turing machines:

Set of all languages over : There are more languages than there are TM deciders!

3/23/2020 CS332 ‐ Theory of Computation 7

all subsets of

=

slide-8
SLIDE 8

An existential proof

Theorem: There exists an unrecognizable language over Proof: A simplifying assumption: Every string in

∗ is the

encoding

  • f some Turing machine

Set of all Turing machines:

Set of all languages over : There are more languages than there are TM recognizers!

3/23/2020 CS332 ‐ Theory of Computation 8

all subsets of

=

slide-9
SLIDE 9

An explicit undecidable language

3/23/2020 CS332 ‐ Theory of Computation 9

TM 𝑁 𝑁 𝑁 𝑁 𝑁

slide-10
SLIDE 10

An explicit undecidable language

3/23/2020 CS332 ‐ Theory of Computation 10

TM 𝑁 𝑁 𝑁 ? 𝑁 𝑁 ? 𝑁 𝑁 ? 𝑁 𝑁 ? 𝑁

Y N Y Y

𝑁

N N Y Y

𝑁

Y Y Y N

𝑁

N N Y N

… …

Suppose decides

𝐸 𝐸 ? 𝐸

slide-11
SLIDE 11

An explicit undecidable language

Theorem: is undecidable Proof: Suppose for contradiction, that decides Corollary:

  • is undecidable

3/23/2020 CS332 ‐ Theory of Computation 11

slide-12
SLIDE 12

A more useful undecidable language

  • Theorem:

is undecidable

But first:

is Turing‐recognizable

The following “universal TM” recognizes

  • On input

:

  • 1. Simulate running
  • n input
  • 2. If

accepts, accept. If rejects, reject.

3/23/2020 CS332 ‐ Theory of Computation 12

slide-13
SLIDE 13

More on the Universal TM

"It is possible to invent a single machine which can be used to compute any computable sequence. If this machine U is supplied with a tape on the beginning of which is written the S.D ["standard description"] of some computing machine M, then U will compute the same sequence as M.” ‐ Turing, “On Computable Numbers…” 1936

  • Foreshadowed general‐purpose programmable computers
  • No need for specialized hardware: Virtual machines as software

3/23/2020 CS332 ‐ Theory of Computation 13

Harvard architecture: Separate instruction and data pathways von Neumann architecture: Programs can be treated as data

slide-14
SLIDE 14

A more useful undecidable language

  • Theorem:

is undecidable

Proof: Assume for the sake of contradiction that TM decides

:

Idea: Show that can be used to decide the (undecidable) language

‐‐ a contradiction.

3/23/2020 CS332 ‐ Theory of Computation 14

slide-15
SLIDE 15

A more useful undecidable language

  • Suppose

decides

  • Consider the following TM .

On input where is a TM: 1. Run

  • n input

2. If accepts, accept. If rejects, reject. Claim: decides

  • …but this language is undecidable

3/23/2020 CS332 ‐ Theory of Computation 15

slide-16
SLIDE 16

Unrecognizable Languages

Theorem: A language is decidable if and only if and are both Turing‐recognizable. Proof:

3/23/2020 CS332 ‐ Theory of Computation 16

slide-17
SLIDE 17

Classes of Languages

3/23/2020 CS332 ‐ Theory of Computation 17

context free regular recognizable decidable

slide-18
SLIDE 18

Reductions

3/23/2020 CS332 ‐ Theory of Computation 18

slide-19
SLIDE 19

A more useful undecidable language

  • Theorem:

is undecidable

Proof: Assume for the sake of contradiction that TM decides

:

Idea: Show that can be used to decide the (undecidable) language

‐‐ a contradiction.

“A reduction from

to ”

3/23/2020 CS332 ‐ Theory of Computation 19

slide-20
SLIDE 20

Scientists vs. Engineers

A computer scientist and an engineer are stranded on a desert island. They find two palm trees with one coconut

  • n each. The engineer climbs a tree, picks a coconut and

eats. The computer scientist climbs the second tree, picks a coconut, climbs down, climbs up the first tree and places it there, declaring success. “Now we’ve reduced the problem to one we’ve already solved.”

3/23/2020 CS332 ‐ Theory of Computation 20

slide-21
SLIDE 21

Reductions

A reduction from problem to problem is an algorithm for problem which uses an algorithm for problem as a subroutine If such a reduction exists, we say “ reduces to ”

3/23/2020 CS332 ‐ Theory of Computation 21

slide-22
SLIDE 22

Two uses of reductions

Positive uses: If reduces to and is decidable, then is also decidable

3/23/2020 CS332 ‐ Theory of Computation 22

  • Theorem:

is decidable

Proof: The following TM decides

  • On input
  • , where
  • are DFAs:
  • 1. Construct a DFA

that recognizes the symmetric difference

  • 2. Run the decider for on

and return its output

slide-23
SLIDE 23

Two uses of reductions

Negative uses: If reduces to and is undecidable, then is also undecidable

3/23/2020 CS332 ‐ Theory of Computation 23

𝐵 𝑁, 𝑥 𝑁 is a TM that accepts input 𝑥 Suppose 𝐼 decides 𝐵 Consider the following TM 𝐸. On input 𝑁 where 𝑁 is a TM: 1. Run 𝐼 on input 𝑁, 𝑁 2. If 𝐼 accepts, accept. If 𝐼 rejects, reject. Claim: 𝐸 decides 𝑇𝐵 𝑁 𝑁 is a TM that accepts on input 𝑁

slide-24
SLIDE 24

Two uses of reductions

Negative uses: If reduces to and is undecidable, then is also undecidable Proof template:

  • 1. Suppose to the contrary that

is decidable

  • 2. Using

as a subroutine, construct an algorithm deciding

  • 3. But

is undecidable. Contradiction!

3/23/2020 CS332 ‐ Theory of Computation 24

slide-25
SLIDE 25

Halting Problem

  • Theorem:

is undecidable

Proof: Suppose for contradiction that there exists a decider for

. We construct a decider for as follows:

On input : 1. Run

  • n input

2. If rejects, reject 3. If accepts, simulate

  • n

4. If accepts, accept. Otherwise, reject This is a reduction from

to

  • 3/23/2020

CS332 ‐ Theory of Computation 25

slide-26
SLIDE 26

Empty language testing for TMs

  • Theorem: is undecidable

Proof: Suppose for contradiction that there exists a decider for . We construct a decider for

as follows:

On input : 1. Run

  • n input ???

This is a reduction from

to

3/23/2020 CS332 ‐ Theory of Computation 26

slide-27
SLIDE 27

Empty language testing for TMs

  • Theorem: is undecidable

Proof: Suppose for contradiction that there exists a decider for . We construct a decider for

as follows:

On input : 1. Construct a TM as follows:

  • 2. Run
  • n input
  • 3. If

, accept. Otherwise, reject This is a reduction from

to

3/23/2020 CS332 ‐ Theory of Computation 27