Context free languages and Push-down automata (original) (raw)
Consider the following languages.

Which one of the following statements is FALSE?
- L1 intersection L2 is context-free.
- Complement of L2 is recursive.
- Complement of L1 is context-free but not regular.
Which of the following pairs have DIFFERENT expressive power?
- Deterministic finite automata(DFA) and Non-deterministic finite automata(NFA)
- Deterministic push down automata(DPDA)and Non-deterministic push down automata(NPDA)
- Deterministic single-tape Turing machine and Non-deterministic single-tape Turing machine
- Single-tape Turing machine and multi-tape Turing machine
Let P be a regular language and Q be context-free language such that Q ⊆ P. (For example, let P be the language represented by the regular expression p*q* and Q be {pn qn | n ∈ N}). Then which of the following is ALWAYS regular?
(A) P ∩ Q
(B) P - Q
(C) ∑* - P
(D) ∑* - Q
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
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
S -> aSa|bSb|a|b; The language generated by the above grammar over the alphabet {a,b} is the set of
- All odd length palindromes.
- Strings that begin and end with the same symbol
- All even length palindromes
Let L = L1∩L2, where L1 and L2 are languages as defined below:
L1 = {am bm can bn | m, n >= 0}
L2 = {ai bj ck | i, j, k >= 0}
Then L is
- Context free but not regular
- Recursively enumerable but not context free.
Which of following statement(s) is/are not correct? (I) Languages generated by the grammar S→aSa ∣ aa is not regular. (II) Languages generated by the grammar S→aSb ∣ aa is not regular. (III) Languages generated by the grammar S→S1|S3, S1→aS1c |S2|λ, S2→aS2b|λ, S3→aS3b|S4| λ, S4→bS4c|λ is {a^nb^mc^k | k = |n - m|, n≥0, m≥0, k≥0}. (IV) Languages generated by the grammar S→S1S3, S1→aS1c |S2|λ, S2→aS2b|λ, S3→aS3b|S4| λ, S4→bS4c|λ is {a^nb^mc^k | k = |n - m|, n≥0, m≥0, k≥0}.
Consider the following languages.
L1 = {ai bj ck | i = j, k ≥ 1}
L1 = {ai bj | j = 2i, i ≥ 0}
Which of the following is true?
- L1 is not a CFL but L2 is
- L1 ∩ L2 = ∅ and L1 is non-regular
- L1 ∪ L2 is not a CFL but L2 is
- There is a 4-state PDA that accepts L1, but there is no DPDA that accepts L2
Match the following:
There are 94 questions to complete.
Take a part in the ongoing discussion