edited by
23,787 views
53 53 votes

Which of the following problems are decidable?

  1. Does a given program ever produce an output?
  2. If $L$ is a context-free language, then, is $\bar{L}$ also context-free?
  3. If $L$ is a regular language, then, is $\bar{L}$ also regular?
  4. If $L$ is a recursive language, then, is $\bar{L}$ also recursive?
  1. $1, 2, 3, 4$
  2. $1, 2$
  3. $2, 3, 4$
  4. $3, 4$

10 Answers

54 54 votes

CFL’s are not closed under complementation and a program can loop forever. So, it may not produce any output.

Regular and recursive languages are closed under complementation.

Hence, only 3,4 are decidable.

Correct Answer: $D$

edited by
10 10 votes

1.Does a given program ever produce an output?

Here 'Yes' ans is possible but 'No' ans not possible. So, it is Recursive enumerable

2 .If L is a context-free language, then, is L' also context-free?

As context free language is not closed under complementation,  So, CFL not decidable under complementation

3.If L is a regular language, then, L' is also regular?

Regular language closed under complementation. So, it is decidable

4.If L is a recursive language, then, is L'also recursive?

Yes it is decidable

Recursive language is decidable

When the language complemented, the 'Yes' and 'No' ans is also complemented. i.e. 'Yes' becomes 'no' and 'no' becomes 'Yes'. But in complementation of Recursive language we also get 'Yes ' and 'No' answer. So,It is decidable

So, answer is (D)

4 4 votes
CFL’s complementation may or may not be context free so this is a non trivial problem and also undecidable . Regular and recursive languages are closed under complementation.Does a given program ever produce an output? means program is never going to halt so halting problem of TM is undecidable.
2 2 votes

Lets see the options one by one..

1)  is undecidable..This can be correlated to computability of Turing machine..Specifically halting property of Turing Machine which is undecidable..

2) option is also undecidable as complement of context free language may or may not be context free language..So we cannot say with surety that for the class of context free languages , the complementary language will also be context free..

3) and 4)  are decidable as regular and recursive languages are closed under complementation..

Hence D) should be correct answer..

2 2 votes
1. L is set of all program. for some of the input TM say yes i accept it and for some of the input TM can say no  it means we can divide input into two part i.e. yes or no

so any program ever produce an o/p or not produce output is non trivial property. So according to Rice theoram it is Undecidable..

2. membership .emptyness, finiteness is decidable in CFL and rest are undecidable so compliment is undecidable . and you can also prove it i.e

L is set of all CFL. For this language whether any member's complement is CFL or not is non trivial property. because CFL are not closed under complement. so complement of CFL can be CFL or can not be CFL. So According to Rice theorem it is Undecidable.

3. L is set of all RL. For this language whether any member's complement is RL or not RL is trivial property. because RL are  closed under complement that is  complement of RL is RL . So According to Rice theorem it is Decidable.

4. L is set of all Recursive languages. For this language whether any member's complement is Recursive languages or not is trivial property. As Recursive languages are  closed under complement. So According to Rice theorem it is Decidable.
edited by
1 1 vote
For any language, if algorithm is possible then that language is "recursive" (DECIDABLE) as algorithm will always halts
And for any language if program is possible then that language is RE (UNDECIDABLE) as program may or may never HALT

So option 1, is "undecidable" as program may or may never give output
Option 2, is also Undecidable as CFL is not close under complement, thus if L is CFL then L' may or may not be CFL, so it is "undecidable"
Option 3, regular language is close under complement, thus it is obvious yes problem, hence it is "decidable"
Option 4, recercive is alse close under coplement, thus it is obvious yes problem, hence it is "decidable"

so, option D is correct
Answer:
Position:
Show:

Related questions

92 92 votes
8 answers 8 answers
22.9k
22.9k views
Arjun asked Sep 29, 2014
22,852 views
Consider the set of strings on $\{0,1\}$ in which, every substring of $3$ symbols has at most two zeros. For example, $001110$ and $011001$ are in the language, but $1000...
66 66 votes
7 answers 7 answers
17.5k
17.5k views
go_editor asked Apr 21, 2016
17,487 views
Consider the following C code segment.int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf(“ \n %d %d ”, a, b); ...
69 69 votes
5 answers 5 answers
23.0k
23.0k views
go_editor asked Apr 21, 2016
23,010 views
Consider the following relations $A, B$ and $C:$ $$\overset{\textbf{A}}{\begin{array}{|c|c|c|}\hline\\\textbf{Id}& \textbf{Name}& \textbf{Age} \\\hline12& \text{A...
53 53 votes
6 answers 6 answers
25.6k
25.6k views
go_editor asked Apr 21, 2016
25,648 views
For the grammar below, a partial $LL(1)$ parsing table is also presented along with the grammar. Entries that need to be filled are indicated as $E1, E2,$ and $E3$. $\var...