# Can a semi-decidable problem be also decidable?

As far as I understand, a semi-decidable (recursively enumerable) problem could be:

1. decidable (recursive) or
2. undecidable (nonrecursively enumerable)

This post made me wonder if this is not conventionally followed. This is my answer to it and as far as I understand it is correct:

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

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

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.

Is it conventionally (always) understood this way? Is there some literature that presents semi-decidability (partially decidable, recursively enumerable) problem as an equivalent of undecidability?

• All the definitions you quote are in agreement. They don't present semi-decidability as equivalent to undecidability. Perhaps you're confused by the fact that a decidable problem is a fortiori semi-decidable. Jan 11 '14 at 2:00
• @YuvalFilmus Actually, most of the things quoted (e.g., a language is decidable if it and its complement are RE) are not definitions but theorems. Therein lies the problem: to determine that the statements are indeed all in agreement, one must look at the definitions. Jan 11 '14 at 2:02
• I'm aware of which of the statements are definitions and which ones are theorems that are derived from those definitions. It's just that I recently learned those concepts and well... the wikipedia entry was ambiguous and the accepted StackOverflow answer was wrong (7 upvotes included). Nevermind. I got it right :) I'm accepting the answer. Thank you. Jan 11 '14 at 17:53

Yes, a recursively enumerable language may be either decidable or undecidable. To see this, you ust look at the definitions of the terms.

A language $L$ is recursive (aka decidable) if there is a Turing machine that halts for all inputs, accepting every word in $L$ and rejecting every word not in $L$. $L$ is recursively enumerable (aka semi-decidable) if there is a Turing machine that halts and accepts any input in $L$ and, for any input not in $L$, it either halts and rejects or it does not halt.

Therefore, every recursive language is recursively enumerable. The machine that decides the recursive language is a special case of the machine required for a recursively enumerable language: specifically, it is allowed to either loop forever or reject for words not in $L$; in fact, it always rejects and never uses the option of looping forever.

• @nbro To anybody who understands the concepts, it is obvious that every recursive language is RE. It seems, then, that anybody who needs to ask this question does not understand the basic concepts and will benefit from having them explained. I addressed my answer to what I perceived to be the right level; you're welcome to post the obvious answer for people who find the answer obvious but the thing is, they don't really need an answer. May 3 '17 at 13:02
• Are there semi-decidable languages that are neither decidable nor undedicable? In other words: is "decidable $\cup$ undecidable $=$ semi-decidable" or is "decidable $\cup$ undecidable $\subset$ semi-decidable" ?
– Qqwy
May 29 '19 at 8:28
• @Qqwy "Undecidable" just means "not decidable", so every language is either decidable or undecidable. However, there are languages that are not semi-decidable, so it's not true that decidable $\cup$ undecidable $\subseteq$ semi-decidable. May 29 '19 at 8:38
• @DavidRicherby I thought that while there are sets that are not recursively enumerable, that languages ("sets of strings") are by definition always recursively enumerable/semi-dedidable? Can you give an example of a language that is not?
– Qqwy
May 29 '19 at 8:54
• @Qqwy "Semi-decidable" and "recursively enumerable" mean exactly the same thing. Sets and languages are the same thing: a language is a set of strings and there's no fundamental difference between a set of integers and, e.g., the set of strings that are the decimal encodings of those integers. There must be non-RE languages because there are uncountably many languages but only countably many Turing machines. An example of a non-RE language is the set of strings coding Turing machines that halt on all inputs; another is the complement of the halting problem. May 29 '19 at 9:01