How many 5-digit numbers are there, where the leftmost digit and the rightmost digit are both even?
The even digits are 0, 2, 4, 6, 8.
For the leftmost digit, the first digit there are 4 choices(because 0 can't be the first number). For the second number, there are 10 choices(it can be both odd or even). For the third number, there are also 10 choices. For the fourth number, there are also 10 choices. Finally, the rightmost digit, has 5 choices(all the possible even digits: 0, 2, 4, 6, 8).
So the total number of 5 digit numbers are: 4 * 10^3*5= 20*10^3=20000.
I'm not that good with counting so please tell me if this is correct.