retagged by
332 views
0 votes
0 votes

The language generated by the following grammar is:

  • $S \rightarrow  aAb$
  • $A \rightarrow aAb / B$
  • $B \rightarrow  CC$
  • $C \rightarrow  bDa$
  • $D \rightarrow  bDa / \epsilon$
  1. $\{ {a^m \;b^n \;a^n\; b^p \;a^p\; b^m } \mid m,n,p > 0\;\}$
  2. $\{ {a^m \;b^n\; a^m\; b^n\; a^m\; b^n } \mid  m,n,p >0\; \}$
  3. $\{ { a^m\; b^n\; a^p\; b^p \;a^n\; b^m } \mid  m,n,p > 0 \;\}$
  4. $\{ { a^m\; b^m \;a^n\; b^n \;a^p\; b^p } \mid m,n,p > 0\; \}$
retagged by

1 Answer

0 votes
0 votes

Let's take some string:

$S\rightarrow aAb\rightarrow aaAbb\rightarrow aaBbb\rightarrow aaCCbb\rightarrow aabDaCbb\rightarrow aabDabDabb\rightarrow aabababb\rightarrow a^2b^1a^1b^1a^1b^2$

 

Option B and D eliminated.

 

$S\rightarrow aAb\rightarrow aBb\rightarrow aCCb\rightarrow abDaCb\rightarrow abDabDab\rightarrow abbDaabDab\rightarrow abbaabDab\rightarrow abbaabab\rightarrow a^1b^2a^2b^1a^1b^1$

 

Option C eliminated.


$Ans:A$

Answer:

Related questions

511
views
1 answers
1 votes
Bikram asked Aug 12, 2017
511 views
Which of the following languages is/are deterministic context-free?$L_1 = \{ ww^R \mid w \in \{a,b\}^* \text{ and } w^R \text{ is reverse of } w \}$L_2 = \{ ww^R ... in \{0,1\}^* \}$L1$ only$L2$ onlyBoth $L1$ and $L2$Neither $L1$ nor $L2$
298
views
0 answers
0 votes
Bikram asked Aug 12, 2017
298 views
Match the correct automation given in Y to its transition function in $X$ ... II-C, III-E, IV-AI-C, II-B, III-E, IV-FI-B, II-C, III-F, IV-D
667
views
0 answers
4 votes
Bikram asked Aug 12, 2017
667 views
The number of possible finite automata with two states $a0$ and $a1$ (where $a0$ is always the initial state over the alphabet $\{p, q\}$) which accepts empty language is _______ .
312
views
1 answers
0 votes
Bikram asked Aug 12, 2017
312 views
What is the regular expression corresponding to the above DFA?$(01 + (00)^*1)^*$0^*10^*$(10 + 0(00)^* (1 + 01) )^*$0(00)^*10^*$