The language of palindromes over {a,b} whose length is a multiple of 3, I am clueless as to how you would attempt this.
Asked
Active
Viewed 237 times
1 Answers
0
A context free grammar has a few components:
$N$, the set of non-terminal symbols
$T$, the set of terminal symbols
$S$, the starting string.
So since length is a multiple of three, start with all the palindromes of length three:
$S \to aaa$
$S \to bbb$
$S \to aba$
$S \to bab$
This enures that if we go directly to a terminal symbol, that the string satisfies the condition. Now, here's the big hint- with what do you surround any of these terminals such that you have a palindrome?
ml0105
- 14,674
-
S the starting string – tarantino Mar 26 '14 at 20:21
-
Is there a question, or something I can clarify? – ml0105 Mar 26 '14 at 20:22