A palindrome is a number which reads the same from left as well as from right, for example, 23732. What is the number of palindromes between 10 and 1010 ?
- (a)101
- (b)100
- (c)99
- (d)90
Answer
Why
Correct — B, (b) 100.
THE STEP THAT DECIDES THIS QUESTION is not the counting but the upper limit. Count palindromes by their number of digits, and then look hard at what 1010 lets in.
TWO-DIGIT PALINDROMES. A two-digit number reads the same both ways only if its two digits are the same: 11, 22, 33, 44, 55, 66, 77, 88, 99. That is NINE of them, and every one is above 10.
THREE-DIGIT PALINDROMES. The form is aba. The first digit a may be anything from 1 to 9 — it cannot be 0, or the number would not have three digits — and the middle digit b may be anything from 0 to 9. The last digit is not a free choice at all; it is forced to equal the first. So the count is 9 × 10 = NINETY, running from 101 to 999.
FOUR-DIGIT PALINDROMES BELOW THE LIMIT. The form is abba, and the limit is 1010. The first digit must be 1, since 2002 and everything above it exceeds 1010. That leaves 1bb1, and only b = 0 works: 1001 is below 1010, while 1111 is far above it. So exactly ONE four-digit palindrome falls inside the range.
9 + 90 + 1 = 100
and the answer is option (b).
WHY THE LIMIT IS 1010 AND NOT 1000. This is the entire design of the question. Had the stem said "between 10 and 1000" the count would have been 9 + 90 = 99, which is printed on the list as one of the wrong options. The setter has pushed the boundary ten places past a thousand for the sole purpose of admitting 1001 and no other four-digit palindrome — 1111, the next one, is a hundred past the limit. A candidate who reads the bound as "about a thousand" and stops at the three-digit numbers is out by exactly one, and the option he wants is waiting for him.
A CHECK ON THE ENDPOINTS, which costs a moment and removes an ambiguity. The word "between" would ordinarily exclude both bounds, and a careful candidate may wonder whether that matters. It does not: 10 read backwards is 01, and 1010 read backwards is 0101, so neither bound is a palindrome and neither would have been counted in any case. The question is immune to the inclusive-or-exclusive quarrel, which is another sign that the numbers were chosen with care.
THE GENERAL PRINCIPLE WORTH TAKING AWAY is that a palindrome is completely determined by its FIRST HALF. Write down the leading half and the rest is forced by reflection. So counting palindromes is counting the choices available in that first half, never listing the numbers themselves. For a three-digit palindrome the free part is the first two digits, with the leading one non-zero: 9 × 10 = 90. For a four-digit palindrome the free part is again the first two digits: 9 × 10 = 90 in total, of which only one lies below 1010. For a five-digit palindrome it is the first three: 9 × 10 × 10 = 900. That single idea answers every question of this family without any enumeration at all.
Why the others are wrong
- (a)101 — This is one more than the true count, and the likeliest route to it is admitting the upper bound itself. It is easy to glance at 1010 and see a number that looks symmetrical — it has a one at each end and a zero next to each one — but a palindrome must read identically digit by digit from either direction, and 1010 reversed is 0101, which is not the same string. The digits of 1010 in order are 1, 0, 1, 0, and reflecting them gives 0, 1, 0, 1; the first and last differ, so it fails at the first test. A second route to 101 is to count the two-digit palindromes as ten by including 00, which is not a two-digit number at all. Either way the error is at an endpoint rather than in the method, which is why this option sits so close to the answer: the three-digit block of ninety is correct in every reading, and only the fringes are in dispute.
- (c)99 — This is the trap the question was built around, and it is the most instructive of the three wrong options. Ninety-nine is exactly 9 + 90 — every two-digit palindrome and every three-digit palindrome, and nothing else. It is the count a candidate arrives at by reading the upper bound as though it were 1000 and concluding that the range stops with 999. But the stem does not say 1000; it says 1010, and 1001 lies between the two. The extra ten in the limit is not decoration. It admits precisely one four-digit palindrome and no more, since the next one after 1001 is 1111. The lesson is a general one about ranges in counting problems: after the main blocks have been counted, always return to the boundary and ask explicitly what falls in the fragment beyond the last round number. That check takes seconds and is the difference between this option and the answer.
- (d)90 — This counts the three-digit palindromes and forgets the two-digit ones altogether. Ninety is the number of palindromes of the form aba, with nine choices for the leading digit and ten for the middle, and it is a correct sub-total; the error is that the range begins at 10, not at 100, so the nine repdigits 11, 22, 33, 44, 55, 66, 77, 88 and 99 all belong inside it as well. The oversight is natural, because the example the stem gives is 23732, a five-digit number, and a reader primed by a long example tends to picture long palindromes. It is worth noticing that this option is wrong by nine at one end and by one at the other, so a candidate who chooses it has missed both boundary blocks. The habit that prevents it is to write the range out by digit-length first — two-digit, three-digit, four-digit — and then count each block in turn, which makes an omitted block impossible to miss.
Concept
A PALINDROME IS DETERMINED BY ITS FIRST HALF, and that single observation converts every counting question about palindromes into a small multiplication.
Write a number as a string of digits. For it to read the same in both directions, the first digit must equal the last, the second must equal the second-last, and so on inwards. So once the leading half has been chosen, the trailing half is not a choice at all — it is a reflection. The count of palindromes of a given length is therefore the count of ways of choosing the leading half, subject to the one rule that the leading digit cannot be zero.
1-digit palindromes: 9 (1 to 9) 2-digit palindromes: 9 (the leading digit is free from 1 to 9; the second is forced) 3-digit palindromes: 90 (9 × 10 — first digit and middle digit free) 4-digit palindromes: 90 (9 × 10 — first two digits free, the last two forced) 5-digit palindromes: 900 (9 × 10 × 10) 6-digit palindromes: 900
Notice the pattern: lengths pair up, because adding one digit to an even length adds a free middle digit while adding one to an odd length adds nothing free. That pattern is worth memorising; it answers most palindrome questions outright.
THE SECOND IDEA IS COUNTING OVER A RANGE THAT ENDS MID-BLOCK. A range rarely stops at a clean power of ten. The reliable procedure is to break it into complete digit-blocks plus a fragment, count the complete blocks by the multiplication above, and then handle the fragment by hand. Here the complete blocks are the two-digit and three-digit palindromes and the fragment is the part of the four-digit block lying below 1010, which contains a single number. Counting the fragment by construction rather than by listing is safer when the fragment is large: a four-digit palindrome abba is at most 1010 only if a = 1 and b = 0.
THE THIRD IDEA IS ENDPOINT DISCIPLINE. "Between" is ambiguous in ordinary English and competitive papers rely on the reader to check whether the endpoints could matter at all. Often, as here, they cannot, because neither endpoint has the property being counted. When they can, the safe course is to count both ways and see whether the two results are both on the option list — if only one is, the setter has told you which convention he meant.
The wider skill is the counting principle itself: enumerate the FREE CHOICES and multiply, rather than trying to list the objects. It underlies palindromes, digit-sum problems, number-formation problems and the counting of digits used in writing out a range.
Number-property questions of this kind appear in the quantitative strand of every EPFO paper, and they are among the most rewarding to prepare, because a small number of ideas — counting by free choices, breaking a range into digit-blocks, checking the boundary — cover almost all of them.
This item is well made in a specific way that repays attention. Everything about it is easy except one thing. The definition is given in the stem, so no prior knowledge is required. The example, 23732, is provided. The two-digit and three-digit counts are routine. And then the upper bound is set at 1010 rather than 1000, which is the only decision in the whole question, and the count that ignores it is printed as an option. That is a setter putting all his difficulty into a single place and marking the spot with the numbers themselves — a bound of 1010 is not a natural stopping point, and its oddness is a signal to look at it twice.
The habit rewarded is one that generalises far beyond palindromes: after the bulk of a count is done, go back to the edges. In problems about ranges, most errors are boundary errors rather than method errors, and they are cheap to prevent. Ask what the last object below the limit is, and whether it is inside or outside.
A note on the printing. The example number is set as 23732 with no separators, the bounds are given as bare numerals, and the four options are bare numerals too, listed in descending order.
Key facts
- There are nine two-digit palindromes — 11, 22, 33, 44, 55, 66, 77, 88 and 99 — since both digits must be the same and the leading digit cannot be zero.
- There are ninety three-digit palindromes of the form aba: nine choices for the first digit, ten for the middle, and the last digit forced by reflection.
- Exactly one four-digit palindrome lies below 1010, namely 1001; the next one, 1111, is a hundred beyond the limit.
- The total is therefore 9 + 90 + 1 = 100, and the extra ten in the upper bound is what admits the single four-digit case.
- Had the range stopped at 1000 the count would have been 99, which is the wrong option the design of the question is aimed at.
- Neither endpoint is itself a palindrome — 10 reversed is 01 and 1010 reversed is 0101 — so the inclusive-or-exclusive reading of "between" makes no difference here.
- A palindrome is completely determined by its leading half, so palindromes are counted by multiplying the free choices in that half rather than by listing them.
- The counts by length run 9, 9, 90, 90, 900, 900 for one to six digits, because adding a digit to an even length adds a free middle digit while adding one to an odd length adds none.
Study next
Common traps
- Reading the upper bound as a thousand. The limit is 1010, which admits 1001 and turns 99 into 100.
- Forgetting the two-digit palindromes because the example given in the stem is a five-digit number.
- Treating 1010 as a palindrome. Reversed it reads 0101, so its first and last digits do not match.
- Counting the two-digit palindromes as ten by admitting 00, which is not a two-digit number.
- Trying to list the palindromes instead of counting the free choices, which is slow and invites omissions in the middle of a block.
Number-theory and counting items on EPFO papers are short, self-contained and definition-driven. The definition needed is usually supplied in the stem — as "palindrome" is here — so the item is testing method rather than vocabulary. Expect one of a small set of shapes: count the objects of a kind within a range; count how many times a digit appears; find the number of ways of forming a number under restrictions; or find a remainder or a divisibility property.
The characteristic difficulty is placed at a boundary rather than in the calculation. A range that stops at an odd number, an example that suggests the wrong scale, an endpoint that may or may not qualify — each of these produces a wrong answer that differs from the right one by one or by a single block, and both of those near misses are then printed as options. Here the option list contains the answer, the answer plus one and the answer minus one, which is the signature of a boundary-based item.
The preparation that works is to build the small counting facts into reflexes: the palindrome counts by length, the number of times a digit occurs in each place-value position over a range, and the multiplication principle itself. Then spend the saved time on the boundary. On this family of questions the last ten seconds of checking are worth more than the first thirty seconds of work.
Related PYQs
EPFO_APFC_2016_Q98In writing all the integers from 1 to 300, how many times is the digit 1 used ?
- (a) 160
- (b) 140
- (c) 120
- (d) 110
Answer(a) 160
The digit-counting item printed immediately after this one on the same paper — how many times the digit 1 is used in writing the integers from 1 to 300, the same counting-by-position discipline.
EPFO_APFC_2016_Q96If the difference of two numbers is greater than the sum of the numbers, then
- (a) Both the numbers are negative
- (b) Exactly one of the numbers is negative
- (c) At least one of the numbers is negative
- (d) None of the above
Answer(c) At least one of the numbers is negative
The inequality item on this paper, where the work is again in reading the condition exactly rather than in computing anything.
Practice
- practice — not a real PYQ
A palindrome is a number that reads the same from left to right as it does from right to left. How many four-digit numbers are palindromes ?
- (a)81
- (b)90
- (c)100
- (d)900
Answer(b) 90 — a four-digit palindrome has the form abba, so only the first two digits are free choices. The leading digit has nine possibilities from 1 to 9 and the second has ten from 0 to 9, giving 9 × 10 = 90, while the last two digits are forced by reflection.
- practice — not a real PYQ
A palindrome reads the same in both directions. How many palindromes lie between 100 and 1100, taking the two bounds themselves as excluded ?
- (a)90
- (b)91
- (c)99
- (d)100
Answer(b) 91 — the ninety three-digit palindromes from 101 to 999 make up the main block, and the only four-digit palindrome below 1100 is 1001, since the next one is 1111. Neither bound is itself a palindrome, so their exclusion changes nothing.