aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Test 3 - Theory of Computation | Computer Science
  • Consider the flowing grammar C S $\rightarrow$ bS |aA| b ...
Multiple choice

Consider the flowing grammar C S $\rightarrow$ bS |aA| b A$\rightarrow$ bA | aB B bB |aS| a Let Na (W) and Nb (W) denote the number of a's and b's in a string W respectively. The language L(G) {a,b}+ generated by G is

  1. {W| Na (W) > 3Nb (W)}

  2. {W| Nb (W) > 3Na (W)}

  3. {W| Na (W) = 3k,k $\in$ {0,1,2,...}}
  4. {W| Nb (W) = 3k,k $\in$ {0,1,2,...}}
Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Keep practicing — related questions

  • The language L = {ak bk |k$\ge$1} is
  • Consider the grammar: G1=({S,S1,S2},{a,b},S,P), with the following productions: P:S → S1bc,S1→ S1bc|S2,S2 →...
  • S $\rightarrow$ aSa | bSb | a | b; The language generated by the above grammar over the alphabet {a, b} is ...
  • S $\rightarrow$ aSa | bSb | a | b; The language generated by the above grammar over the alphabet {a, b} is ...
  • Which one of the following grammars generates the language $ L=\left \\{ a^{i}b^{j}\mid i\neq j \right \\}$?
  • Consider the following grammar. S $\rightarrow$S * E S $\rightarrow$E E $\rightarrow$F + E E $\rightarrow$F...
  • Consider the CFG with {S, A, B} as the non-terminal alphabet, {a, b} as the terminal alphabet, S as the sta...
  • Consider the CFG with {S, A, B} as the non-terminal alphabet, {a, b} as the terminal alphabet, S as the sta...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy