How many words of length $n$ over the alphabet $\{0,1, 2\}$ contain an even number of zeros?
I can't understand why it isn't $3^{n-1} \cdot 2$.
For $n-1$ letters, we have $3$ options. That means $3^{n-1}$.
And then for the last letter ($n$), we have two cases:
first - if there were odd zeros the last letter will be $0$ ($1$ option)
second - if there were even zeros, the last letter will be $1$ or $2$ ($2$ options)
means $3^{n-1} \cdot 2$
Why am I wrong?
THX
OP's solution is wrong, because it is not always 2 choices for the last digit -- it can be either 1 choice or 2 choices. All that OP's solution proves is that the answer is in the interval $$[1\cdot 3^{n-1},2\cdot 3^{n-1}]$$