# Lecture 11

## An Undecidable Problem

Definition $$A_{TM}=\{<M,w>:M$$ is a TM and accepts $$w\}$$.

Theorem $$A_{TM}$$ is recognizable.

Proof Let $$U$$ be the TM that

1. simulates $$M$$ on $$w$$.
2. accepts if $$M$$ ever reaches its accepting state, rejects if $$M$$ rejects.

Definition $$U$$ is known as a universal Turing machine.

Theorem $$A_{TM}$$ is undecidable.

Proof By contradiction, let $$H$$ be a TM that decides $$A_{TM}$$. Let $$D$$ be the TM that takes as input $$<M>$$ and

1. simulates $$H$$ on $$<M, <M> >$$
2. accepts if $$H$$ rejects, rejects if $$H$$ accepts

$$D$$ halts on every input. Does $$D$$ accept or reject $$<D>$$?

• $$D(<D>)$$ accepts if $$D(<D>)$$ rejects.
• $$D(<D>)$$ rejects if $$D(<D>)$$ accepts.

$$\Rightarrow\Leftarrow$$

$$<M_1>$$ $$<M_2>$$ ... $$<D>$$
$$M_1$$ accepts rejects ... ...
$$M_2$$ rejects rejects ... ...
... ... ... ... ...
$$D$$ rejects accepts ... ?

## Halting Problem

Definition $$HALT_{TM}=\{<M,w>:M$$ is a TM and halts on input $$w\}$$

Theorem $$HALT_{TM}$$ is undecidable.

Proof By contradiction, let $$H$$ be a TM that decides $$HALT_{TM}$$. Let $$T$$ be the TM that

1. Call $$H$$ as subroutine on $$<M,w>$$
2. If $$H$$ rejects, $$T$$ rejects also
3. If $$H$$ accepts, simulate $$M$$ on $$w$$ and return same answer.

then $$T$$ decides $$A_{TM}$$ $$\Rightarrow\Leftarrow$$.

### Emptiness Problem

Definition $$EMPTY_{TM}=\{<M>:L(M)=\emptyset\}$$

Definition $$L(M)=\{w\in\Sigma^*:M$$ accepts $$w\}$$ (languages recognized by $$M$$)

Theorem $$EMPTY_{TM}$$ is undecidable

Proof By contradiction, assume $$E$$ is a TM that decides $$EMPTY_{TM}$$.

Let $$T$$ be a Tm that takes in $$<M,w>$$ as input.

1. $$T$$ builds $$M'$$ that on input $$x\in\Sigma^*$$
1. checks that $$x=w$$, if not it rejects
2. If $$x=w$$, $$M'$$ simulates $$M$$ on $$x$$
2. Call $$E$$ on $$<M'>$$
1. accepts if $$E$$ rejects
2. rejects if $$E$$ accepts

(Observation: $$L(M')=\{w\}$$ if $$M$$ accepts $$w$$, $$L(M')=\emptyset$$ otherwise)

$$T$$ decides $$A_{TM}$$ $$\Rightarrow\Leftarrow$$

### Equality Problem

Definition $$EQ_{TM}=\{<M_1,M_2>:L(M_1)=L(M_2)\}$$

Theorem $$EQ_{TM}$$ is undecidable.

Proof Idea if $$EQ_{TM}$$ is decidable, then $$EMPTY_{TM}$$ is too.

### Rice's Theorem

Definition A property of languages of Turing machines is a subset of those languages.

E.g.

• being empty
• including some string $$w$$
• including only strings of even length
• being regular

Definition A property of languages of TMs is non-trivial if $$\exists M$$ such that $$L(M)$$ has property $$P$$ and $$\exists M$$ such that $$L(M')$$ does not have property $$P$$

Theorem For every non-trivial property $$P$$ of languages of TMs $$L_p=\{<M>:L(M)$$ has property $$P\}$$ is undecidable.