edited by
14,199 views
39 39 votes

Which of the following three statements are true? Prove your answer.

  1. The union of two recursive languages is recursive.
  2. The language $\{O^n \mid n\text{ is a prime} \}$ is not regular.
  3. Regular languages are closed under infinite union.

3 Answers

Best answer
46 46 votes
  1. True. Recursive languages are closed under union.
  2. True. The language is context sensitive (we can write a C code right?) but not context-free (can be proved using pumping lemma for context-free languages).
  3. False. Regular languages are closed under finite union but not under infinite union. 
edited by
0 0 votes

Of the three, Statements 1 and 2 are TRUE, while Statement 3 is FALSE.

Statement 1: The union of two recursive languages is recursive. (TRUE)

Proof:

Let $L_1$ and $L_2$ be two recursive languages. By definition, a language is recursive if and only if there exists a Total Turing Machine (a Decider) that halts for every input, outputting Accept if the string is in the language and Reject if it is not.

Let $M_1$ be the decider for $L_1$, and $M_2$ be the decider for $L_2$. We can construct a new Turing Machine $M$ to decide the union language $L_1 \cup L_2$ as follows:

On input string w:
1. Run M1 on input w.
2. If M1 accepts, ACCEPT.
3. If M1 rejects, run M2 on input w.
4. If M2 accepts, ACCEPT.
5. If M2 rejects, REJECT.

Now for the other two options, 

(2) is classois non regular language can be proved by pumping lemma

(3) is false take the example of simple non regular language a^n b^n | n>0 here the individual elements like ab, aabb, aaabbb etc are regular languages but union of them is not considered regular as the above language is CFL 

Answer:
Position:
Show:

Related questions

52 52 votes
6 answers 6 answers
13.4k
13.4k views
Misbah Ghaya asked Nov 29, 2016
13,384 views
How many substrings (of all lengths inclusive) can be formed from a character string of length $n$? Assume all characters to be distinct, prove your answer.
74 74 votes
9 answers 9 answers
39.3k
39.3k views
Kathleen asked Sep 13, 2014
39,346 views
The access times of the main memory and the Cache memory, in a computer system, are $500$ n sec and $50$ nsec, respectively. It is estimated that $80\%$ of the main memor...
54 54 votes
4 answers 4 answers
11.5k
11.5k views
Kathleen asked Sep 13, 2014
11,455 views
If $G$ is a group of even order, then show that there exists an element $a≠e$, the identity in $G$, such that $a^2 = e$.
11 11 votes
1 1 answer
3.5k
3.5k views
go_editor asked Apr 24, 2016
3,453 views
Show the activation records and the display structure just after the procedures called at lines marked $x$ and $y$ have started their execution. Be sure to indicate which...