• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Context free languages and Push-down automata

Question 81

CFG (Context Free Grammar) is not closed under
  • Union
  • Complementation
  • Kleene star
  • Product

Question 82

A CFG(Context Free Grammar) is said to be in Chomsky Normal Form (CNF), if all the productions are of the form A -> BC or A -> a. Let G be a CFG in CNF. To derive a string of terminals of length x, the number of products to be used is
  • 2x - 1
  • 2x
  • 2x + 1
  • 2x

Question 83

Pushdown automata can recognize language generated by_________.
  • Only context free grammar
  • Only regular grammar
  • Context free grammar or rergular gramma
  • Only context sensitive grammar

Question 84

To obtain a string of n Terminals from a given Chomsky normal form grammar, the number of productions to be used is:

  • 2n - 1

  • 2n

  • n + 1

  • n 2

Question 85

Consider the following two Grammars : G1 : S → SbS|a G2 : S → aB|ab, A→GAB|a, B→ABb|b Which of the following option is correct ?
  • Only G1 is ambiguous
  • Only G2 is ambiguous
  • Both G1 and G 2are ambiguous
  • Both G1 and G2are not ambiguous

Question 86

Context sensitive language can be recognized by a :
  • Finite state machine
  • Deterministic finite automata
  • Non-deterministic finite automata
  • Linear bounded automata

Question 87

The set A={ 0n 1n 2 n | n=1, 2, 3, ......... } is an example of a grammar that is:
  • Context sensitive
  • Context free
  • Regular
  • None of the above

Question 88

Consider the language L = { an ∣ n≥0 }∪{ anbn ∣ n≥0 } and the following statements.

  • I. L is deterministic context-free.
  • II. L is context-free but not deterministic context-free.
  • III. L is not LL(k) for any k.

Which of the above statements is/are TRUE ?

  • Ⅰ only

  • Ⅱ only

  • Ⅰ and Ⅲ only

  • Ⅲ only

Question 89

In a pushdown automaton P=(Q,Σ,Γ,δ,q0,F), a transition of the form, where p,q∈Q, a∈σ∪{ϵ}, X,Y,∈Γ∪{ϵ}, represents
(q,Y) ∈ δ(p,a,X) 
Consider the following pushdown automaton over the input alphabet Σ={a,b} and stack alphabet Γ={#,A}. The number of strings of length 100 accepted by the above pushdown automaton is ___________ .
  • 50
  • 100
  • 55
  • 45

Question 90

Let L1 be a regular language and L2 be a context-free language. Which of the following languages is/are context-free?
  • L1∩L2\'
  • (L1\'∪L2\')\'
  • L1∪(L2∪L2\')
  • (L1∩L2)∪(L1∩L2)

There are 93 questions to complete.

Last Updated :
Take a part in the ongoing discussion