# Chapter 4: Decidability

## Chapter 4.2, Undecidability

### An Undecidable Problem

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

### Universal Turing Machine

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 its reject state, REJECT.

### Set Size

• Georg Cantor proposed that a set is countable if either (1) it is finite or (2) it has a correspondence with the set of natural numbers, N.
• Definition: A function that is both one-to-one and onto is a correspondence.
• The set of even numbers, E = {2, 4, 6, ...} is countable. What is the correspondence with the natural numbers, N?
• Counterintuitive note: Infinite sets E and N are considered to have the same size if there is a correspondance between the two.
• The set Q = { m/n | m, n ∈ N} is countable. What is the correspondence with the natural numbers?
• The set of real numbers, R, is uncountable. The proof is by contradiction. Assume R is countable and then show the correspondence fails using the diagonalization method.

### Implication of Set Size

• The set of strings Σ* is countable for any Σ.
• Turing Machines are countable. Page 206 provides details.
• Languages are uncountable. Page 206 provides details.
• Thus, there are some languages that can not be recognized by any TM!

### ATM is Undecidable

• Proof: Assume that ATM is decidable and find a contradiction.
• Create Turing Machine H(<M, w>) to ACCEPT if M accepts w and REJECT if M does not accept w.
• Create Turing Machine D that runs H on input <M, <M>>. D outputs REJECT if H accepts and ACCEPT if H rejects.
• Consider running D on itself. If D accepts, that means that D rejected <D>. If D rejects, that means that D accepted <D>. Contradiction!
• Figure 4.21 shows how this relates to the diagonalization technique.

### The complement of ATM is Unrecognizable

• Definition: A language is co-Turing-recognizable if it is the complement of a Turing-recognizable language.
• Theorem: A language is decidable iff it is Turing-recognizable and co-Turing-recognizable.
• Proof: ATM is Turing-recognizable. Therefore, the complement of ATM can not be Turing-recognizable. Otherwise ATM would be decidable.