edited by
16,248 views
37 37 votes

If $L1$ is context free language and $L2$ is a regular language which of the following is/are false?

  1. $L1-L2$ is not context free

  2. $L1 \cap L2$ is context free

  3. $\sim L1$ is context free

  4. $\sim L2$ is regular

3 Answers

Best answer
56 56 votes

$L_2$ is regular, so complement of $L2, ( \sim L2)$, is also regular .

Regular languages are closed under complement. So, D is  True.

$L_1 \cap L_2$ is context free.

Intersection of Context free language with Regular language is Context free.  So, B is True.

$L_1 - L_2 = L_1 \cap (\sim L_2)$  is context free

Intersection of Context free language with Regular language is Context free.  So, A is  False .

$\sim L_1$ is not context free

Context free languages are not closed under complement.  So C is False  (May/not be).

edited by
0 0 votes
Analyzing L1 minus L2 (Is it not context free?) implies FALSE

We can rewrite the set-difference operation using intersections and complements:
L1 minus L2 is equal to L1 intersected with the complement of L2.

Now, let's look at the components:
L2 is Regular. Because Regular languages are strictly closed under complement, the complement of L2 is also Regular.
L1 is a Context-Free Language.
This simplifies the problem down to checking the closure property of a Context-Free Language intersected with a Regular Language.

The Rule: The intersection of any Context-Free Language and a Regular Language is always a Context-Free Language. You can mechanically prove this via a cross-product construction of a pushdown automaton and a deterministic finite automaton.
Because L1 minus L2 is guaranteed to be a Context-Free Language, the statement "L1 minus L2 is not context free" is FALSE.

Analyzing L1 intersected with L2 (Is it context free?) implies TRUE

As established in the previous step, this is the exact closure property of a Context-Free Language intersected with a Regular Language.

The Logic: A pushdown automaton for L1 and a deterministic finite automaton for L2 can be combined together into a new hybrid pushdown automaton. The states of this new machine track both the pushdown automaton and deterministic finite automaton states simultaneously, while still using the single stack from the original pushdown automaton.
Since the resulting machine is a valid pushdown automaton, the language L1 intersected with L2 is always a Context-Free Language. Therefore, this statement is TRUE.

Analyzing the complement of L1 (Is it context free?) implies FALSE

This checks the absolute fundamental boundary rule of regular Context-Free Languages:
The Rule: Context-Free Languages are NOT closed under complement.
The Classic Counterexample: If L1 is the union of the language a to the n, b to the n, c to the m and the language a to the m, b to the n, c to the n (which is a valid Context-Free Language), its complement requires tracking two sets of independent counts at the same time to match errors, which cannot be modeled using one stack.
Because the complement of a Context-Free Language is not guaranteed to be a Context-Free Language, declaring universally that "the complement of L1 is context free" is FALSE.

Analyzing the complement of L2 (Is it regular?) implies TRUE

This checks the closure property of the lowest level of the hierarchy:
The Rule: Regular languages are completely closed under complement.
The Machine Proof: If you take a valid, complete deterministic finite automaton that recognizes L2, you can build an exact machine for the complement of L2 simply by flipping every non-final state into a final state, and every final state into a non-final state.
Since the flipped machine is still a valid deterministic finite automaton, the complement of L2 is guaranteed to be Regular. Therefore, this statement is TRUE.
–4 –4 votes

L1 : CFL , L2 : RL
option A : L1-L2
=L1∩(∼L2)
=CFL∩(∼RL)
=CFL∩(RL) ( as RL is closed under complementation )
=CFL∩CFL ( as if lang is RL then it is CFL also )
may be CFL or not ( as CFL is not closed under intersection)
hence option A statement may be false may not be ( here nothing mentioned about "ALWAYS")
option B : same logic as option A
hence option B statement may be false may not be
option C : CFL is not closed under intersection so we cant say anthing about it whether it is CFL or not 
option D : True as RL is closed under complementation 

but question asking about FALSE statements ( all given options are TRUE)
so Ans is None 

verify this

1 flag:
✌ Edit necessary (js__)
Answer:
Position:
Show:

Related questions

43 43 votes
6 answers 6 answers
16.7k
16.7k views
Kathleen asked Sep 23, 2014
16,706 views
The number of binary strings of $n$ zeros and $k$ ones in which no two ones are adjacent is$^{n-1}C_k$$^nC_k$$^nC_{k+1}$None of the above
78 78 votes
5 answers 5 answers
25.5k
25.5k views
Kathleen asked Sep 23, 2014
25,499 views
A certain processor supports only the immediate and the direct addressing modes. Which of the following programming language features cannot be implemented on this proces...
52 52 votes
7 answers 7 answers
18.7k
18.7k views
Kathleen asked Sep 23, 2014
18,736 views
The main difference(s) between a CISC and a RISC processor is/are that a RISC processor typicallyhas fewer instructionshas fewer addressing modeshas more registersis easi...
47 47 votes
4 answers 4 answers
19.3k
19.3k views
Kathleen asked Sep 23, 2014
19,344 views
A multi-user, multi-processing operating system cannot be implemented on hardware that does not supportAddress translationDMA for disk transferAt least two modes of CPU e...