Uploaded by Hieu Nguyen

CS 301 - Lecture Slides 24 - Reducibility (I) (Notes)

advertisement
Reducibility (I)
CS 301. Languages and Automata
© 2025 by Gonzalo A. Bello
11/14/2025
CS 301 - Lecture 24: Reducibility (I)
1
Reducibility
Introduction (I)
• A reduction is a way of converting a problem 𝐴 into a problem 𝐡
such that a solution to problem 𝐡 can be used to solve problem 𝐴.
Reduces to
𝑨
𝑩
Solves
• Example:
• Let 𝐴 be the problem of finding your way around a city.
• Let 𝐡 be the problem of obtaining a map of the city.
• If I can obtain a map of the city (i.e., if I can solve problem 𝑩), then I can use
this map to find my way around the city (i.e., then I can solve problem 𝑨).
• Therefore, 𝐴 reduces to 𝐡 or 𝐴 is reducible to 𝐡.
11/14/2025
CS 301 - Lecture 24: Reducibility (I)
2
Reducibility
Introduction (II)
• Another example:
Suppose Mary wants
a pet dragon
If Mary finds a dragon
shop, she can get
a pet dragon
Therefore, the problem of
getting a pet dragon
reduces to the problem
of finding a dragon shop
Source: Undecidable Problems (2020)
11/14/2025
CS 301 - Lecture 24: Reducibility (I)
3
Reducibility
Introduction (III)
• Suppose 𝐴 is reducible to 𝐡.
• If 𝐡 is decidable, then 𝐴 is also decidable.
• Example:
• If I can obtain a map of the city (𝐡 is decidable), then I can find my way
around the city (𝐴 is decidable).
• How can we prove that a problem is decidable?
• Show that it reduces to a problem already known to be decidable.
To prove that π‘·π’π’†π’˜ is decidable,
show that π‘·π’π’†π’˜ reduces to π‘·π’Œπ’π’π’˜π’
where π‘·π’Œπ’π’π’˜π’ is decidable
• Example:
We proved that 𝐴𝑁𝐹𝐴 is decidable by showing that it reduces to 𝐴𝐷𝐹𝐴 ,
which was already known to be decidable.
11/14/2025
CS 301 - Lecture 24: Reducibility (I)
4
Reducibility
Introduction (IV)
• Suppose 𝐴 is reducible to 𝐡.
• If 𝐴 is undecidable, then 𝐡 is also undecidable.
• Example:
• If I cannot find my way around the city (𝐴 is undecidable), then I cannot
obtain a map of the city (𝐡 is undecidable).
• How can we prove that a problem is undecidable?
• Show that a problem already known to be undecidable reduces to it.
To prove that π‘·π’π’†π’˜ is undecidable,
show that π‘·π’Œπ’π’π’˜π’ reduces to π‘·π’π’†π’˜
where π‘·π’Œπ’π’π’˜π’ is undecidable
Which problem is known to be undecidable?
11/14/2025
CS 301 - Lecture 24: Reducibility (I)
5
Reducibility
Introduction (V)
• Another example:
If Mary finds a dragon shop,
she can get a pet dragon
Dragons do not exist (i.e., the
problem of getting a pet
dragon is undecidable).
Therefore, dragon shops can
also not exist (i.e., the problem
of finding a dragon shop is also
undecidable).
Source: Undecidable Problems (2020)
11/14/2025
CS 301 - Lecture 24: Reducibility (I)
6
Reducibility
Exercise 24.1
If 𝑨 is reducible to 𝑩 and 𝑨 is undecidable,
we can conclude that 𝑩 is also undecidable.
A.
B.
True
False
If 𝑨 is reducible to 𝑩 and 𝑨 is decidable,
we can conclude that 𝑩 is also decidable.
A.
11/14/2025
B.
True
CS 301 - Lecture 24: Reducibility (I)
False
7
Reducibility
Example: 𝑯𝑨𝑳𝑻𝑻𝑴 (I)
• Example: 𝐻𝐴𝐿𝑇𝑇𝑀 =
𝑀, 𝑀
𝑀 is a TM that halts on input 𝑀}.
• The halting problem is the problem of determining whether a TM halts (by
accepting or rejecting) on a given input.
How can we prove that 𝑯𝑨𝑳𝑻𝑻𝑴 is undecidable?
• Proof by contradiction:
• Assume that 𝐻𝐴𝐿𝑇𝑇𝑀 is decidable.
• Show that 𝐴 𝑇𝑀 is reducible to 𝐻𝐴𝐿𝑇𝑇𝑀 .
• Since 𝐻𝐴𝐿𝑇𝑇𝑀 is decidable and 𝐴 𝑇𝑀 is reducible to 𝐻𝐴𝐿𝑇𝑇𝑀 , then 𝐴 𝑇𝑀
is also decidable.
• But 𝐴 𝑇𝑀 is undecidable. This is a contradiction.
• Therefore, 𝐻𝐴𝐿𝑇𝑇𝑀 must be undecidable.
How can we reduce 𝑨𝑻𝑴 to 𝑯𝑨𝑳𝑻𝑻𝑴 ?
• Assume that we have a TM 𝑅 that decides 𝐻𝐴𝐿𝑇𝑇𝑀 .
• Use 𝑅 to construct a TM 𝑆 that decides 𝐴 𝑇𝑀 .
11/14/2025
CS 301 - Lecture 24: Reducibility (I)
8
Reducibility
Example: 𝑯𝑨𝑳𝑻𝑻𝑴 (II)
• Example: 𝐻𝐴𝐿𝑇𝑇𝑀 =
𝑀, 𝑀
𝑀 is a TM that halts on input 𝑀}.
How can we reduce 𝑨𝑻𝑴 to 𝑯𝑨𝑳𝑻𝑻𝑴 ?
• Use 𝑅 to construct a TM 𝑆 that decides 𝐴 𝑇𝑀 .
𝑺 = “On input 𝑴, π’˜ :
Is 𝑺 a decider?
1. Run TM 𝑹 that decides 𝑯𝑨𝑳𝑻𝑻𝑴 on input 𝑴, π’˜ .
2. If 𝑹 rejects, _____________________
3. If 𝑹 accepts, run 𝑴 on input π’˜.
4. If 𝑴 accepts, ____________________
5. If 𝑴 rejects, _____________________”
𝑆
𝑀
𝑀
11/14/2025
𝑅
Accept
𝑀
Reject
CS 301 - Lecture 24: Reducibility (I)
Accept
Reject
9
Reducibility
Example: 𝑯𝑨𝑳𝑻𝑻𝑴 (III)
• Example: 𝐻𝐴𝐿𝑇𝑇𝑀 =
𝑀, 𝑀
𝑀 is a TM that halts on input 𝑀}.
How can we prove that 𝑯𝑨𝑳𝑻𝑻𝑴 is undecidable?
• Proof (by contradiction):
• Assume that 𝐻𝐴𝐿𝑇𝑇𝑀 is decidable. Let 𝑅 be a TM that decides 𝐻𝐴𝐿𝑇𝑇𝑀 .
• Construct a TM 𝑆 that decides 𝐴 𝑇𝑀 as follows.
𝑺 = “On input 𝑴, π’˜ :
1. Run TM 𝑹 that decides 𝑯𝑨𝑳𝑻𝑻𝑴 on input 𝑴, π’˜ .
2. If 𝑹 rejects (𝑴 does not halt on π’˜), reject.
3. If 𝑹 accepts (𝑴 halts on π’˜), run 𝑴 on input π’˜.
4. If 𝑴 accepts, accept. If 𝑴 rejects, reject.”
• If 𝑴 accepts π’˜, then 𝑀 halts on 𝑀, so 𝑅 and 𝑀 accept and 𝑺 accepts.
• If 𝑴 does not accept π’˜, then either 𝑀 does not halt on 𝑀 or 𝑀 rejects 𝑀, so either
𝑅 or 𝑀 rejects and 𝑺 rejects.
• 𝑆 always halts because 𝑅 always halts and we only run 𝑀 if it halts.
• Then, 𝐴 𝑇𝑀 is decidable. But 𝐴 𝑇𝑀 is undecidable. This is a contradiction.
• Therefore, 𝐻𝐴𝐿𝑇𝑇𝑀 must be undecidable.
11/14/2025
CS 301 - Lecture 24: Reducibility (I)
10
Reducibility
References
• Michael Sipser. Introduction to the Theory of Computation.
11/14/2025
CS 301 - Lecture 24: Reducibility (I)
11
Download