SlideShare a Scribd company logo
1 of 26
EECS 2001: Introduction to the
Theory of Computation
Muhammad Umair Khan
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}
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
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
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.
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โŸฉ.
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
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โŸฉ
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
โ€ฆ
โ€ฆ
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
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
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
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 ???
??
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)
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
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
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
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
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
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.
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
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
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
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
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)
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

More Related Content

Similar to Winter 10 Lecture 2 ATM Undecidability - Formal Proof.pptx

Winter 11 Tutorial Reducibility.pptx
Winter 11 Tutorial Reducibility.pptxWinter 11 Tutorial Reducibility.pptx
Winter 11 Tutorial Reducibility.pptx
HarisPrince
ย 
Theory of computation homework help
Theory of computation homework helpTheory of computation homework help
Theory of computation homework help
Assignmentpedia
ย 
Winter 9 Decidability.pptx
Winter 9 Decidability.pptxWinter 9 Decidability.pptx
Winter 9 Decidability.pptx
HarisPrince
ย 
Undecidability.pptx
Undecidability.pptxUndecidability.pptx
Undecidability.pptx
PEzhumalai
ย 
Winter 10 Undecidability.pptx
Winter 10 Undecidability.pptxWinter 10 Undecidability.pptx
Winter 10 Undecidability.pptx
HarisPrince
ย 

Similar to Winter 10 Lecture 2 ATM Undecidability - Formal Proof.pptx (20)

lect_23.pdf
lect_23.pdflect_23.pdf
lect_23.pdf
ย 
Winter 11 Tutorial Reducibility.pptx
Winter 11 Tutorial Reducibility.pptxWinter 11 Tutorial Reducibility.pptx
Winter 11 Tutorial Reducibility.pptx
ย 
Theory of computation homework help
Theory of computation homework helpTheory of computation homework help
Theory of computation homework help
ย 
slides3.pdf
slides3.pdfslides3.pdf
slides3.pdf
ย 
Winter 9 Decidability.pptx
Winter 9 Decidability.pptxWinter 9 Decidability.pptx
Winter 9 Decidability.pptx
ย 
Chapter 7 Undecidable Reducible_Theory_of_Computation.ppt
Chapter 7 Undecidable Reducible_Theory_of_Computation.pptChapter 7 Undecidable Reducible_Theory_of_Computation.ppt
Chapter 7 Undecidable Reducible_Theory_of_Computation.ppt
ย 
Undecidability.pptx
Undecidability.pptxUndecidability.pptx
Undecidability.pptx
ย 
practice-final-soln.pdf
practice-final-soln.pdfpractice-final-soln.pdf
practice-final-soln.pdf
ย 
Winter 10 Undecidability.pptx
Winter 10 Undecidability.pptxWinter 10 Undecidability.pptx
Winter 10 Undecidability.pptx
ย 
class16.ppt
class16.pptclass16.ppt
class16.ppt
ย 
Theory of Computer Science - Post Correspondence Problem
Theory of Computer Science - Post Correspondence ProblemTheory of Computer Science - Post Correspondence Problem
Theory of Computer Science - Post Correspondence Problem
ย 
The complexity of promise problems with applications to public-key cryptography
The complexity of promise problems with applications to public-key cryptographyThe complexity of promise problems with applications to public-key cryptography
The complexity of promise problems with applications to public-key cryptography
ย 
Unit v
Unit vUnit v
Unit v
ย 
hghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggghghghghhghghgggggggggggggggggggggggggggggggggg
hghghghhghghgggggggggggggggggggggggggggggggggg
ย 
Applied Graph Theory Applications
Applied Graph Theory ApplicationsApplied Graph Theory Applications
Applied Graph Theory Applications
ย 
Godels First Incompleteness Theorem
Godels First Incompleteness TheoremGodels First Incompleteness Theorem
Godels First Incompleteness Theorem
ย 
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
QMC Program: Trends and Advances in Monte Carlo Sampling Algorithms Workshop,...
ย 
Common fixed point theorems for contractive maps of
Common fixed point theorems for contractive maps ofCommon fixed point theorems for contractive maps of
Common fixed point theorems for contractive maps of
ย 
NP completeness
NP completenessNP completeness
NP completeness
ย 
chapter 2.pptx
chapter 2.pptxchapter 2.pptx
chapter 2.pptx
ย 

Recently uploaded

VIP Call Girls Valsad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Valsad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Valsad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Valsad 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
ย 
Green Marketing
Green MarketingGreen Marketing
Green Marketing
Dr. Salem Baidas
ย 
VVIP Pune Call Girls Wagholi WhatSapp Number 8005736733 With Elite Staff And ...
VVIP Pune Call Girls Wagholi WhatSapp Number 8005736733 With Elite Staff And ...VVIP Pune Call Girls Wagholi WhatSapp Number 8005736733 With Elite Staff And ...
VVIP Pune Call Girls Wagholi WhatSapp Number 8005736733 With Elite Staff And ...
SUHANI PANDEY
ย 
Call Now โ˜Ž Russian Call Girls Connaught Place @ 9899900591 # Russian Escorts ...
Call Now โ˜Ž Russian Call Girls Connaught Place @ 9899900591 # Russian Escorts ...Call Now โ˜Ž Russian Call Girls Connaught Place @ 9899900591 # Russian Escorts ...
Call Now โ˜Ž Russian Call Girls Connaught Place @ 9899900591 # Russian Escorts ...
kauryashika82
ย 
Contact Number Call Girls Service In Goa 9316020077 Goa Call Girls Service
Contact Number Call Girls Service In Goa  9316020077 Goa  Call Girls ServiceContact Number Call Girls Service In Goa  9316020077 Goa  Call Girls Service
Contact Number Call Girls Service In Goa 9316020077 Goa Call Girls Service
sexy call girls service in goa
ย 
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 8005736733 Cal...
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 8005736733 Cal...Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 8005736733 Cal...
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 8005736733 Cal...
SUHANI PANDEY
ย 
VIP Model Call Girls Viman Nagar ( Pune ) Call ON 8005736733 Starting From 5K...
VIP Model Call Girls Viman Nagar ( Pune ) Call ON 8005736733 Starting From 5K...VIP Model Call Girls Viman Nagar ( Pune ) Call ON 8005736733 Starting From 5K...
VIP Model Call Girls Viman Nagar ( Pune ) Call ON 8005736733 Starting From 5K...
SUHANI PANDEY
ย 

Recently uploaded (20)

