retagged by
6,476 views
8 votes
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$
retagged by

4 Answers

Best answer
12 votes
12 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:

Related questions

8 votes
8 votes
4 answers
1
ajit asked Sep 20, 2015
9,281 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$ ...
0 votes
0 votes
0 answers
2
Ana_101 asked 9 hours ago
8 views
S - A BA - f S fA - b b B dB - ƐB - cFirst(S) =First(A) =First(B) =Follow(S) =Follow(A) =Follow(B) =
2 votes
2 votes
2 answers
3
Subhrangsu asked Apr 16, 2022
9,304 views
Is the following grammar LL(1) ?S→ aABbCD | ϵA→ ASd | ϵB→ Sac| hC | ϵC→ Sf |CgD→ aBD | ϵDraw the LL(1) parsing table for the given grammar.
0 votes
0 votes
1 answer
4
Subhrangsu asked Apr 15, 2022
2,214 views
Compute FIRST and FOLLOW sets:S→ aAC | bBA→ Abc| Abd | eB→ f | gC→ h | i