• retagged by
8,255 views
8 8 votes

Consider the following grammar.

  • $S \rightarrow AB$
  • $A  \rightarrow a$
  • $A  \rightarrow BaB$
  • $B  \rightarrow bbA$

Which of the following statements is FALSE?

  1. The length of every string produced by this grammar is even
  2. No string produced by this grammar has three consecutive $a's$
  3. The length of substring produced by $B$ is always odd
  4. No string produced by this grammar has four consecutive $b's$

4 Answers

Best answer
13 13 votes

S->AB

S->aB

S->abbA

S->abbBaB

S->abbbbAabbA

S->abbbbaabba

Given Grammar can produce a string which has 4 consecutive b's.

Hence,Option(D)No string produced by this grammar has four consecutive b's.

• selected by
Answer:
Position:
Show:

Related questions

10 10 votes
4 answers 4 answers
11.4k
11.4k views
ajit asked Sep 20, 2015
11,362 views
What is the number of steps required to derive the string $((()\; ())\; ())$ for the following grammar?$S \to SS$$S \to (S)$$S \to \varepsilon$ $10$ $12$ ...
2 2 votes
2 answers 2 answers
5.6k
5.6k views
Misbah Ghaya asked Jun 8, 2016
5,608 views
A grammar $G$ is $LL(1)$ if and only if the following conditions hold for two distinct productions $A \rightarrow \alpha \mid \beta$I. First $(\alpha) \cap$ First $(\beta...
2 2 votes
4 4 answers
3.6k
3.6k views
Satbir asked Jan 13, 2020
3,636 views
A grammar is defined as$A \rightarrow BC$$B \rightarrow x \mid Bx$$C \rightarrow B \mid D$$D \rightarrow y \mid Ey$$E \rightarrow z$The non terminal alphabet of the gram...
0 0 votes
1 1 answer
333
333 views
Shubham Sharma 2 asked Sep 9, 2025
333 views
Consider the Grammar:\[\begin{array}{l} \mathrm{S} \rightarrow \mathrm{~A} \\ \mathrm{~A} \rightarrow \$ \mathrm{~B} \$ \mid \mathrm{id} \\ \mathrm{~B} \rightarrow \mathr...