Context Free Grammars & Languages PYQ QUIZ GATE CS (original) (raw)
Consider the languages L1, L2 and L3 as given below.
LI= {0P1q |p, q∈N}
L2={0p1q |p, q∈ N and p=q} and
L3= {0P1q0r |p, q, r∈ N and p =q = r}
Which of the following statements is **NOT TRUE?
[GATE | CS | 2011 |]
- Push Down Automata (PDA) can be used to recognize L1 and L2
- All the three languages are context free
- Turing machine can be used to recognize all the three languages
The grammar S → aSa | bS | c is
Consider the languages -
L1 = {0i1j | i != j}.
L2 = {0i1j | i = j}.
L3 = {0i1j | i = 2j+1}.
L4 = {0i1j | i != 2j}.
- Only L2 and L3 are context free
- Only L1 and L2 are context free
Suppose that L1 is a regular language and L2 is a context-free language. Which one of the following languages is NOT necessarily context-free?
Consider the following languages.
**L 1 = { wxyx ∣ w,x,y ∈ (0+1)+ }
*L 2 = { xy ∣ x,y ∈ (a+b), ∣x∣=∣y∣, x≠y }
Which one of the following is TRUE ?
- L1 is regular and L2 is context- free
- L1 context- free but not regular and L2 is context-free
- Neither L1 nor L2 is context- free
- L1 context- free but L2 is not context-free
For a string w, we define wR to be the reverse of w. For example, if w = 01101 then wR = 10110.
Which of the following languages is/are context-free?
The language L= {0i21i | i≥0 } over the alphabet {0,1, 2} is:
- is recursive and is a deterministic CFL.
- is not a deterministic CFL but a CFL.

Here, wr is the reverse of the string w. Which of these languages are deterministic Context-free languages?
Consider the following statements about the context free grammar
G = {S → SS, S → ab, S → ba, S → Ε}
I. G is ambiguous
II. G produces all strings with equal number of a’s and b’s
III. G can be accepted by a deterministic PDA.
Which combination below expresses all the true statements about G?
Which one of the following grammars generates the language L = {ai bj | i ≠ j}

There are 32 questions to complete.
Take a part in the ongoing discussion