5

This is the definition of decidable from Wikipedia

In computability theory, an undecidable problem consists of a family of instances for which a particular yes/no answer is required, such that there is no computer program that, given any problem instance as input, terminates and outputs the required answer after a finite number of steps. More formally, an undecidable problem is a problem whose language is not a recursive set

The recursive set is a subset of the recursively enumerable one. There are some recursively enumerable languages that are outside the recursive set. So why aren't recursively enumerable languages undecidable?

nbro
  • 15,395
  • 32
  • 113
  • 196
user602774
  • 1,093
  • 7
  • 19
  • 31
  • 3
    Because they are? `A problem is called partially decidable, semidecidable, solvable, or provable if A is a recursively enumerable set. Partially decidable problems and any other problems that are not decidable are called undecidable.` http://en.wikipedia.org/wiki/Undecidable_problem and http://en.wikipedia.org/wiki/Recursively_enumerable_language – tvanfosson Feb 26 '12 at 14:42
  • @tvanfosson No, you're wrong. Partially decidable problems THAT ARE NOT DECIDABLE are called undecidable. A decidable problem is also a semidecidable problem. In other words, a semidecidable problem could be: a decidable problem if its complement is also semidecidable or undecidable if its complement is not. – PALEN Jan 10 '14 at 23:59
  • @user602774 A long time has passed but I believe you've been misguided. The wikipedia description is ambiguous as it can be understood in two possible ways (one of which is wrong). Please read my answer below. – PALEN Jan 11 '14 at 00:11

3 Answers3

14

Recursively enumerable languages/sets are also known as semi-decidable. They aren't decidable, because there isn't a machine that looks at the input and says yes or no (correctly). Semi-decidable means you can write a machine that looks at the input and says yes if the input is in the set, or fails to halt if the input is not in the set. Semi-decidable turns out to be equivalent to recursively enumerable in the same way that decidable is equivalent to recursive:-

If you have a Turing machine R that enumerates a recursively enumerable language, you can make a new machine D that takes an input that may or may not be in the language/set. D runs R until R outputs the first element of the set, and then D compares that with its input. If they match, it returns a "yes" result. If they don't match, it continues running R until it gets the next element, and so on. Since R never halts (because the language is only recursively enumerable, not recursive), D will either answer yes or not halt.

Conversely, if you have a Turing machine D that answers yes or fails to halt, you can make a new machine R which uses the usual technique to run several instances of D in parallel one step at a time with various inputs: all the elements which may or may not be in the set. Every time one of the parallel executions of D halts with a "yes" answer, R outputs that input of D, and continues executing D on all the remaining inputs. R will never halt (because there are some inputs on which D will not halt), but eventually it will output every element for which D answered "yes", that is, every element in the set/language.

Don't get confused into thinking there are three (disjoint) kinds of sets: decidable, semi-decidable, and undecidable. There are two kinds: decidable and undecidable. All of the decidable sets are also semi-decidable (though it's unusual to say it that way). Some of the undecidable sets are also semi-decidable. This is just the same as saying that all enumerable sets are recursively enumerable, and some non-enumerable sets are recursively enumerable.

