# Undecidability

• Last Updated : 21 Jan, 2014

 Question 1
 A 3 only B 3 and 4 only C 1, 2 and 3 only D 2 and 3 only
GATE CS 2013    Undecidability
Discuss it

Question 1 Explanation:
• First is Emptiness for CFG; whether a CFG is empty or not, this problem is decidable.
• Second is everything for CFG; whether a CFG will generate all possible strings (completeness of CFG), this problem is undecidable.
• Third is Regularity for REC; whether language generated by TM is regular is undecidable.
• Fourth is equivalence for regular; whether language generated by DFA and NFA are same is decidable.
Second and third will be undecidable. Hence, option (D) is Correct.
 Question 2
 A 1, 2, 3, 4 B 1, 2 C 2, 3, 4 D 3, 4
GATE CS 2012    Undecidability
Discuss it

Question 2 Explanation:
 Question 3
Which of the following are decidable?
```I. Whether the intersection of two regular languages is infinite
II. Whether a given context-free language is regular
III. Whether two push-down automata accept the same language
IV. Whether a given grammar is context-free```
 A I and II B I and IV C II and III D II and IV
GATE CS 2008    Undecidability
Discuss it

Question 3 Explanation:
(A) Intersection of two regular languages is regular and checking if a regular language is infinite is decidable. (B) Deciding regularity of a context free language is undecidable. We check if L(CFG) contains any string with length between n and 2n−1 , where n is the pumping lemma constant. If so, L(CFG) is infinite otherwise it is finite. (C) Equality problem is undecidable for all languages except in case of finite automata i.e. for regular languages. (D) We have to check if the grammar obeys the rules of CFG. If, it obeys such rules then it is decidable.  Thus, option (B) is correct. Please comment below if you find anything wrong in the above post.
 Question 4
Which of the following problems is undecidable? 
 A Membership problem for CFGs B Ambiguity problem for CFGs. C Finiteness problem for FSAs. D Equivalence problem for FSAs.
GATE-CS-2007    Undecidability
Discuss it

Question 4 Explanation:

A set is closed under an operation means when we operate an element of that set with that operator we get an element from that set.
Here, CFG generates a CFL and set of all CFLs is the set. But ambiguity is not an operation and hence we can never say that CFG is closed under such operation.
Only ambiguity problem for CFGs are undecidable.

Thus, option (B) is correct.

Please comment below if you find anything wrong in the above post.
 Question 5
Let be the encoding of a Turing machine as a string over ∑= {0, 1}.  Let L = { |M is a Turing machine that accepts a string of length 2014 }. Then, L is
 A decidable and recursively enumerable B undecidable but recursively enumerable C undecidable and not recursively enumerable D decidable but not recursively enumerable
GATE-CS-2014-(Set-2)    Undecidability
Discuss it

Question 5 Explanation:
There are finite number of strings of length ‘2014’. So, a turing machine will take the input string of length ‘2014’ and test it. If, input string is present in the language then turing machine will halt in final state . But, if turing machine is unable to accept the input string then it will halt in non-final state or go in an infinite loop and never halt. Thus, ‘L’ is undecidable and recursively enumerable. Please comment below if you find anything wrong in the above post.
 Question 6
Which of the following problems is undecidable?
 A Deciding if a given context-free grammar is ambiguous. B Deciding if a given string is generated by a given context-free grammar. C Deciding if the language generated by a given context-free grammar is empty. D Deciding if the language generated by a given context-free grammar is finite.
GATE-CS-2014-(Set-3)    Undecidability
Discuss it

Question 6 Explanation:
Context free grammar is not closed under ambiguity.A set is closed under an operation means when we operate an element of that set with that operator we get an element from that set. Here, context free grammar generates a context free language and set of all context free languages is also a set. But, ambiguity is not an operation and hence we can never say that CFG is closed under ambiguity. Thus, problem mentioned in option (A) is undecidable. Please comment below if you find anything wrong in the above post.
 Question 7
Consider three decision problems P1, P2 and P3. It is known that P1 is decidable and P2 is undecidable. Which one of the following is TRUE?
 A P3 is decidable if P1 is reducible to P3 B P3 is undecidable if P3 is reducible to P2 C P3 is undecidable if P2 is reducible to P3 D P3 is decidable if P3 is reducible to P2's complement
GATE-CS-2005    Undecidability
Discuss it

