2

Can a Turing recognizable language be decidable if it is possible to enumerate its strings in non-decreasing length?

I think it's not because you can go to infinity, and this will make it undecidable right?

PTN
  • 1,658
  • 5
  • 24
  • 54
  • 1
    Please move this to https://cstheory.stackexchange.com/ – C-Otto May 08 '17 at 14:49
  • Moved https://cstheory.stackexchange.com/questions/38168/a-turing-recognizable-language-is-decidable-or-not – PTN May 08 '17 at 14:53
  • 1
    A recognizable language CAN always be decidable. Is your question maybe: Is every enumerable language that can be enumerated in non-decreasing order decidable? Then the answer is yes. – Peter Leupold May 09 '17 at 14:22
  • @C-Otto: This is not research-level and does not belong on cstheory. – user2357112 May 11 '17 at 18:55

1 Answers1

2

The question is about searching for an element in an infinite stream S of ordered elements: a very natural algorithmic question.

This problem is indeed decidable, although in a somewhat sneaky way. You need to reason by cases. If elements in S have an upper bound, then S is finite, and hence it is decidable since every finite set is decidable. On the other side, if S has no bound, it contains elements larger than any number. So, if you are looking for w, it is enough to enumerate until you find an element larger or equal to w (that must exists), and then compare it with w.

However, the proof is not constructive, since you cannot decide if a r.e. set is finite or not. This means that you know (in classical sense) that there must exist some program deciding S, but you have no way to derive it from the code enumerating S. A quite frustrating situation :)

Andrea Asperti
  • 885
  • 10
  • 14
  • I wouldn't go as far as to say you have no way to derive a decider. Assuming you have an enumerator you can construct a two-tape TM that writes the search term on the second tape, enumerates on the first, and intersperses enumeration with comparing the tapes. There is a constructive proof that two-tape TMs are equivalent to single-tape TMs. Given a TM that enumerates L in order of non-decreasing length, you can thus construct a single-tape decider. The only part that isn't constructive is assuming such an enumerator exists, but that's taken for granted as a hypothesis. – Patrick87 May 11 '17 at 19:18
  • @Patrick I am not following you. You cannot be sure to find an element larger than the one you are looking for (unless you know the set is infinite, but you don't), so you do not know when to stop. – Andrea Asperti May 11 '17 at 19:42
  • @AndreaAsperti: Couldn't you just guess in the beginning whether the given set is finite? For this guess you also guess an upper bound. Finite sets would be decided in this way, infinite ones by guessing they are infinite and following the enumeration approach. This should give a (non-deterministic) decider starting from just the enumeration algorithm. – Peter Leupold May 12 '17 at 11:07
  • @PerterLeupold No: as I said, it is not decidable if a r.e. set is finite. – Andrea Asperti May 12 '17 at 13:32