Exercise 01
Let
Show that is decidable.
Construct is only strings with an odd number of ones. Construct . Now we can feed to
Exercise 02
Given: We have a theorem (Sipser 5.13) that . (You don’t need to prove this; Sipser has done it for us.)
Use this theorem to prove the following:
Let . Show that is undecidable.
Hint: use reduction and proof by contradiction
To prove that is undecidable, we will show that if it were decidable, then we could decide , which we know is undecidable.
-
We assume that there exists a Turing machine that decides .
-
We then construct a Turing machine that decides using as follows:
We are given a CFG and, we want to determine if .
- we construct CFG that generates (we make grammar that accepts all strings)
- we run on the pair
- If accepts, then , so accepts
- If rejects, then , so rejects
-
this means that for , it correctly decides . The problem, however, is that this contradicts the theorem that is undecidable.
-
And thus, this means that our initial assumption that exists is false. Therefore, must be undecidable
Exercise 03
Show that if is Turing-recognizable and , then is decidable. decidable.
We can show that is decidable by constructing a Turing machine that decides .
- We first must note that since is a Turing-recognizable language, there exists a Turing Machine that recognizes .
- Then, we can use the fact that to construct a Turing machine that decides as follows:
- Let be a computable mapping reduction such that
- On input , our Turing-Machine completes the following:
- Compute the
- Run on the input
- If accepts , then , which means , and thus rejects.
- If does not accept , then , which means , so accepts
- The TM always halts because it either accepts or rejects for any input . Therefore, is decidable.
Exercise 04
Recall what we’ve learned about relations.
Let be a binary relation on a set .
is reflexive if for all .
is symmetric if for all .
is transitive if for all
is an equivalence relation if is nonempty and is reflexive, symmetric and transitive.
We say language is mapping reducible to language , and we write , if there is some function such that
Show that the relation is transitive.