Question 7 Explanation:
Background: In computational complexity theory, a decision problem has only two possible outputs yes or no. A decision problem is said to be decidable if there exists an effective method or algorithm that returns a correct yes/no answer to that problem. A decision problem is said to be undecidable if there does not exist a single algorithm that always lead to a correct yes/no solution. In terms of reducibility: A ≤p B denotes A is a decision problem that is reducible to B in polynomial time p. This simply means that A’s instance can be transformed into B’s instance and following the solution of B we can get a solution for the problem A. So here we can draw some conclusions:
```1. If A ≤p B and B is decidable then A is also decidable.
This is because if there exists a specific algorithm for solving B and we can
also reduce A to B then we can have a solution of A as well. Hence A is decidable.

However the reverse is not true i.e. if A ≤p B and A is decidable
then B is also decidable because A can have an algorithm existing for its correct
solution but might be the case that B does not.

2. If A ≤p B and A is undecidable then B is also undecidable.
This is because if A is undecidable even when it can be reduced to B that simply
reflects even B cannot provide an algorithm by which we can solve B and hence A.
So decision problem B is also undecidable.

```
However the reverse is not true here as well i.e. if A ≤p B and B is undecidable then A is also undecidable because there might exist an algorithm for A that can provide a solution to A. Using the above stated conclusions we can say that option 1, 2 and 4 are false and option 3 is true.
```Option 1: P1 ≤p P3 and given P1 is decidable gives no conclusion for P3.
Option 2: P3 ≤p P2 and given P2 is undecidable gives no conclusion for P3.
Option 3: P2 ≤p P3 and given P2 is undecidable gives conclusion for P3 to be
undecidable.
Option 4: P3 ≤p P2’s complement and given P2 is undecidable therefore P2’s
complement is also undecidable gives no conclusion for P3.
```
This explanation is contributed by Yashika Arora. Visit the following articles to learn more: undecidability-and-reducibility Wikipedia: Reduction_(Complexity)
 Question 8
Consider two languages L1 and L2 each on the alphabet ∑. Let f : ∑ → ∑ be a polynomial time computable bijection such that (∀ x) [x ∈ L1 iff f(x) ∈ L2]. Further, let f-1 be also polynomial time computable. Which of the following CANNOT be true?
 A L1 ∈ P and L2 is finite B L1 ∈ NP and L2 ∈ P C L1 is undecidable and L2 is decidable D L1 is recursively enumerable and L2 is recursive
GATE-CS-2003    Undecidability
Discuss it

Question 8 Explanation:
We have one to one mapping for all instances of L1 to L2. L1 is given to be undecidable. Further L1 is polynomial time reducible to L2. (By given mapping). Now if L2 is decidable then there is algorithm to solve L2 in polytime. But then we can solve every instance of L1 in polytime, making L1 also decidable. Contradiction
 Question 9
Consider the following problem X.
```Given a Turing machine M over the input alphabet Σ, any
state q of M And a word w∈Σ*, does the computation of M
on w visit the state q? ```
Which of the following statements about X is correct?
 A X is decidable B X is undecidable but partially decidable C X is undecidable and not even partially decidable D X is not a decision problem
GATE-CS-2001    Undecidability
Discuss it

Question 9 Explanation:

This problem is a State Entry Problem. State entry problem can be reduced to halting problem.
We construct a turing machine M with final state ‘q’. We run a turing machine R (for state entry problem) with inputs : M, q, w .
We give ‘w’ as input to M.
If M halts in the final state ‘q’ then R accepts the input. So, the given problem is partially decidable. If M goes in an infinite loop then M can not output anything. So, R rejects the input. So, the given problem becomes undecidable.

Thus, option (B) is the answer.

Please comment below if you find anything wrong in the above post.
 Question 10
Consider the following decision problems:
```(P1) Does a given finite state machine accept a given string
(P2) Does a given context free grammar generate an infinite
number of stings```
Which of the following statements is true?
 A Both (P1) and (P2) are decidable B Neither (P1) nor (P2) are decidable C Only (P1) is decidable D Only (P2) is decidable
GATE-CS-2000    Undecidability
Discuss it

Question 10 Explanation:
• A finite state machine always halts in final or non-final state.Therefore, problem P1 is decidable.
• We check if the context free language generates any string of length between n and (2n – 1). If so, context free language is infinite else it is finite.Therefore, problem P2 is decidable.  Thus, option (A) is correct. Please comment below if you find anything wrong in the above post.
There are 27 questions to complete.
My Personal Notes arrow_drop_up