UPSC CSAT 2026 Q49: Counting a Digit in Two-Digit Numbers — Solved
How many times does 5 appear in all two-digit positive integers?
- 18
- 19
- 20
- 21
Answer: (b) 19
Solution
- What is counted. Two-digit positive integers run from 10 to 99. That is 99 − 10 + 1 = 90 numbers. The question asks how many times the digit 5 appears, not how many numbers contain a 5. So 55 counts twice.
- Split by place value. Each two-digit number has a tens digit and a units digit. Count the 5s in each place separately, then add.
- 5 in the units place. The numbers are 15, 25, 35, 45, 55, 65, 75, 85, 95. The tens digit can be any of 1 to 9 (it cannot be 0), which gives 9 choices. Count = 9.
- 5 in the tens place. The numbers are 50, 51, 52, 53, 54, 55, 56, 57, 58, 59. The units digit can be any of 0 to 9, which gives 10 choices. Count = 10.
- Check 55. 55 appears in both lists. That is correct, because it has two 5s. Each 5 is one appearance, so nothing is subtracted.
- Add. 9 + 10 = 19.
- Cross-check. Count the numbers that contain at least one 5: 9 + 10 − 1 = 18 (55 counted once). Add the extra 5 in 55: 18 + 1 = 19.
Answer: 19
Option-wise explanation
- a: incorrect — 18 is how many two-digit numbers contain a 5 (9 + 10 − 1). It counts 55 once, but 55 has two 5s. This is the classic trap of counting numbers instead of digits.
- b: correct — Units place gives 9 fives (15 to 95) and tens place gives 10 fives (50 to 59). 9 + 10 = 19, and 55 is rightly counted twice.
- c: incorrect — 20 is the count for 1 to 99 (or 00 to 99), where the units-place 5s are 5, 15, …, 95, which makes 10. It wrongly includes the one-digit number 5 (written as 05), which is not a two-digit integer.
- d: incorrect — 21 would need two more appearances than exist. It comes from careless double-counting, for example taking 10 units-place 5s, 10 tens-place 5s and then adding 55 once more as a 'special case'.
How to eliminate
Do not list numbers. Count by place. Tens digit = 5 gives 10 numbers (50 to 59). Units digit = 5 needs a tens digit from 1 to 9, which gives 9. Total 19. To decide between nearby options: 18 counts numbers, not digits, so it drops the second 5 in 55. 20 includes 05, which is not two-digit. The question says 'how many times', so every digit counts. About 20–30 seconds. Attempt this first: it is a sure mark if you read 'times' and 'two-digit' carefully.
Know more
Counting a digit across a range: go place by place
For any digit-occurrence question, fix one place (units, tens, hundreds) as the target digit. Count how many free choices the other places have. Then add across places. Never subtract overlaps like 55 or 555. Each copy of the digit is a separate appearance.
The only restriction is the leading digit. It cannot be 0, and the range may cut off part of it.
| Range | Digit d = 1 to 9 | Digit 0 |
|---|---|---|
| Two-digit (10–99) | 9 + 10 = 19 | 9 |
| 1–99 | 10 + 10 = 20 | 9 |
| 1–999 | 100 × 3 = 300 | 9 + 180 = 189 |
Worked variant. How many times is 7 written from 1 to 200?
- Units place: 7, 17, …, 197 gives 20.
- Tens place: 70–79 and 170–179 give 20.
- Hundreds place: none, because the range stops at 200.
- Total = 40.
Two separate questions to keep apart:
- 'How many times does d appear?' Count digits. Overlaps count twice.
- 'How many numbers contain d?' Count numbers. Subtract overlaps once, or use the complement: total − numbers with no d. For two-digit numbers that is 90 − (8 × 9) = 90 − 72 = 18.
The gap between these two readings is exactly the trap UPSC puts in the options.