PDA (Pushdown Automata)
  • GATE Crash CourseExplore
  • Context free languages and Push-down automata

    Last Updated :
    Discuss
    Comments

    Question 1

    Consider the following languages. 

     

     Which one of the following statements is FALSE?

    • A

      L2 is context-free.

    • B

      L1 intersection L2 is context-free.

    • C

      Complement of L2 is recursive.

    • D

      Complement of L1 is context-free but not regular.

    Question 2

    Which of the following pairs have DIFFERENT expressive power?

    • A

      Deterministic finite automata(DFA) and Non-deterministic finite automata(NFA)

    • B

      Deterministic push down automata(DPDA)and Non-deterministic push down automata(NPDA)

    • C

      Deterministic single-tape Turing machine and Non-deterministic single-tape Turing machine

    • D

      Single-tape Turing machine and multi-tape Turing machine

    Question 3

    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

    • A

      A

    • B

      B

    • C

      C

    • D

      D

    Question 4

    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 |]

    • A

      Push Down Automata (PDA) can be used to recognize L1 and L2

    • B

      L1 is a regular language

    • C

      All the three languages are context free

    • D

      Turing machine can be used to recognize all the three languages

    Question 5

    Consider the languages - 
    L1 = {0i1j | i != j}. 
    L2 = {0i1j | i = j}. 
    L3 = {0i1j | i = 2j+1}. 
    L4 = {0i1j | i != 2j}.

    • A

      Only L2 is context free

    • B

      Only L2 and L3 are context free

    • C

      Only L1 and L2 are context free

    • D

      All are context free

    Question 6

    S -> aSa|bSb|a|b; The language generated by the above grammar over the alphabet {a,b} is the set of

    • A

      All palindromes

    • B

      All odd length palindromes.

    • C

      Strings that begin and end with the same symbol

    • D

      All even length palindromes

    Question 7

    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

    • A

      Not recursive

    • B

      Regular

    • C

      Context free but not regular

    • D

      Recursively enumerable but not context free.

    Question 8

    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}.

    • A

      Only (II), (IV)

    • B

      Only (I), (III), (IV)

    • C

      Only (I), (II), (III)

    • D

      All of the above

    Question 9

    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?

    • A

      L1 is not a CFL but L2 is

    • B

      L1 ∩ L2 = ∅ and L1 is non-regular

    • C

      L1 ∪ L2 is not a CFL but L2 is

    • D

      There is a 4-state PDA that accepts L1, but there is no DPDA that accepts L2

    Question 10

    Match the following: 24

    • A
      (1)
    • B
      (2)
    • C
      (3)
    • D
      (4)

    There are 94 questions to complete.

    Take a part in the ongoing discussion