How many 4-digit numbers contain the digit 2?

2023

How many 4-digit numbers contain the digit 2?

  1. A.

    3168

  2. B.

    3172

  3. C.

    3174

  4. D.

    3170

Show answer & explanation

Correct answer: A

Concept: To count numbers satisfying a digit condition ('contains 2'), it is usually easier to use the complement method: (numbers that contain 2) = (total numbers) − (numbers that do NOT contain 2).

  1. Total 4-digit numbers: they range from 1000 to 9999, so total = 9999 − 1000 + 1 = 9000.

  2. Count 4-digit numbers with NO digit equal to 2: the leading digit (thousands place) cannot be 0 or 2, so it has 8 choices (1,3,4,5,6,7,8,9); each of the remaining three digits cannot be 2, so each has 9 choices (0,1,3,4,5,6,7,8,9).

  3. So numbers with no digit 2 = 8 × 9 × 9 × 9 = 5832.

  4. Numbers that contain at least one digit 2 = Total − (numbers with no 2) = 9000 − 5832 = 3168.

Cross-check: 5832 (no 2) + 3168 (contains 2) = 9000, which matches the total, confirming the result.

Explore the full course: Infosys Preparation