# Recursively enumerable sets and Turing machines

Please wait while the activity loads.

If this activity does not load, try refreshing your browser. Also, this page requires javascript. Please visit using a browser with javascript enabled.

If this activity does not load, try refreshing your browser. Also, this page requires javascript. Please visit using a browser with javascript enabled.

Question 1 |

Which of the following statements is/are FALSE?

1. For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine. 2. Turing recognizable languages are closed under union and complementation. 3. Turing decidable languages are closed under intersection and complementation. 4. Turing recognizable languages are closed under union and intersection.

1 and 4 only | |

1 and 3 only | |

2 only | |

3 only |

**GATE CS 2013**

**Recursively enumerable sets and Turing machines**

**Discuss it**

Question 1 Explanation:

A recognizer of a language is a machine that recognizes that language.
A decider of a language is a machine that decides that language.
Both types of machine halt in the Accept state on strings that are in the language
A Decider also halts if the string is not in the language
A Recogizer MAY or MAY NOT halt on strings that are not in the language
On all input:
A Decider MUST halt (in Accept or Reject state)
A Recogizer MAY or MAY NOT halt on some strings (Q: Which ones?)
A language is Turing-decidable (or decidable) if some Turing machine decides it. Aka Recursive Language.
A language is Turing-recognizable if some Turing machine recognizes it. Aka Recursively Enumerable Language.
Source: http://www.radford.edu/~nokie/classes/420/Chap3-Langs.html
Recursive (Turing Decidable) languages are closed under following
Kleene star, concatenation, union, intersection, complement and set difference.
Recursively enumerable language are closed under Kleene star, concatenation, union, intersection. They are NOT closed under complement or set difference.

Question 2 |

Let L1 be a recursive language. Let L2 and L3 be languages that are recursively enumerable but not recursive. Which of the following statements is not necessarily true?
(A) L2 – L1 is recursively enumerable.
(B) L1 – L3 is recursively enumerable
(C) L2 ∩ L1 is recursively enumerable
(D) L2 ∪ L1 is recursively enumerable

A | |

B | |

C | |

D |

**GATE CS 2010**

**Recursively enumerable sets and Turing machines**

**Discuss it**

Question 2 Explanation:

A) Always True (Recursively enumerable - Recursive ) is Recursively enumerable B) Not always true L1 - L3 = L1 intersection ( Complement L3 ) L1 is recursive , L3 is recursively enumerable but not recursive Recursively enumerable languages are NOT closed under complement. C) and D) Always true Recursively enumerable languages are closed under intersection and union.

Question 3 |

It is not accepted by a Turing Machine | |

It is regular but not context-free | |

It is context-free but not regular | |

It is neither regular nor context-free, but accepted by a Turing machine |

**Recursively enumerable sets and Turing machines**

**GATE CS 2008**

**Discuss it**

Question 3 Explanation:

Turing machine can be designed for a

Suppose we are given an integer ‘n’ and we want to find out all the prime numbers less than or equal to ‘n’. We repeat the following steps : We find the smallest number in the list, declare it prime and eliminate all the multiples of that number from the list. We keep doing this until each element has been declared prime or eliminated from the list.

Now, if p = 0 or p = 1, we reject the input. Else, we replace the first and the last ‘a’ with symbol $.

In the above steps, what we do is we find the first non-black symbol from the left. Let this symbol occur at position ‘x’. Suppose ‘x’ is a prime number. If this non-blank symbol is $, input string will be accepted. But, if the symbol is ‘a’, we mark it as a* and replace all the multiples of ‘x’ with the symbol ‘blank’. If at the end, symbol $ is replaced with 'blank’, we reject the input string (because p will be multiple of some ‘x’ in that case). Else, we go back and repeat the steps.

Thus, the input is neither regular nor context-free, but is accepted by a Turing machine.

Please comment below if you find anything wrong in the above post.

^{p}using the concept of ‘Sieve of Eratosthenes’.Suppose we are given an integer ‘n’ and we want to find out all the prime numbers less than or equal to ‘n’. We repeat the following steps : We find the smallest number in the list, declare it prime and eliminate all the multiples of that number from the list. We keep doing this until each element has been declared prime or eliminated from the list.

Now, if p = 0 or p = 1, we reject the input. Else, we replace the first and the last ‘a’ with symbol $.

In the above steps, what we do is we find the first non-black symbol from the left. Let this symbol occur at position ‘x’. Suppose ‘x’ is a prime number. If this non-blank symbol is $, input string will be accepted. But, if the symbol is ‘a’, we mark it as a* and replace all the multiples of ‘x’ with the symbol ‘blank’. If at the end, symbol $ is replaced with 'blank’, we reject the input string (because p will be multiple of some ‘x’ in that case). Else, we go back and repeat the steps.

Thus, the input is neither regular nor context-free, but is accepted by a Turing machine.

Please comment below if you find anything wrong in the above post.

Question 4 |

If L and L' are recursively enumerable, then L is

regular | |

context-free
| |

context-sensitive | |

recursive |

**Recursively enumerable sets and Turing machines**

