• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Context free languages and Push-down automata

Question 71

The language of all non-null strings of a’s can be defined by a context free grammar as follow: S → aS|Sa|a The word a3 can be generated by __________ different trees.
  • two
  • three
  • four
  • five

Question 72

If all the production rules have single non - terminal symbol on the left side, the grammar defined is:
  • context free grammar
  • context sensitive grammar
  • unrestricted grammar
  • phrase grammar

Question 73

Given the following two languages: L1 = {anban|n > 0} L2 = {an b an bn + 1|n > 0} Which of the following is correct ?
  • L1 is context free language and L2 is not context free language
  • L1 is not context free language and L2 is context free language
  • Both L1 and L2 are context free languages
  • Both L1 and L2 are not context free languages

Question 74

Which variable does not drive a terminal string in grammar? S -> AB A -> a B -> b B -> C
  • A
  • B
  • C
  • S

Question 75

Which of the following sentences can be generated by
S -> aS | bA
A -> d | cA
  • bccdd
  • abbcca
  • abcabc
  • abcd

Question 76

Given the following grammars: 
G1: S → AB|aaB 
A → aA | ∈ 
B → bB | ∈ 
G2: S → A|B 
A → aAb | ab 
B → abB | ∈ 

Which of the following is correct?

  • G 1 is ambiguous and G 2 is unambiguous grammars

  • G 1 is unambiguous and G 2 is ambiguous grammars

  • both G 1 and G 2 are ambiguous grammars

  • both G 1 and G 2 are unambiguous grammars

Question 77

The following Context-Free Grammar (CFG): S → aB | bA A → a | aS | bAA B → b | bS | aBB will generate (1) odd numbers of a’s and odd numbers of b’s (2) even numbers of a’s and even numbers of b’s (3) equal numbers of a’s and b’s (4) different numbers of a’s and b’s

  • (1)

  • (2) an (3)

  • (1), (2) and (3)

  • All are correct.

Question 78

The pushdown automation M = ({q0, q1, q2 }, {a, b}, {0, 1}, δ, q0 , 0, {q0}) with δ (q0, a, 0) = {q1 , 10} δ (q1, a, 1) = {q1 , 11} δ (q1, b, 1) = {q2 , λ} δ (q2, b, 1) = {q2 , λ} δ (q2, λ, 0) = {q0 , λ} Accepts the language
  • L = {a n b m | n, m ≥ 0}
  • L = {a n b n | n ≥ 0}
  • L = {a n b m | n, m ≥ 0}
  • L = {a n b n | n > 0}

Question 79

Match the following:

List - I List - II
(a) Context free grammar (i)Linear bounded automaton
(b) Regular grammar (ii) Pushdown automaton
(c)Context sensitive grammar (iii) Turing machine
(d)Unrestricted grammar (iv)Deterministic finite automaton

codes:

(a) (b) (c) (d)
(A) (ii) (iv) (iii) (i)
(B) (ii) (iv) (i) (iii)
(C) (iv) (i) (ii) (iii)
(4) (i) (iv) (iii (ii)
  • (A)
  • (B)
  • (C)
  • (D)

Question 80

According to pumping lemma for context free languages: Let L be an infinite context free language, then there exists some positive integer m such that any w ∈ L with | w | ≥ m can be decomposed as w = u v x y z
  • with | vxy | ≤ m such that uv i xy i z ∈ L for all i = 0, 1, 2
  • with | vxy | ≤ m, and | vy | ≥ 1, such that uv i xy iz ∈ L for all i = 0, 1, 2, .......
  • with | vxy | ≥ m, and | vy | ≤ 1, such that uv i xy iz ∈ L for all i = 0, 1, 2, .......
  • with | vxy | ≥ m, and | vy | ≥ 1, such that uv ixy iz ∈ L for all i = 0, 1, 2, .......

There are 93 questions to complete.

Last Updated :
Take a part in the ongoing discussion