# Mapping reduction from $A_{TM}$ exercise

Let $L = \{\langle M \rangle \mid \text{M is a TM which accepts only the string "010"}\}$. Prove that $L$ is undecidable.

This is my solution, reducing $A_{TM}$ to $L$:

$R(\langle M,w \rangle)$ outputs $M'(x)$, such that:

if $(x == "010")$: run $M$ on $w$ and do on $x$ what $M$ does on $w$

else reject $x$

The language $L(M')=\{010\} \iff M$ accepts $w$. Is the mapping reduction well done? Thank you.

• Welcome to the site! That said, we typically don't like "check my result" questions, if for no other reason than the fact that the answer would be of no help to later viewers of your question. [By the way, your answer is correct, but you don't need the else clause.] – Rick Decker Dec 20 '16 at 18:39
• Thank you. Why I don't need the else clause? You mean it is superfluous? – MoreOver Dec 20 '16 at 18:53
• Correct. Try running $M'$ without the else clause. Running $M$ on $w$ will result in either (1) $M$ accepts $w$, in which case $L(M')=\{010\}$, (2) $M$ halts, but not in the accept state, in which case $M'$ will not accept anything (so you don't need the else clause), or (3) $M$ will run forever without entering the accept state, in which case you'll never get to the else part. – Rick Decker Dec 20 '16 at 19:20