Call Girls Jejuri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Jejuri Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Jejuri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Jejuri Call Me 7737669865 Budget Friendly No Advance Booking
ย 
VIP Call Girls Valsad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Valsad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Valsad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Valsad 7001035870 Whatsapp Number, 24/07 Booking
ย 
Call Girls Ramtek Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Ramtek Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Ramtek Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Ramtek Call Me 7737669865 Budget Friendly No Advance Booking
ย 
Call On 6297143586 Pimpri Chinchwad Call Girls In All Pune 24/7 Provide Call...
Call On 6297143586  Pimpri Chinchwad Call Girls In All Pune 24/7 Provide Call...Call On 6297143586  Pimpri Chinchwad Call Girls In All Pune 24/7 Provide Call...
Call On 6297143586 Pimpri Chinchwad Call Girls In All Pune 24/7 Provide Call...
ย 
The Most Attractive Pune Call Girls Shirwal 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Shirwal 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Shirwal 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Shirwal 8250192130 Will You Miss This Cha...
ย 
BOOK Call Girls in (Dwarka) CALL | 8377087607 Delhi Escorts Services
BOOK Call Girls in (Dwarka) CALL | 8377087607 Delhi Escorts ServicesBOOK Call Girls in (Dwarka) CALL | 8377087607 Delhi Escorts Services
BOOK Call Girls in (Dwarka) CALL | 8377087607 Delhi Escorts Services
ย 
Call Girls Talegaon Dabhade Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Talegaon Dabhade Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Talegaon Dabhade Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Talegaon Dabhade Call Me 7737669865 Budget Friendly No Advance Boo...
ย 
Call Girls In Okhla DELHI ~9654467111~ Short 1500 Night 6000
Call Girls In Okhla DELHI ~9654467111~ Short 1500 Night 6000Call Girls In Okhla DELHI ~9654467111~ Short 1500 Night 6000
Call Girls In Okhla DELHI ~9654467111~ Short 1500 Night 6000
ย 
DENR EPR Law Compliance Updates April 2024
DENR EPR Law Compliance Updates April 2024DENR EPR Law Compliance Updates April 2024
DENR EPR Law Compliance Updates April 2024
ย 
Call Girls Moshi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Moshi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Moshi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Moshi Call Me 7737669865 Budget Friendly No Advance Booking
ย 
Green Marketing
Green MarketingGreen Marketing
Green Marketing
ย 
Book Sex Workers Available Pune Call Girls Kondhwa 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Kondhwa  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Kondhwa  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Kondhwa 6297143586 Call Hot India...
ย 
VVIP Pune Call Girls Wagholi WhatSapp Number 8005736733 With Elite Staff And ...
VVIP Pune Call Girls Wagholi WhatSapp Number 8005736733 With Elite Staff And ...VVIP Pune Call Girls Wagholi WhatSapp Number 8005736733 With Elite Staff And ...
VVIP Pune Call Girls Wagholi WhatSapp Number 8005736733 With Elite Staff And ...
ย 
Call Now โ˜Ž Russian Call Girls Connaught Place @ 9899900591 # Russian Escorts ...
Call Now โ˜Ž Russian Call Girls Connaught Place @ 9899900591 # Russian Escorts ...Call Now โ˜Ž Russian Call Girls Connaught Place @ 9899900591 # Russian Escorts ...
Call Now โ˜Ž Russian Call Girls Connaught Place @ 9899900591 # Russian Escorts ...
ย 
Call Girls Budhwar Peth Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Budhwar Peth Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Budhwar Peth Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Budhwar Peth Call Me 7737669865 Budget Friendly No Advance Booking
ย 
Call Girls Magarpatta Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Magarpatta Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Magarpatta Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Magarpatta Call Me 7737669865 Budget Friendly No Advance Booking
ย 
Contact Number Call Girls Service In Goa 9316020077 Goa Call Girls Service
Contact Number Call Girls Service In Goa  9316020077 Goa  Call Girls ServiceContact Number Call Girls Service In Goa  9316020077 Goa  Call Girls Service
Contact Number Call Girls Service In Goa 9316020077 Goa Call Girls Service
ย 
NO1 Verified kala jadu karne wale ka contact number kala jadu karne wale baba...
NO1 Verified kala jadu karne wale ka contact number kala jadu karne wale baba...NO1 Verified kala jadu karne wale ka contact number kala jadu karne wale baba...
NO1 Verified kala jadu karne wale ka contact number kala jadu karne wale baba...
ย 
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 8005736733 Cal...
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 8005736733 Cal...Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 8005736733 Cal...
Call Girls Service Pune โ‚น7.5k Pick Up & Drop With Cash Payment 8005736733 Cal...
ย 
VIP Model Call Girls Viman Nagar ( Pune ) Call ON 8005736733 Starting From 5K...
VIP Model Call Girls Viman Nagar ( Pune ) Call ON 8005736733 Starting From 5K...VIP Model Call Girls Viman Nagar ( Pune ) Call ON 8005736733 Starting From 5K...
VIP Model Call Girls Viman Nagar ( Pune ) Call ON 8005736733 Starting From 5K...
ย 

Winter 10 Lecture 2 ATM Undecidability - Formal Proof.pptx

  • 1. EECS 2001: Introduction to the Theory of Computation Muhammad Umair Khan
  • 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