How many two-digit positive integers have at least one as a digit?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
It is easier to count the two-digit numbers with no 7 at all (8 choices for the tens digit, 9 for the ones digit) and take them away from 90.
Solution
"At least one " could mean a in the tens place, in the ones place, or in both. Rather than juggle those, count the opposite: numbers with no at all.
1. There are two-digit numbers, from to .
2. Build a two-digit number with no . The tens digit can be to but not : that is choices. The ones digit can be to but not : that is choices.
3. Every tens choice can go with every ones choice, so there are numbers with no .
4. All the other two-digit numbers have at least one :
The answer is .
Why this works
When a question says "at least one," the opposite ("none") is often a simple multiplication, because each digit is chosen on its own. Counting directly means you have to watch for numbers that fit two ways at once, here the number .
Alternative approach
Count directly, but watch for the overlap.
- The numbers have a in the tens place: numbers.
- The numbers have a in the ones place: numbers.
- The number is on both lists, so it was counted twice. Take one copy away: .
The trap
Adding the 10 numbers in the seventies to the 9 numbers ending in 7 to get 19, which counts 77 twice.
Concise solution
"At least one " is easiest to handle through its opposite, "no anywhere."
There are two-digit numbers ( through ). To build one that avoids the digit : the tens digit can be any of – except , which is options, and the units digit can be any of – except , which is options. That gives numbers with no .
Everything else contains a :
The answer is .
Review in the AoPS books
- Introduction to Counting & Probability, Chapter 1: Counting Is Arithmetic
- Introduction to Number Theory, Chapter 8: Base Numbers
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques (§2.3)
- Intermediate Counting & Probability, Chapter 3: A Piece of PIE (§3.2, §3.3)
Techniques
Count the complement and subtract from the total