Is "aa" an even or odd palindrome?

61 Views Asked by At

I came across a question with a solution that says this:

The context-free grammar (CFG) for palindromes of even length was given: Σ = {a, b}, P → a P a | b P b | ε

Give a context-free grammar (CFG) for palindromes that allows odd-length palindromes.

Solution: P → a a | bPb | a | b | ε

But I don't understand how "aa" is an odd-length palindrome? It's length is definitely two, unless I'm seeing it wrong. They say it's the right answer, and if it is, I need to know the reason why since I don't understand it.