retagged by
20,891 views
34 votes
34 votes

$$S \to aSa \mid bSb\mid a\mid b$$
The language generated by the above grammar over the alphabet $\{a,b\}$ is the set of:

  1. all palindromes
  2. all odd length palindromes
  3. strings that begin and end with the same symbol
  4. all even length palindromes
retagged by

7 Answers

Best answer
38 votes
38 votes

Answer is B. String generated by this language is $a,b,aba,bab,aabaa,\ldots$

All this strings are odd length palindromes.

edited by
17 votes
17 votes
(A) Counter Example :- aa or bb not generated by above Grammar.

(C) Counter example :- aa not genetrated by above Grammer.

(D) Counter Example :- aa not generated, but a generated.

(B) Correct. Odd length palindromes are generated by this grammar.
14 votes
14 votes

option b

Answer:

Related questions

49.9k
views
18 answers
127 votes
Kathleen asked Sep 22, 2014
49,855 views
Frames of $\text{1000 bits}$ are sent over a $10^6$ $\text{bps}$ duplex link between two hosts. The propagation time is $\text{25 ms}$. Frames are to be transmitted into ...
8.8k
views
5 answers
20 votes
Kathleen asked Sep 22, 2014
8,759 views
In which one of the following page replacement policies, Belady's anomaly may occur?FIFOOptimalLRUMRU
16.1k
views
6 answers
45 votes
Kathleen asked Sep 22, 2014
16,137 views
Which one of the following is FALSE?There is a unique minimal DFA for every regular languageEvery NFA can be converted to an equivalent PDA.Complement of every context-fr...
11.8k
views
5 answers
33 votes
Kathleen asked Sep 11, 2014
11,769 views
If $L$ and $\overline{L}$ are recursively enumerable then $L$ isregularcontext-freecontext-sensitiverecursive