Top Banner
BU CS 332 – Theory of Computation Lecture 17: Midterm II review Reading: Sipser Ch 3.15.1, 5.3 Mark Bun March 30, 2020
35

Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Aug 20, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

BU CS 332 – Theory of Computation

Lecture 17:• Midterm II review Reading:

Sipser Ch 3.1‐5.1, 5.3

Mark BunMarch 30, 2020

Page 2: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Format of the Exam

4/1/2020 CS332 ‐ Theory of Computation 2

Page 3: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

4/1/2020 CS332 ‐ Theory of Computation 3

Page 4: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

4/1/2020 CS332 ‐ Theory of Computation 4

Page 5: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Midterm II Topics

4/1/2020 CS332 ‐ Theory of Computation 5

Page 6: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Turing Machines (3.1, 3.3)• Know the three different “levels of abstraction” for defining Turing machines and how to convert between them: Formal/state diagram, implementation‐level, and high‐level• Know the definition of a configuration of a TM and the formal definition of how a TM computes• Know how to “program” Turing machines by giving implementation‐level descriptions• Understand the Church‐Turing Thesis

4/1/2020 CS332 ‐ Theory of Computation 6

Page 7: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

TM Variants (3.2)• Understand the following TM variants: Multi‐tape TMs, Nondeterministic TMs, Enumerators• Know how to give a simulation argument (implementation‐level description) to compare the power of TM variants• Understand the specific simulation arguments we’ve seen: multi‐tape TM by basic TM, nondeterministic TM by basic TM, enumerator by basic TM and basic TM by enumerator.

4/1/2020 CS332 ‐ Theory of Computation 7

Page 8: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Decidability (4.1)• Understand how to use a TM to simulate another machine (DFA, another TM)• Know the specific decidable languages from language theory that we’ve discussed, and how to decide them: 

, ,  ,  etc.• Know how to use a reduction to one of these languages to show that a new language is decidable• (You don’t need to know details of what Chomsky Normal Form is, but understand how it is used to prove decidability of  )

4/1/2020 CS332 ‐ Theory of Computation 8

Page 9: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Undecidability (4.2)• Know the definitions of countable and uncountable sets and how to prove countability and uncountability• Understand how diagonalization is used to prove the existence of explicit undecidable languages ( in the book, or  from lecture)• Know that a language is decidable iff it is recognizable and co‐recognizable, and understand the proof

4/1/2020 CS332 ‐ Theory of Computation 9

Page 10: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Reducibility (5.1)• Understand how to use a reduction (contradiction argument) to prove that a language is undecidable• Know the reductions showing that  , 

are undecidable

• You are not responsible for understanding the computation history method. However, you should know that the language  is undecidable, and reducing from it might be useful.

4/1/2020 CS332 ‐ Theory of Computation 10

Page 11: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Mapping Reducibility (5.3)• Understand the definition of a computable function• Understand the definition of a mapping reduction• Know how to use mapping reductions to prove decidability, undecidability, recognizability, and unrecognizability

4/1/2020 CS332 ‐ Theory of Computation 11

Page 12: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Tips for Preparing Exam Solutions

4/1/2020 CS332 ‐ Theory of Computation 12

Page 13: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

True or False

4/1/2020 CS332 ‐ Theory of Computation 13

• It’s all about the justification!• The logic of the argument has to be clear• Restating the question is not justification; we’re looking for some additional insight

Page 14: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Simulation arguments, constructing deciders

4/1/2020 CS332 ‐ Theory of Computation 14

• Full credit for a clear and correct description of the new machine• Still a good idea to provide an explanation 

(partial credit, clarifying ambiguity)

Page 15: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Undecidability proofs

4/1/2020 CS332 ‐ Theory of Computation 15

Page 16: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Uncountability proofs

4/1/2020 CS332 ‐ Theory of Computation 16

• The 2‐D table is useful for thinking about diagonalization, but is not essential to the argument

• The essential part of the proof is the construction of the “inverted diagonal” element, and the proof that it works

Page 17: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Practice Problems

4/1/2020 CS332 ‐ Theory of Computation 17

Page 18: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

4/1/2020 CS332 ‐ Theory of Computation 18

Page 19: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

4/1/2020 CS332 ‐ Theory of Computation 19

Page 20: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

4/1/2020 CS332 ‐ Theory of Computation 20

Page 21: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

4/1/2020 CS332 ‐ Theory of Computation 21

Page 22: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

4/1/2020 CS332 ‐ Theory of Computation 22

Page 23: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Decidability and Recognizability

4/1/2020 CS332 ‐ Theory of Computation 23

Page 24: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Let

Show that  is decidable

4/1/2020 CS332 ‐ Theory of Computation 24

Page 25: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Prove that  is recognizable

4/1/2020 CS332 ‐ Theory of Computation 25

Page 26: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Prove that if  and  are decidable, then so is 

4/1/2020 CS332 ‐ Theory of Computation 26

Page 27: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Countable and Uncountable Sets

4/1/2020 CS332 ‐ Theory of Computation 27

Page 28: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Show that the set of all valid (i.e., compile without errors) C++ programs is countable

4/1/2020 CS332 ‐ Theory of Computation 28

Page 29: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

A Celebrity Twitter Feed is an infinite sequence of ASCII strings, each with at most 140 characters. Show that the set of Celebrity Twitter Feeds is uncountable.

4/1/2020 CS332 ‐ Theory of Computation 29

Page 30: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Undecidability and Unrecognizability

4/1/2020 CS332 ‐ Theory of Computation 30

Page 31: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Prove or disprove: If  and  are recognizable, then so is 

4/1/2020 CS332 ‐ Theory of Computation 31

Page 32: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Prove that the language ∗ is undecidable

4/1/2020 CS332 ‐ Theory of Computation 32

Page 33: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Give a nonregular language  such thator prove that none exists

4/1/2020 CS332 ‐ Theory of Computation 33

mbun
Pencil
Page 34: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Give an undecidable language  such thator prove that none exists

4/1/2020 CS332 ‐ Theory of Computation 34

mbun
Pencil
mbun
Pencil
mbun
Pencil
mbun
Pencil
Page 35: Lecture 17 - Boston University · Lecture 17: • Midterm II review Reading: Sipser Ch 3.1‐5.1, 5.3 Mark Bun March 30, 2020. Format of the Exam 4/1/2020 CS332 ‐Theory of Computation

Give an undecidable language  such thator prove that none exists

4/1/2020 CS332 ‐ Theory of Computation 35

mbun
Pencil