• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Context free languages and Push-down automata

Question 21

The language accepted by a Pushdown Automation in which the stack is limited to 10 items is best described as
  • Context Free
  • Regular
  • Deterministic Context Free
  • Recursive

Question 22

Which of the following statements is true?
  • If a language is context free it can always be accepted by a deterministic push-down automaton
  • The union of two context free languages is context free
  • The intersection of two context free languages is context free
  • The complement of a context free language is context free

Question 23

Consider the NPDA 〈Q = {q0, q1, q2}, Σ = {0, 1}, Γ = {0, 1, ⊥}, δ, q0, ⊥, F = {q2}〉, where (as per usual convention) Q is the set of states, Σ is the input alphabet, Γ is stack alphabet, δ is the state transition function, q0 is the initial state, ⊥ is the initial stack symbol, and F is the set of accepting states, The state transition is as follows: Q60 Which one of the following sequences must follow the string 101100 so that the overall string is accepted by the automaton?
  • 10110
  • 10010
  • 01010
  • 01001

Question 24

Which of the following languages are context-free?
L1 = {ambnanbm ⎪ m, n ≥ 1}
L2 = {ambnambn ⎪ m, n ≥ 1}
L3 = {ambn ⎪ m = 2n + 1} 
  • L1 and L2 only
  • L1 and L3 only
  • L2 and L3 only
  • L3 only

Question 25

Which one of the following statements is FALSE?

  • There exist context-free languages such that all the context-free grammars generating them are ambiguous

  • An unambiguous context free grammar always has a unique parse tree for each string of the language generated by it.

  • Both deterministic and non-deterministic pushdown automata always accept the same set of languages

  • A finite set of string from one alphabet is always a regular language.

Question 26

If we use internal data forwarding to speed up the performance of a CPU (R1, R2 and R3 are registers and M[100] is a memory reference), then the sequence of operations   

[caption width="800"] [/caption]
  • A

  • B

  • C

  • D

Question 27

Consider the following context-free grammars: 

 

gt8



Which one of the following pairs of languages is generated by G1 and G2, respectively 

 

gt9


 

  • A
     

  • B
     

  • C
     

  • D
     

Question 28

Context free languages are closed under-
  • Union, Intersection
  • Union, Kleene closure
  • Intersection, Complement
  • Complement, Kleene closure

Question 29

Let L be the set of all languages accepted by a PDA by final state and L the set of all languages accepted by empty stack. Which of the following is true? q2
  • a
  • b
  • c
  • d

Question 30

Consider the pushdown automaton (PDA) below which runs over the input alphabet (a, b, c). It has the stack alphabet {Z0, X} where Z0 is the bottom-of-stack marker. The set of states of the PDA is (s, t, u, f} where s is the start state and f is the final state. The PDA accepts by final state. The transitions of the PDA given below are depicted in a standard manner. For example, the transition (s, b, X) → (t, XZ0) means that if the PDA is in state s and the symbol on the top of the stack is X, then it can read b from the input and move to state t after popping the top of stack and pushing the symbols Z0 and X (in that order) on the stack.
(s, a, Z0) → (s, XXZ0)
(s, ϵ, Z0) → (f, ϵ)
(s, a, X) → (s, XXX)
(s, b, X) → (t, ϵ)
(t, b, X) → (t,.ϵ)
(t, c, X) → (u, ϵ)
(u, c, X) → (u, ϵ)
(u, ϵ, Z0) → (f, ϵ)
The language accepted by the PDA is
  • {albmcn | l = m = n}
  • {albmcn | l = m}
  • {albmcn | 2l = m+n}
  • {albmcn | m=n}

There are 93 questions to complete.

Last Updated :
Take a part in the ongoing discussion