recategorized by
5,476 views
3 votes
3 votes

The equivalent grammar corresponding to the grammar $G:S \rightarrow aA, A \rightarrow BB, B \rightarrow aBb \mid \varepsilon$ is

  1. $S \rightarrow aA, A \rightarrow BB, B \rightarrow aBb$
  2. $S \rightarrow a \mid aA, A \rightarrow BB, B \rightarrow aBb \mid ab$
  3. $S \rightarrow a \mid aA, A \rightarrow BB \mid B, B \rightarrow aBb$
  4. $S \rightarrow a \mid aA, A \rightarrow BB \mid B , B \rightarrow aBb \mid ab$
recategorized by

2 Answers

Best answer
3 votes
3 votes

G:S$\rightarrow$aA

A $\rightarrow$ BB

B$\rightarrow$ aBb /∈

(A) Here S can generate a (s->aA->aBB->aB->a) which can not generate by A.So we can eliminate this option.

(B)In this option we can not able to generate aab which can be generate by given grammar.So we can eliminate this option.
 

(C)In this option we can generate  a. we can't generate anything other than a because there is no terminal present to stop B.So we can eliminate this option.

Answer should be (D)G:S$\rightarrow$aA , A $\rightarrow$ BB/B , B$\rightarrow$ aBb /ab.

selected by
1 votes
1 votes
If we remove ∊ production from the grammer

Answer should be

$S \rightarrow a \mid Aa, A \rightarrow BB \mid B, B \rightarrow aBb \mid ab$

Hence none of he options matching here
Answer:

Related questions

2.9k
views
2 answers
1 votes
go_editor asked Jul 7, 2016
2,850 views
The following CFG $S \rightarrow aB \mid bA, A \rightarrow a \mid as \mid bAA, B \rightarrow b \mid bs \mid aBB$ generates strings of terminals that haveodd number of a ... of b'sequal number of a's and b'snot equal number of a's and b's
5.2k
views
2 answers
2 votes
go_editor asked Jul 7, 2016
5,150 views
Match the following : ... )-(d)}$\text{(i)-(c), (ii)-(b), (iii)-(d), (iv)-(a)}$
4.6k
views
1 answers
3 votes
go_editor asked Jul 7, 2016
4,596 views
The regular expression for the following DFAab*(b+aa*b)*a*b(b+aa*b)*a*b(b*+aa*b)a*b(b+aa*b)*
4.1k
views
1 answers
1 votes
go_editor asked Jul 7, 2016
4,092 views
Consider the regular expression (a+b)(a+b) ..... (a+b) (n-times). The minimum number of states in finite automaton that recognizes the language represented by this regular expression containsn statesn+1 statesn+2 states2$^n$ states