Problem:
I need to show that the following language is decidable and if not, if $S$ or $\overline{S}$ is partialy decidable language.
$S=\{w_e\;|\;|L(M_e)|\leq 10\}$
That is set of all Turing machine codes of TMs accepting languages of cardinality $\leq 10$.
So far:
I already know that in order to finish this exercise, I need to show that S is not recursive and I can show it by showing $S$ or $\overline{S}$ is not semidecidable. (Post theorem)
However, I am not sure how to start, since i only intuitively know that we cannot "count" the size of language by looking on TM code.
How should I formalize this?
You can reduce the Halting Problem to this problem. For each integer $e$ let $M_e$ be the $e$-th Turing machine, and let $\varphi_e$ be the partial function it computes. We write $\varphi_e(x)\downarrow$ iff $M_e$ halts on input $x$ ($M_e$ accepts $x$), otherwise we write $\varphi_e(x)\uparrow$.
Let $K = \{e\mid \varphi_e(e)\downarrow\}$, so $K$ is the set of all (codes $e$ of) Turing machines which halt on the code for themselves. $K$ is semidecidable, and not decidable.
Let $S = \{e\mid \varphi_i(x)\downarrow \text{ for at most $10$ $x$'s}\}$.
$S$ is not decidable
Define a reduction $f\colon K\to S$ as follows: $f(e)$ is the code for a Turing machine which on input x behaves in this way:
Clearly,
Thus if $S$ were decidable, then $K$ would be decidable.
$\overline{S}$ is semi-decidable
$\overline{S}$ is the set of all codes for TMs which halt on 11 or more inputs. There is a TM which on input $e$ computes the following program:
If $M_e$ accepts $11$ or more $x$'s, let the first $11$ be $x_0 < x_1 < \dotsc < x_{10}$. Let $s_i$ be the number of steps $M_e$ takes to halt on input $x_i$, and let $s = \max(x_{10}, s_0, \dotsc, s_{10})$. Then when the program variable
sequals $s$,countwill reach $11$ and the above algorithm will halt, accepting $e$. Conversely, if the above algorithm halts/returns True on inpute, then clearly $M_e$ accepts at least $11$ inputs.