1

$L = \{ <M> | |L(M)|=\infty \wedge |<M>|<k \}$, for some $k>1000$.

It seems to me that $L \notin RE \cup CoRE$, and I would like to prove it.

However, it seems that the classic reductions that receive $<M>$ and return some $<M'>$ that runs $M$ will not work, since the encodings in $L$ should be less long than $k$.
For example, if I'm trying to reduce from $L_{acc}$, I might get $<M,w>\in L_{acc}$ such that $<M>$ is longer that k, then if the reduction will construct $M'$ s.t. the encoding of $M$ is part of its encoding, $<M'>$ will also be longer than k.

To solve that, I looked into the usage of Universal TM, which can be encoded in fixed size.

Assuming $|<U>| < k$, in order to prove $L \notin CoRE$, my idea was to reduce $L_{acc}$ to $L$:
$f(<M,w>) = <U>$ s.t. $U$ is the Universal TM, and $<M,w>$ is written on its tape.
On a given input $x$, $U$ runs $M$ over $w$ and answers the same.

Then we get:
If $ <M,w> \in L_{acc}$, then $L(U)=\Sigma^*$ and also $|<U>|<k$, so $<U> \in L$.
If $ <M,w> \notin L_{acc}$, then $L(U)=\emptyset$, so $<U> \notin L$.

My questions about this solution:

  1. How can we guarantee that the encoding of the Universal TM is indeed less long than $k$ ?
  2. Can the reduction write something on the tape of the universal TM, without changing the length of its encoding?
Yuvi
  • 322
  • 1
  • 14

2 Answers2

1

We are given the language:

$$ L = \left\{ \langle M \rangle \mid |L(M)| = \infty \land |\langle M \rangle| < \langle k \rangle \right\}, \quad \text{for some } k > 1000. $$

Suppose $k = |L|$. Since $|\langle M \rangle| < k$, and the set of binary strings of length less than $k$ is finite, the set $L$ must also be finite. Specifically, there are at most $2^k$ strings of length $< k$, so:

$$ |L| \leq 2^k. $$

This finiteness has an important implication for decidability: if a language is finite, it is decidable. One can implement a decider that simply checks whether an input string is in a hardcoded list of accepted strings.

To make this more concrete, imagine implementing a decider in code (e.g., JavaScript-like pseudocode):

const acceptedMachines = [
  "<M1>",
  "<M2>",
  "<M3>",
  // ...
  "<Mt>"
];

function decidesL(input) { return acceptedMachines.includes(input); }

This function returns true if and only if the input string is a member of the finite set $L$.

So we conclude:

Since $L$ is a finite set, there are finitely many algorithms (at most $2^k$) that accept the elements of $L$. Therefore, $L$ is decidable by simple membership checking — conceptually similar to an array lookup.

1

The language $L$ is finite as it is contained in the language of words of length at most $k$, for some constant $k$. Therefore $L$ being finite implies that it is regular, in particular decidable. One way to see this is to simply look at it as the finite union $\bigcup_{w\in L} \{ w\}$ of regular languages: you can define an automaton $A_w$ recognizing the language $\{w\}$.

What confuses you I think is the difference between existence and computation. Note that $L$ being decidable essentially means that a Turing machine $M$ that decides it exists, and we don’t actually care whether you can “find” or “compute” $M$. To illustrate the difference between the notion of existence and the ability to suggest a specific algorithm, you can consider the following language $$ L = \{ w: \Sigma^*: \text{Bader’s cat is 2 years old}\}$$ Now my cat can be either 2 years old or not. In the former case, $L = \Sigma^*$ and thus decidable, and in the latter case, $L = \emptyset$ and thus decidable. So you can tell for sure that $L$ is decidable, although you cannot tell my cat’s age and “find” a description of a machine that decides $L$. In your question, we have a similar situation, the language $L$ is decidable since we know it is finite, regardless of whether we can tell whether a Turing machine whose description is of length at most $k$ recognizes an infinite language.

Bader Abu Radi
  • 5,494
  • 1
  • 11
  • 41