Dan Hulme
  • 14,779
  • 3
  • 46
  • 95
  • 2
    I agree with PALEN, this should not be an accepted answer. A decidable language L is always recursive enumerable. If a language is recursive enumerable it can be decidable but it isn't necessary so. Only when it's compliment is also recursive enumerable, then the language (and it's compliment) are decidable. – ShellFish Nov 30 '16 at 16:10
  • @ShellFish No problem, it's an honest mistake. I see your point about the "says yes or halts". Only a true computer scientist could possibly misinterpret that one, but I've fixed it anyway. I've also changed the last paragraph. It's harder to misinterpret now, but I fear it's also harder to correctly interpret. – Dan Hulme Dec 01 '16 at 21:10
  • This answer is unnecessarily too long. The concepts are a lot simpler than this answer actually makes them just by looking at it. – nbro May 03 '17 at 12:56
  • This answer is completely wrong just by looking at the second sentence: "They aren't decidable, because there isn't a machine that looks at the input and says yes or no (correctly)." This wrong because recursive languages are also in the set of recursively enumerable languages, thus there are some recursively enumerable languages that are decidable. – nbro May 03 '17 at 12:59
  • The terms "decidable", "semi-decidable" and "undecidable" (applied to languages and thus problems, because of their equivalence) should be interpreted as the fact that there's respectively a decider, a semi-decider (answers _yes_ in the case it must) and an _enumerator_ (for the respective language). – nbro May 03 '17 at 13:08
  • @nbro The OP already understood that *some* recursively enumerable languages are also recursive, and was asking specifically why others are not. If you think you can write a more concise and simpler answer, please go ahead. I'll be happy to vote it up if it's any good. – Dan Hulme May 03 '17 at 13:09
8

A semidecidable problem (or equivalently a recursively enumerable problem) could be:

  1. Decidable: If the problem and its complement are both semidecidable (or recursively enumerable), then the problem is decidable (recursive).

  2. Undecidable: If the problem is semidecidable and its complement is not semidecidable (that is, is not recursively enumerable).

Important note: Remember that a decidable (recursive) problem is also semidecidable (recursively enumerable). Conversely, if a problem is not recursively enumerable (semidecidable), then is not recursive (decidable).

What the Wikipedia entry says is that:

Partially decidable problems THAT ARE NOT DECIDABLE are called undecidable.

In general, a semidecidable problem (recursively enumerable) could be decidable (recursive) or undecidable (nonrecursively enumerable).

Also note that a problem and its complement could both (or just one of them) be not even semi-decidable (nonrecursively enumerable). Also note that, if a problem is recursive, its complement is also recursive.

PALEN
  • 2,784
  • 2
  • 23
  • 24
  • Why decidable problems would be semidecidable?Recursive languages encloses regular,CFL,CSL, and few other languages (some of which are recursively enumerable as well) but for all of this turing machine can output yes or no.Only languages which are recursively enumerable but not Recursive are semidecidable because turing machine accepts string which is in the language but if it isn't in the language then it may or may not halt.If a problem is semidecidable it becomes undecidable (halting problem) – Sunil Kumar Jha Nov 24 '18 at 05:07
  • First, semi-decidable only means that there is an algorithm that accepts the language, meaning that for all elements in the language it will terminate in an accepting state. For the no instances we either loop forever or return false. This is clearly the case for decidable problems. Only there we can even terminate with no in the no instances. – Prof.Chaos Oct 16 '22 at 13:40
  • Also your last sentence seems very wrong or at least confusing. What do you mean by "If a problem is semidecidable it becomes undecidable"? As said, clearly every decidable problem is semi-decidable. Only the hardest semi-decidable problems are also undecidable, but clearly not all. That's why we have hardness. Semi-decidable problems are exactly those in RE. Undecidable ones are just RE\R. (But of course there are undecidable ones which are not RE!) This is beautifully summarized in Janna Sherazi's answer! – Prof.Chaos Oct 16 '22 at 13:44
  • O, I just noticed that my last comment was wrong as well. :) Sorry about that. Whereas it's true that all problems in RE\R are undecidable, this does not yet cover all undecidable problems! Because there are also undecidable problems which are not even in RE! (Like the diagonal language that's used to prove not all problems can be "computed" (in the sense that there's no TM that recognizes the respective language -- which is what it means if a problem isn't in RE) – Prof.Chaos Oct 18 '22 at 02:11
4

I believe that a graphic representation of sets of problems could be more helpful here (the size of different sets has no meaning here).

To summarize:

  1. Every decidable (recursive) problem is also semi-decidable (recursively enumerable).
  2. Every semi-decidable (recursively enumerable) problem that is not decidable (recursive) is undecidable.
  3. There are undecidable problems that are not semi-decidable (recursively enumerable).

decidable, semi-decidable and undecidable

Community
  • 1
  • 1
Janna Sherazi
  • 167
  • 1
  • 1
  • 15