Turing machine for any language

839 Views Asked by At

I am trying to prove that for any language over an alphabet there is a

a) Turing machine which halts on all inputs and if it accepts a string, then it is in our language $L$

b) There is a Turing machine which halts on all inputs and if it rejects a string, then the string is not in our language $L$

c) There is a Turing machine which if it accepts a string, then it is in our language $L$ and if it rejects a string then the string is not in $L$

Here are my thoughts:

For a) I am thinking that our Turing machine can have a pathway for every string in the language and accept and clear when it reaches the end of any string in the language. Otherwise it rejects. I can't think of a canonical way to formulate this machine for any language though. Any tips?

Also I know that b) is the complement of a) and c) is a decider that can loop. Are there any canonical ways to come up with a decider for a language?

1

There are 1 best solutions below

0
On BEST ANSWER

The condition in a) is satisfied by a TM that halts immediately and doesn't accept anything.

The condition in b) is satisfied by a TM that halts immediately and accepts everything.

As for c), if 'reject' means 'halts but does not accept', then a TM that doesn't halt on any input will suffice. If 'reject' means 'halts but does not accept, or does not halt at all', then such a TM must accept a word if and only if it is in $L$. This is impossible:

If, given a language $L$, such a Turing machine $M_L$ can always be found, then by definition $L$ is the language accepted by $M_L$. There are only countably many Turing machines, but uncountably many languages over any given alphabet, so there exist some languages that are not accepted by any Turing machine.