I'm having trouble trying to tackle this problem and need some help explaining the approach.
My task is this:
Given an alphabet with $n$ symbols, how many palindromes of length $m$ can be formed?
For instance if the alphabet is $\{a,b\}$ and $m=1,2,3$, you can make: $a,b, aa,bb, aaa,bbb,aba$ and $bab$.
Thanks in advance.
If $m=2k$ you just have to select the first $k$ elements freely, and this determines the other $k$. So there are $n^k$ palindromes.
If $m=2k+1$ you can select the first $k+1$ elements freely and this determines the other $k$. So there are $n^{k+1}$ palindromes.