# Recursively enumerable sets and Turing machines

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?

L2 – L1 is recursively enumerable. | |

L1 – L3 is recursively enumerable | |

L2 ∩ L1 is recursively enumerable | |

L2 ∪ L1 is recursively enumerable |

**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 |

**GATE CS 2008**

**Recursively enumerable sets and Turing machines**

**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 |

**GATE CS 2008**

**Recursively enumerable sets and Turing machines**

**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 |

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

**Recursively enumerable sets and Turing machines**

**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?If A ≤ _{m} B and B is recursive then A is recursive. | |

If A ≤ _{m} B and A is undecidable then B is undecidable. | |

If A ≤ _{m} B and B is recursively enumerable then A is recursively enumerable. | |

If A ≤ _{m} B and B is not recursively enumerable then A is not recursively enumerable. |

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

**Recursively enumerable sets and Turing machines**

**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 |

**GATE-CS-2006**

**Recursively enumerable sets and Turing machines**

**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 |

**GATE-CS-2005**

**Recursively enumerable sets and Turing machines**

**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 |

**GATE-CS-2004**

**Recursively enumerable sets and Turing machines**

**Discuss it**

Question 9 Explanation:

S1 is TRUE.
If L1 is recursive L2 must also be recursive. Because to check if a word w=wi#wj belongs to L2, we can give wi and wj to the decider for L1 and if both are accepted then w belongs to L1 and not otherwise.
S2 is TRUE.
With a decider for L2 we can make a decider for L1 as follows. Let w1 be the first string enumerated by algorithm A for L1. Now, to check if a word w belongs to L1, make a string w′=w1#w and give it to the decider for L2 and if accepted, then w belongs to L1 and not otherwise.
So, the answer must be (A).

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 |

**GATE-CS-2003**

**Recursively enumerable sets and Turing machines**

**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 29 questions to complete.