How can I create a mapping reduction from a decidable language to the halting problem and also prove it?

800 Views Asked by At

I have been tasked to create a mapping reduction from a decidable language to the Halting problem and also prove it. I'm absolutely stumped, any help is appreciated.

1

There are 1 best solutions below

2
On BEST ANSWER

I'm assuming that a mapping reduction is a computable function $f$ such that $x\in L$ iff $f(x) \in H$ (I know this as a many-one reduction). Tell me if you mean something different or if you don't understand the conventions I use below.

Fix your decidable language $L$, and the halting problem $H$. Let $P$ be the procedure that decides $L$, and let $Q$ be any procedure that never halts. We now define $f$:

On input $x$, compute $P(x)$. If $x\in H$, return the code for $P(x)$. If $x\notin H$, return the code for $Q(x)$.

Now, you need to show that $f$ is computable and that $x\in L$ iff $f(x)\in H$.