This document discusses undecidability and Turing recognizability. It begins by introducing the acceptability problem (ATM) and uses diagonalization to prove it is undecidable. It shows that while ATM is Turing recognizable, its complement is not, meaning ATM cannot be decided. It then proves that the set of Turing recognizable languages is countable but the set of all languages is uncountable.
2. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
2
๏ฝ Is there a problem that cannot be solved?
๏ฝ Un-solvable Problem 2
๏ฝ If we are given a TM and an input string, can a machine be made
which decides whether the string is accepted by the given TM
ATM = {โจM,wโฉ| M is a TM and M accepts w}
3. Un-Decidability - RECAP
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
3
๏ฝ Set of all strings โ* is countable
๏ฝ Set of TMs is countable
๏ฝ Because โ is uncountable, the set of infinite binary sequences
(B) is also uncountable
๏ฝ If set of all languages over the alphabet โ is L
๏ฝ Then there is a correspondence between L and B, and hence
๏ฝ Hence the set of all languages L over the alphabet โ is also
uncountable
4. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
4
ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ Formal proof
๏ฝ Assume that ATM is decidable
๏ฝ Suppose there is a TM named H which is a decider for ATM
๏ฝ When, (M, w) is provided to H (M is a TM and w is a string
which the TM M can accept or reject). The TM H functions as
follows
๏ฝ H halts and accept if M accepts w
๏ฝ H halts and rejects if M rejects w
5. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
5
ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ Formal proof (continued)
๏ฝ Suppose D is another TM
๏ฝ Takes the description of the TM M (represented as โจMโฉ) as input
๏ฝ D uses H as a subroutine
๏ฝ D checks what M does when it is given its own description (โจMโฉ)
๏ฝ Note, M is supposed to be given a string w, however, โจMโฉ is also a string
(representing M).
๏ฝ When the result is available, D does the exact opposite of H
๏ฝ When H accepts, D rejects. When H rejects, D accepts.
6. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
6
ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ Formal proof (continued)
๏ฝ Let us look at โWhen H accepts, D rejects. When H rejects,
D acceptsโ.
๏ฝ What is D getting? โจMโฉ
๏ฝ What is H getting? (M, w) = โจM, โจMโฉโฉ
๏ฝ This means that if M accepts โจMโฉ, then D rejects โจMโฉ. If M
rejects โจMโฉ, then D accepts โจMโฉ.
7. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
7
ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ Formal proof (continued)
๏ฝ This means that if M accepts โจMโฉ, then D rejects โจMโฉ. If M
rejects โจMโฉ, then D accepts โจMโฉ.
๏ฝ Now, let us give the TM D, โจDโฉ
๏ฝ Simply replacing M with D in the above statement
๏ฝ If D accepts โจDโฉ, then D rejects โจDโฉ. If D rejects โจDโฉ, then D accepts
โจDโฉ.
๏จ CONTRADICTION
๏จ Hence a TM which decides the language ATM cannot exist
8. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
8
ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ Summary of above discussion
๏ฝ Build a TM H
๏ฝ Build a TM D which includes H
๏ฝ D takes as input the description of a TM, e.g., โจMโฉ
๏ฝ this input is provided to another TM M residing inside H
๏ฝ If M reject โจMโฉ, D accepts
๏ฝ If M accepts โจMโฉ, D rejects
๏ฝ Run D on itself
๏ฝ The operation of the whole setup follows this sequence:
๏ฝ H accepts โจM, wโฉ when M accepts w, note, in our case w is โจMโฉ
๏ฝ D rejects โจMโฉ when M accepts โจMโฉ,
๏ฝ D rejects โจDโฉ when D accepts โจDโฉ
9. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
9
ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ Using diagonalization (another way to look at the same problem)
๏ฝ Let us make a table showing the behavior of H and D. Suppose there are
many TMs (TM1, TM2, TM3, โฆ.
๏ฝ These TMs can have any function (maybe they accept some TM or maybe
not). The below table is one example. Remember, we are not talking about
specific TMs โจM1โฉ โจM2โฉ โจM3โฉ โฆ โฆ
M1 Y Y Y
M2 Y N N
M3 N N N
M4
โฆ
โฆ
10. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
10
ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ Using diagonalization
๏ฝ Let us add TM D to our table.
๏ฝ D is also a TM and deserves a place in the table.
โจM1โฉ โจM2โฉ โจM3โฉ โฆ โฆ โจDโฉ
M1 Y Y Y
M2 Y N N
M3 N N N
M4
โฆ
โฆ
D
11. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
11
ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ Using diagonalization
๏ฝ What is the function of D?
๏ฝ Output the opposite of M
โจM1โฉ โจM2โฉ โจM3โฉ โฆ โฆ โจDโฉ
M1 Y Y Y
M2 Y N N
M3 N N N
M4
โฆ
โฆ
D N Y Y
12. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
12
ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ Using diagonalization
๏ฝ What is the function of D?
๏ฝ Output the opposite of M
๏ฝ Note that the result of D is the opposite of the diagonal
โจM1โฉ โจM2โฉ โจM3โฉ โฆ โฆ โจDโฉ
M1 Y Y Y
M2 Y N N
M3 N N N
M4
โฆ
โฆ
D N Y Y
13. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
13
ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ What is the function of D?
๏ฝ Output the opposite of M
๏ฝ Note that the result of D is the opposite of the diagonal
๏ฝ Question: what to put in the cell D, โจDโฉ - contradiction
โจM1โฉ โจM2โฉ โจM3โฉ โฆ โฆ โจDโฉ
M1 Y Y Y
M2 Y N N
M3 N N N
M4
โฆ
โฆ
D N Y Y ???
??
14. Un-Decidability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
14
Another problem
Look into the section 5.2.1 of the Anil Maheshwari and Michiel
Smid Book
Different problem, but the same argument is used to prove that
the language is undecidable (TM inside a TM inside a TM)
15. Turing Recognizable
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
15
๏ฝ If BOTH a language AND its complement are Turing
recognizable, then the language is decidable. In other words,
๏ฝ If a language is undecidable, then either the language is un-
recognizable or the languageโs complement is un-recognizable
๏ฝ Complement of a language L: all strings that do not belong to L
๏ฝ Side note: if a language Lโs complement is recognizable, we call L as
co-Turing-recognizable
๏ฝ Hence, a language is decidable iff it is Turing-recognizable and co-Turing-
recognizable
๏ฝ In other words, a language is decidable, if it and its complement are T
recognizable
16. Recognizable
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
16
๏ฝ Proof Part 1
๏ฝ If L is decidable
๏ฝ A TM will decide, and for it to decide it should recognize it, hence, a
decidable language is also recognizable. Also, complement of a decidable
language is also decidable
17. Recognizable
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
17
๏ฝ Proof Part 2
๏ฝ If both L and Lโ are recognizable,
๏ฝ Let M1 be the recognizer for L
๏ฝ Let M2 be the recognizer for Lโ
๏ฝ Let M be a decider for L
๏ฝ M takes w as input
๏ฝ Runs M1 and M2 in parallel (two tapes) on w
๏ฝ If M1 accepts, accept. If M2 accepts, reject
18. Recognizable
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
18
๏ฝ Will M decide? All the time?
๏ฝ Every string is either in L or Lโ
๏ฝ Definition of complement
๏ฝ Therefore, M either accepts or rejects
๏ฝ There is always a decision
๏ฝ Therefore M is a decider and L is decidable
19. Recognizable
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
19
๏ฝ ATM is Turing recognizable but not decidable
๏ฝ However, ATMโ is not Turing recognizable
๏ฝ If it were, then ATM would be decidable
๏ฝ And we have already proved that ATM is not decidable
20. Recognizable
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
20
๏ฝ ATM is Turing recognizable but not decidable
๏ฝ Proof
๏ฝ The following Turing machine U recognizes ATM.
๏ฝ 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 .โ
๏ฝ Note that this machine loops on input โจM,wโฉ if M loops on w,
which is why this machine does not decide ATM. If the
algorithm had someway to determine that M was not halting on
w, it could reject in this case. However, an algorithm has no
way to make this determination.
21. Recognizability example
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
21
๏ฝ Finding the integral root of a polynomial
๏ฝ Suppose the TM to find the integral root is called TMI
๏ฝ If the polynomial has an integral root, then TMI can find it
๏ฝ If the polynomial does not have an integral root, then TMI will either say
not found or not terminate at all
22. Recognizability example
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
22
๏ฝ ATM = {โจM,wโฉ| M is a TM and M accepts w}
๏ฝ Let X be a TM which takes as input โจM,wโฉ
๏ฝ The operation of X will be as follows
๏ฝ X will run M on w, and
๏ฝ if M ends up in the accept state, X will accept
๏ฝ Else, X rejects (if M rejects) or does not terminate at all
23. Recognizability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
23
๏ฝ Let us prove that: The set of recognizable languages is countable
๏ฝ Remember that each language is a set of strings
๏ฝ Also remember that a TM is an encoding of specific strings
๏ฝ Hence each TM would be different from all other TMs (if it accepts a
unique language)
๏ฝ Let us represent the TMโs description in binary form
๏ฝ Each description would be different from the description of other TMs
๏ฝ Let C be the set of all the binary string that are representations of
descriptions of TM for those languages that are recognizable
๏ฝ Now, if we prove that C is countable, then we can say that the set of
recognizable language is countable
24. Recognizability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
24
๏ฝ Let us prove that: The set of recognizable languages is countable
๏ฝ Is C countable?
๏ฝ For every integer n, there are 2n strings of length n in C
๏ฝ Similar to when we were proving whether the set of TMs is countable
(Lecture on Nov 15 โ Slide 24)
๏ฝ The set C is countable and hence the set of recognizable languages is
countable
25. Recognizability
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
25
๏ฝ Let us prove that: The set of ALL languages is uncountable
๏ฝ Already proved (infinite binary sequences)
26. References
Fall 2021 - EECS 2001 Dr. M. U. Khan Introduction to Theory of
Computation
26
Ideas, problems and their solutions in this lecture/tutorial have been taken from
โข Prof. Jeffery Edmondsโ Lecture notes for EECS 2001 at York University
โข Prof. Suprakash Dattaโ Lecture notes for EECS 2001 at York University
โข Introduction to the Theory of Computation (3rd edition) by Michael Sipser
โข Introduction to Theory of Computation by Anil Maheshwari and Michiel Smid
โข Wikipedia and other webpages of different professors/universities