Maths · Simple applications

How many integers with at least one eight and at least one nine as digits are th

How many integers with at least one eight and at least one nine as digits are there between 1 and 10000

  • A. 800
  • B. 974
  • C. 900 \)
  • D. 875

Step-by-step solution

Treat numbers from 0 to 9999 as 4-digit strings (including leading zeros). Total strings = 10^4 = 10000. Let A be strings with no '8', |A|=9^4=6561. Let B be strings with no '9', |B|=9^4=6561. Intersection (no 8 and no 9): 8^4=4096. By inclusion-exclusion, strings with at least one 8 and at least one 9 = 10000 - (6561+6561-4096) = 974. Since 0 (0000) does not have both, this count applies to 1-9999 as well, and 10000 has no 8 or 9. Thus answer is 974.
Practise more in this unitView MCQsSign up for full question bank