how many 9 - digits number are palindromic numbers ? a palindromic number reads the same forward and backward , example 123454321 .
take the task of building palindromes and break it intostages . stage 1 : select the 9 th digit we can choose 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , or 9 so , we can complete stage 1 in 9 ways stage 2 : select the 8 th , 7 th , 6 th , 5 th digit we can choose 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , or 9 so , we can complete stage 2 in 10 ways important : at this point , the remaining digits are alreadylocked in . stage 3 : select the 4 th , 3 rd , 2 nd , 1 st digit so , we can complete this stage in 1 way . by thefundamental counting principle ( fcp ) , we can complete all 5 stages ( and thus build a 9 - digit palindrome ) in ( 9 ) ( 10 ) ( 10 ) ( 10 ) ( 10 ) ( 1 ) ( 1 ) ( 1 ) ( 1 ) ways ( = 90000 ways ) answer : e
multiply(multiply(multiply(multiply(9, const_10), const_10), const_10), const_10)