Definition. Reductions
[reductions]
Definition. Reductions [reductions]
Say we have two problems.
- Problem 1.
- Shoot a red elephant.
- Problem 2.
- Shoot a blue elephant.
We can say that reduces to if we can design an algorithm for solving that uses . The following are equivalent:
- reduces to
- can be solved in terms of
- can be solved using as a subroutine
IMPORTANT: Note the order! This is easy to flip-flop!
Given our original problems: this means that the problem of shooting a red elephant can be solved by shooting a blue elephant.
What else does this tell us?
- If is easy, then is easy
- If is hard, then is hard (we’ll use this idea a lot)
- is no harder than
- is at least as hard as
We can similarly talk about languages this way.
means:
- deciding is no harder than deciding , or
- deciding is at least as hard as deciding .
Example. Showing the Halting problem to be undecidable
Last time: is undecidable.
Recall: is recognizable
- You can create a Turing machine that takes an and simulate it: if halts, our original Turing machine accepts
We want to show that . Proof by contradiction:
- Suppose there is a Turing machine that decides (it doesn’t exist).
We want to use to design a Turing machine that decides . Design:
- Use to reject if the input runs forever
- Otherwise, simply simulate the input (it is now guaranteed to be decidable)
- So we can, and we do, and we arrive at a contradiction: as we know there is no such decider for .
Then as reduces to : is at least as hard as , which is undecidable. So is undecidable.
Aside: reduction can go both ways! reduces to , and vice versa. There are (probably) problems that cannot be related, however.
Example. Showing that is undecidable
We will show by reduction: by reducing to , i.e. show a Turing-machine for deciding that uses as a subroutine.
- (i.e. accepts nothing)
Proof: Assume we have a decider that decides . Idea: create a new Turing machine with hardcoded inside.
if y != w: rejectif y == w: then run on input- So the language is either or .
Simulating a Turing machine on input :
- if not of form then reject
- Construct the Turing-machine above
- Run on input
- If accepts, then we know does not accept
- If accepts, rejects, and if rejects, accepts.