21

A set is countable if it has a bijection with the natural numbers, and is computably enumerable (c.e.) if there exists an algorithm that enumerates its members.

Any non-finite computably enumerable set must be countable since we can construct a bijection from the enumeration.

Are there any examples of countable sets that are not computably enumerable? That is, a bijection between this set and the natural numbers exists, but there is no algorithm that can compute this bijection.

Peter Olson
  • 357
  • 2
  • 11

4 Answers4

26

Are there any examples of countable sets that are not enumerable?

Yes. All subsets of the natural numbers are countable but not all of them are enumerable. (Proof: there are uncountably many different subsets of $\mathbb{N}$ but only countably many Turing machines that could act as enumerators.) So any subset of $\mathbb{N}$ that you already know is not recursively enumerable is an example – such as the set of all numbers coding Turing machines that halt for every input.

David Richerby
  • 82,470
  • 26
  • 145
  • 239
19

Yes, every undecidable (not semi-decidable) language has this property.

For example, consider the set $L = \{(x,M) \mid M \text{ does not halt on input } x \}$.

Suppose we have an algorithm that can enumerate the members of this set. If such an algorithm existed, we could use this to solve the halting problem with inputs $x,M$, with the following algorithm:

  • Alternate between running machine $M$ for $n$ steps on $x$, and enumerating the $n$th member of $L$.

$M$ either halts, or does not halt on $x$. If it halts, eventually we will find an $n$ where we reach a halting state. If it doesn't halt, then eventually we will reach $(M,x)$ in our enumeration.

Thus we have a reduction, and we can conclude that no such enumeration exists.

Note that such enumerations can exist for semi-decidable problems. For example, you can enumerate the set of all halting machine-input pairs by enumerating all possible traces of all Turing Machine executions after $n$ steps, and filter out ones that do not end in a halting state.

kasperd
  • 203
  • 1
  • 3
  • 10
Joey Eremondi
  • 30,277
  • 5
  • 67
  • 122
7

In computability theory we deal with subsets of $\Sigma^*$, where $\Sigma = \{0,1\}$. This language is countably infinite, and so any subset $L \subseteq \Sigma^*$ is countable. Furthermore, there are many undecidable but recursively enumerable languages whose complements are not recursively enumerable. These languages are subset of $\Sigma^*$ and hence are countable.

fade2black
  • 9,905
  • 2
  • 26
  • 36
2

I want to give another concrete example. The set of encodings of always halting Turing machines $R$ is countable (since there are only countably many Turing machines, halting or non-halting). But $R$ itself is not computably enumerable.

Assume $R$ were computably enumerable. Then given index $i$ we can find the encoding of the always halting Turing machine $T_i$ in $R = \{T_1, T_2, \dots\}$.

Let's define a Turing machine $D$ that accepts the i-th word if and only if $T_i$ rejects it and rejects the i-th word if and only if $T_i$ accepts it. This Turing machine $D$ is also an always halting Turing machine, since we can compute the i-th encoding of the always halting Turing machine $T_i$ and simulate it on the i-th word. After $T_i$ halts, we just reverse the decision of $T_i$.

However, $D$ does not appear in the enumeration of always halting Turing machines $R$, since for each machine $T_i$ it decides differently at least on the i-th input word. This is a contradiction and therefore the assumption that $R$ is computably enumerable is false.

So even when we focus on always halting Turing machines can we define a set that is countable but not computably enumerable.