Skip to main content
added 25 characters in body
Source Link
Sarvottamananda
  • 4.9k
  • 1
  • 13
  • 19

The language of this grammar is all strings of the form $wb^n$ where $w\in \{a,b\}^*$, and $|w| = n+1$. If I abuse the notation a bit, it is $\Sigma^{n+1}b^n$.

If perchance you mean $S \rightarrow aSa \ | \ bSb \ | \ a\ | \ b$, then the language contains all palindromic strings of odd length.

The language of this grammar is $wb^n$ where $w\in \{a,b\}^*$, and $|w| = n+1$. If I abuse the notation a bit it is $\Sigma^{n+1}b^n$.

If perchance you mean $S \rightarrow aSa \ | \ bSb \ | \ a\ | \ b$, then the language contains all palindromic strings of odd length.

The language of this grammar is all strings of the form $wb^n$ where $w\in \{a,b\}^*$, and $|w| = n+1$. If I abuse the notation a bit, it is $\Sigma^{n+1}b^n$.

If perchance you mean $S \rightarrow aSa \ | \ bSb \ | \ a\ | \ b$, then the language contains all palindromic strings of odd length.

Source Link
Sarvottamananda
  • 4.9k
  • 1
  • 13
  • 19

The language of this grammar is $wb^n$ where $w\in \{a,b\}^*$, and $|w| = n+1$. If I abuse the notation a bit it is $\Sigma^{n+1}b^n$.

If perchance you mean $S \rightarrow aSa \ | \ bSb \ | \ a\ | \ b$, then the language contains all palindromic strings of odd length.