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?

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

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

Question 11 |

A single tape Turing Machine M has two states q0 and q1, of which q0 is the starting state. The tape alphabet of M is {0, 1, B} and its input alphabet is {0, 1}. The symbol B is the blank symbol used to indicate end of an input string. The transition function of M is described in the following table

The table is interpreted as illustrated below.
The entry (q1, 1, R) in row q0 and column 1 signifies that if M is in state q0 and reads 1 on the current tape square, then it writes 1 on the same tape square, moves its tape head one position to the right and transitions to state q1.
Which of the following statements is true about M ?

0 | 1 | B | |

q0 | q1, 1, R | q1, 1, R | Halt |

q1 | q1, 1, R | q0, 1, L | q0, B, L |

M does not halt on any string in (0 + 1)+ | |

M does not halt on any string in (00 + 1)* | |

M halts on all string ending in a 0 | |

M halts on all string ending in a 1 |

**Recursively enumerable sets and Turing machines**

**GATE-CS-2003**

**Discuss it**

Question 11 Explanation:

Whenever B is given as a input, turing machine halts. This implies epsilon is only accepted when B occurs as an input.

In positive closure, epsilon is not present. So, Turing machine never halts in case of (0+1)

^{+}.

Thus, option (A) is correct.

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

Question 12 |

Define languages L0 and L1 as follows :

L0 = {< M, w, 0 > | M halts on w} L1 = {< M, w, 1 > | M does not halts on w}Here < M, w, i > is a triplet, whose first component. M is an encoding of a Turing Machine, second component, w, is a string, and third component, i, is a bit. Let L = L0 ∪ L1. Which of the following is true ?

L is recursively enumerable, but L' is not | |

L' is recursively enumerable, but L is not | |

Both L and L' are recursive | |

Neither L nor L' is recursively enumerable |

**Recursively enumerable sets and Turing machines**

**GATE-CS-2003**

**Discuss it**

Question 13 |

Which of the following is true?

The complement of a recursive language is recursive. | |

The complement of a recursively enumerable language is recursively enumerable. | |

The complement of a recursive language is either recursive or recursively enumerable. | |

The complement of a context-free language is context-free. |

**Recursively enumerable sets and Turing machines**

**GATE-CS-2002**

**Discuss it**

Question 13 Explanation:

Question 14 |

For any two languages L1 and L2 such that L1 is context free and L2 is recursively enumerable but not recursive, which of the following is/are necessarily true?

1. L1' (complement of L1) is recursive 2. L2' (complement of L2) is recursive 3. L1' is context-free 4. L1' ∪ L2 is recursively enumerable

1 only | |

3 only | |

3 and 4 only | |

1 and 4 only |

**Recursively enumerable sets and Turing machines**

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

**Discuss it**

Question 14 Explanation:

**1. L1' (complement of L1) is recursive is true**L1 is context free. Every context free language is also recursive and recursive languages are closed under complement.

**4. L1' ∪ L2 is recursively enumerable is true**Since L1' is recursive, it is also recursively enumerable and recursively enumerable languages are closed under union. 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: Wiki)

**3. L1' is context-free:**Context-free languages are not closed under complement, intersection, or difference.

**2. L2' (complement of L2) is recursive is false:**Recursively enumerable languages are not closed under set difference or complementation

Question 15 |

Let X be a recursive language and Y be a recursively enumerable but not recursive language. Let W and Z be two languages such that Y' reduces to W, and Z reduces to X' (reduction means the standard many-one reduction). Which one of the following statements is TRUE

W can be recursively enumerable and Z is recursive. | |

W an be recursive and Z is recursively enumerable. | |

W is not recursively enumerable and Z is recursive. | |

W is not recursively enumerable and Z is not recursive |

**Recursively enumerable sets and Turing machines**

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

**Discuss it**

Question 15 Explanation:

Since X is recursive and recursive language is closed under complement. So X’ is also recursive.
Since Z ≤ X’ is recursive. (Rule : if Z is reducible to X’ , and X’ is recursive, then Z is recursive.)
Option (B) and (D) is eliminated.
And Y is recursive enumerable but not recursive, so Y’ cannot be recursively enumerable.
Since Y’ reduces to W.
And we know complement of recursive enumerable is not recursive enumerable and therefore, W is not recursively enumerable. So

**Correct option is (C)**. Here Y’ is complement of Y and X’ is complement of X. This solution is contributed by**Abhishek Agrawal**.Question 16 |

Consider the following types of languages:

L1 Regular, L2: Context-free, L3: Recursive, L4: Recursively enumerable.Which of the following is/are TRUE?

I. L3' U L4 is recursively enumerable II. L2 U L3 is recursive III. L1* U L2 is context-free IV. L1 U L2' is context-free

I only
| |

I and III only | |

I and IV only | |

I, II and III only |

**Recursively enumerable sets and Turing machines**

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

**Discuss it**

Question 16 Explanation:

**St 1:**As L3 is Recursive and recursive languages are closed under complementation, L3’ will also be recursive. L3’ U L4 is also recursive as recursive languages are closed under union.

**St 2:**As L2 is Context- Free, it will be recursive as well. L2 U L3 is recursive because as recursive languages are closed under union.

**St 3:**L1* is regular because regular languages are closed under kleene –closure. L1* U L2 is context free as union of regular and context free is context free.

**St 4:**L2’ may or may not be context free because CFL are not closed under complementation. So it is not true. So I, II and III are correct.

There are 16 questions to complete.