**GATE CS 2008**

**Discuss it**

Question 4 Explanation:

If L is recursively enumerable, then L' is recursively enumerable if and only if L is also recursive.

Question 5 |

Let L be a language and L' be its complement. Which one of the following is NOT a viable possibility?

Neither L nor L' is recursively enumerable (r.e.). | |

One of L and L' is r.e. but not recursive; the other is not r.e.
| |

Both L and L' are r.e. but not recursive. | |

Both L and L' are recursive |

**Recursively enumerable sets and Turing machines**

**GATE-CS-2014-(Set-1)**

**Discuss it**

Question 5 Explanation:

A) It is possible if L itself is NOT RE. Then L' will also not be RE.
B) Suppose there is a language such that turing machine halts on the input. The given language is RE but not recursive and its complement is NOT RE.
C) This is not possible because if we can write enumeration procedure for both languages and it's complement, then the language becomes recursive.
D) It is possible because L is closed under complement if it is recursive.
Thus, C is the correct choice.

Question 6 |

Let A ≤

_{m}B denotes that language A is mapping reducible (also known as many-to-one reducible) to language B. Which one of the following is FALSE? a) If A ≤_{m}B and B is recursive then A is recursive. b) If A ≤_{m}B and A is undecidable then B is undecidable. c) If A ≤_{m}B and B is recursively enumerable then A is recursively enumerable. d) If A ≤_{m}B and B is not recursively enumerable then A is not recursively enumerable.a | |

b | |

c | |

d |

**Recursively enumerable sets and Turing machines**

**GATE-CS-2014-(Set-2)**

**Discuss it**

Question 6 Explanation:

- A ≤
_{m}B means language A is mapping reducible to language B.Thus, A cannot be harder than B. Since, A can be reduced to B, instead of deciding A we can now decide B.**So, the first three options are correct.** - As B is not recursively enumerable, it doesn't guarantee A is not recursively enumerable.Thus, if A ≤
_{m}B and B is not recursively enumerable then A is not recursively enumerable.**Therefore, answer is D is correct**

Question 7 |

For S ∈ (0 + 1) * let d(s) denote the decimal value of s (e.g. d(101) = 5). Let L = {s ∈ (0 + 1)* d(s)mod5 = 2 and d(s)mod7 != 4}.
Which one of the following statements is true?

L is recursively enumerable, but not recursive | |

L is recursive, but not context-free | |

L is context-free, but not regular | |

L is regular |

**Recursively enumerable sets and Turing machines**

**GATE-CS-2006**

**Discuss it**

Question 7 Explanation:

It is regular
L1=d(s) mod 5 =2 is regular with 5 states
L2=d(s) mod 7 =4 is regular with 7 states
therefore L1 ^ L2' should be regular
because regular grammar are closed under intersection and compliment

Question 8 |

Let L1 be a recursive language, and let L2 be a recursively enumerable but not a recursive language. Which one of the following is TRUE?

L1' --> Complement of L1 L2' --> Complement of L2

L1' is recursive and L2' is recursively enumerable | |

L1' is recursive and L2' is not recursively enumerable | |

L1' and L2' are recursively enumerable | |

L1' is recursively enumerable and L2' is recursive |

**Recursively enumerable sets and Turing machines**

**GATE-CS-2005**

**Discuss it**

Question 8 Explanation:

Recursively enumerable languages are known as

**type-0**languages in the Chomsky hierarchy of formal languages. All regular, context-free, context-sensitive and**recursive**languages are recursively enumerable (Source: http://en.wikipedia.org/wiki/Recursively_enumerable_language ) Recursive Languages are closed under complementation, but recursively enumerable are not closed under complementation. If a languages L is recursively enumerable, then the complement of*it*is recursively enumerable if and only if L is also recursive. Since L2 is recursively enumerable, but not recursive, L2' is not recursively enumerable.Question 9 |

L1 is a recursively enumerable language over Σ. An algorithm A effectively enumerates its words as w1, w2, w3, ... Define another language L2 over Σ Union {#} as {wi # wj : wi, wj ∈ L1, i < j}. Here # is a new symbol. Consider the following assertions.

S1 : L1 is recursive implies L2 is recursive S2 : L2 is recursive implies L1 is recursiveWhich of the following statements is true ?

Both S1 and S2 are true | |

S1 is true but S2 is not necessarily true | |

S2 is true but S1 is not necessarily true | |

Neither is necessarily true |

**Recursively enumerable sets and Turing machines**

**GATE-CS-2004**

**Discuss it**

Question 10 |

Nobody knows yet if P = NP. Consider the language L defined as follows :
Which of the following statements is true ?

L is recursive | |

L is recursively enumerable but not recursive | |

L is not recursively enumerable | |

Whether L is recursive or not will be known after we find out if P = NP |

**Recursively enumerable sets and Turing machines**

**GATE-CS-2003**

**Discuss it**

Question 10 Explanation:

Answer is A. in both case(P = NP or P != NP) L is regular, so L is recursive.
Thanks to Vikrant for the above explanation.

There are 22 questions to complete.