Bunuel
How many integers between 100 and 400, inclusive, contain the digit 2?
A. 100
B. 125
C. 138
D. 145
E. 150
An alternative approach to solve the question
Let's assume that the number is represented by
xyzCase 1: When the unit digit is 2x y
2- x can be filled in three ways - it can be 1 , 2 and 3
- y can be filled in nine ways - all numbers from 0 to 9 except 2. We will handle 2 separately.
Total number of ways = 3 * 9 = 27
Case 2: When the tens digit is 2x
2 z
- x can be filled in three ways - it can be 1 , 2 and 3
- z can be filled in nine ways - all numbers from 0 to 9 except 2. We will handle 2 separately.
Total number of ways = 3 * 9 = 27
Case 3: When the hundreds digit is 22 y z
- y can filled in nine ways - all numbers from 0 to 9 except 2. We will handle 2 separately.
- z can be filled in nine ways - all numbers from 0 to 9 except 2. We will handle 2 separately.
Total number of ways = 9 * 9 = 81
Total = 81 + 27 + 27 = 135
Case 4: Handling multiple 2sSo far we have handled scenarios wherein xyz has only one two in either tens, or units or hundreds place. However, we can have multiple twos in xyz. We can have three numbers wherein two can appear in multiple places.
1 2 2
2 2 2
3 2 2
Total = 135 + 3 = 138
Option C