Describe in English a Turing machine that semidecides the following language - Is this solution correct?

803 Views Asked by At

The language being L, which is described as follows:

$L$ = { $<M>$ | $M$ accepts the binary encodings of at least 4 odd numbers } .

My solution:

M generates the binary encodings in $\Sigma_M*$ in ascending order and uses dovetailing to interleave the computation of M on those binary encodings. As soon as four computations accept, M halts and accepts.

Is this correct? What corrections would have to be made if not? I am not sure if I am providing enough details in my solution which may cause it to be incorrect.

1

There are 1 best solutions below

10
On

Let $$ L = \{ \langle M \rangle \mid M \text{ accepts the binary code of at least } 4 \text{ odd numbers} \} $$

Now construct a Turing machine $N$ such that

  1. $N$, on input $I$, checks whether $I = \langle M \rangle$ for some Turing machine $M$. If not, stop and reject.
  2. If $I = \langle M \rangle$ for some Turing machine $M$, $N$ runs $M$ on the binary codes of all odd numbers. More precisely, $N$ has two phases between which it alternates. During the first phase it writes down the least odd number that it hasn't run $M$ on yet (for at least one step). Then it runs $M$ on all numbers it has written down thus far for $1$ step (or any other finite number of steps). $N$ accepts $I$ if it passes our test in item 1. and $M$ accepts (at any point during $N$'s run) the binary code of $4$ odd numbers.