186k views
4 votes
Give an example of languages A and B where A, B, and (A - B) are all infinite languages, and A-B is decidable, but both A and B are not decidable. Explain. You can use the fact (proved in class) that ATM is an undecidable language, and make A and B be languages which are defined using ATM

Hint: Once you think about what the languages A and B are, then the facts above about A, B and A-B are pretty easy to see.

User Mike Allen
by
7.9k points

1 Answer

5 votes

Final answer:

Languages A and B can be defined using the language ATM. A is the language of Turing machines that accept a string in ATM, B is the language of Turing machines that do not accept any string in ATM. The language (A - B) is decidable, but both A and B are undecidable.

Step-by-step explanation:

Let's consider languages A and B:

  • A is the language of all Turing machines that accept a string in the language ATM (the language of all Turing machines that halt on an empty input). A is infinite because there are infinitely many Turing machines that accept strings in ATM.
  • B is the language of all Turing machines that do not accept any string in ATM. B is also infinite because there are infinitely many Turing machines that do not halt on an empty input.
  • The language (A - B) consists of all Turing machines that halt on an empty input but are not in language B. This language is decidable because we can construct a Turing machine M that simulates both a Turing machine accepting a string in ATM and a Turing machine not accepting any string in ATM. If M accepts, it means the input Turing machine belongs to (A - B), and if M rejects, it means the input Turing machine does not belong to (A - B).
  • A and B are not decidable because ATM (which is used in defining both A and B) is an undecidable language.
User Questioner
by
8.2k points