I'm trying to figure out how many palindromes of length 5 can be formed that contain 7 or 8.
My reasoning is as follows:
The pool to choose from is $\{0,1,2,3,4,5,6,7,8,9\}$ and there are three positions that need to be filled out by these, with the exception that the number $7$ or $8$ must be used in one of the three (I assume at least once). Similarly, the first position cannot be filled by a $0$, so that leaves either the remaining options in the pool, or a $7$ or $8$. For either the second or third position, all options in the pool are available or, again, $7$ or $8$.
So, given that there are $3$ probable position that need to be filled by the required $7$ or $8$; that the first position can only be filled by $9$ options and either the second or third have $10$ options, but with one of these having being filled by the requirement, then:
$3*9*10*1 = 270$
Yet the answer is not correct. Where am I going wrong?
The number of palindromes with at least an $8$ or a $7$ is the number of total palindromes minus the number of palindromes without $7$ or $8$.
To find the total number of palidromes the first terms can be anything but $0$. That's $9$ options. The second can be any thing. That's $10$ options and so can the third that's $10$. So there are $900$ possible palindromes. (Notice that the same number of numbers between $100... 999$. It's the exact same question.)
To find the total numbe of palindromes without $7$ or $8$ there are $7$ options for the first term. And $8$ for the second and third.
So $7*8*8$.
So there are $900 - 7*8*8 = 452$.