## Encyclopedia > Recursively enumerable language

Article Content

# Recursively enumerable language

A formal language L is said to be partially decidable or recursively enumerable or Turing-recognizable if there is an algorithm with the following behavior:

Definition 1. Given string w as input, the algorithm halts and outputs YES if and only if w belongs to the language L. If w does not belong to the language L, the algorithm either runs forever, or halts and outputs NO.

To formalize the rather vague term "algorithm", one usually employs Turing machines, but several other equivalent approaches are possible.

Another equivalent definition is that a language L is recursively enumerable if it is empty or if there is an algorithm which enumerates the members of the language in the following sense:

Definition 2. The algorithm takes a positive integer, say n as an argument, and produces as output a string in the language L. For every string s which is in L there must be an n so that the algorithm produces the string s.

The equivalency of these two definitions can be seen as follows:

1 -> 2 Given an algorithm A according to the first definition for language L (assumed to be non-empty), the following algorithm will enumerate L according to the second definition: Let E be an algorithm which enumerates all strings, and so that every string appears infinitely often in the enumeration. We write E(n) to denote the string produced by algorithm E on input n. Pick a fixed string t in L (possible since L is non-empty). The following algorithm enumerates L:

Given integer n, run algorithm A on input E(n) for n steps. If the answer is YES, output the string E(n). Otherwise, output string t.
This algorithm will only output strings from L, and it will output all of them, since for every string s in L we can find an integer n which is greater than the number of steps that A needs to accept s and such that E(n) = s.

2 -> 1 Given an algorithm A according to the second definition for language L, the following algorithm will answer the question whether a given string s belongs to L in the sense of the first definition:

For all numbers n, starting with 1, and continuing in sequence, test whether the string produced by algorithm A on input n is equal to s. When the first such n is found, output YES. (Otherwise, continue the LOOP)

Note that, if L is infinite, the enumerating algorithm provided by definition 2 can be chosen so that it avoids repetitions, since we can test whether the string produced for number n is "already" produced for a number which is less than n. If it already is produced, use the output for input n+1 instead (recursively), but again, test whether it is "new".

Some partially decidable languages have an algorithm that always halts and answers YES or NO correctly. Those languages are called decidable languages or recursive languages. Some problems are recursively enumerable but not recursive. One example is the halting problem, which is the problem:

Given a program and input parameters, will that program eventually halt when run with those parameters?
Phrased as a formal language, this one consists of all those strings which encode a program and input parameters (according to an agreed-upon encoding) such that the program run with those parameters will eventually halt.

Another example is:

Given a polynomial (in several variables) with integer coefficients, is it possible to find integer values for the variables so that the polynomial evaluates to zero? (This is Hilbert's Tenth Problem, more under Matiyasevich's theorem.)

All regular, context-free, context-sensitive and recursive languages are recursively enumerable. Some problems are so difficult that they aren't even recursively enumerable. One example is this problem:

Given a program, input parameters, and a prediction about whether it will eventually halt, is that prediction correct?

In general, if a language L is not recursive, then the language consisting of all strings together with a marker symbol saying whether it is or is not in L is not recursively enumerable.

Another example of a problem that is not recursively enumerable is this:

Given a program and input parameters, will that program run forever?

If L and P are two recursively enumerable languages, then the following languages are recursively enumerable as well:

• the Kleene star L* of L
• the concatentation LP of L and P
• the union LP
• the intersection LP
Note that the set difference L\P and in particular the complement of L need not be recursively enumerable. In fact, a language L is recursive if and only if L and its complement are both recursively enumerable.

All Wikipedia text is available under the terms of the GNU Free Documentation License

Search Encyclopedia
 Search over one million articles, find something about almost anything!

Featured Article
 Kings Park, New York ... 3.32. In the town the population is spread out with 25.2% under the age of 18, 5.7% from 18 to 24, 31.9% from 25 to 44, 23.3% from 45 to 64, and 13.9% who are 65 years of ...
{"ft_lang_label":"__label__en","ft_lang_prob":0.9022361,"math_prob":0.9433004,"size":2360,"snap":"2019-51-2020-05","text_gpt3_token_len":457,"char_repetition_ratio":0.17105263,"word_repetition_ratio":0.015748031,"special_character_ratio":0.1927966,"punctuation_ratio":0.09154929,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9909653,"pos_list":[0,1,2,3,4,5,6,7,8],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-19T16:50:30Z\",\"WARC-Record-ID\":\"<urn:uuid:5357e688-718c-45f3-bbdd-23c2fcce1554>\",\"Content-Length\":\"18047\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d3c37bab-344f-4b60-9057-72958f44ccf5>\",\"WARC-Concurrent-To\":\"<urn:uuid:14dd93ed-444b-4a26-b588-979f1a4246a0>\",\"WARC-IP-Address\":\"198.199.109.150\",\"WARC-Target-URI\":\"http://encyclopedia.kids.net.au/page/re/Recursively_enumerable_language\",\"WARC-Payload-Digest\":\"sha1:LJG5QQARUYAPXOLHYM5FK27WYP4XAEHU\",\"WARC-Block-Digest\":\"sha1:BOZ4EGJ4SBKOTECJOGNETOXYXC65X5Y7\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579250594662.6_warc_CC-MAIN-20200119151736-20200119175736-00557.warc.gz\"}"}