1

how many numbers are there between 100 and 1000 such that at least one of their digits is 7?? I solved this question by making 3 cases(as 3 digit numbers are to be made) but i am not getting the right answer-- (the question says at least one 7 that means there can be 7 at other places also)-- case 1--[fixing the unit digit as 7 we want numbers of the form (xy7)] so no of ways =m×n=9×10×1=90; case 2-[fixing the tenth digit as 7 i.e (x7y)] no of ways=9×1×10=90; case 3--[fixing the hundredth place as 7 i.e (7xy)] no of ways =1×10×10=100; sum of all three =280; but the answer is given 252; now I know that when I am calculating ways then some numbers are getting repeated 777 for example so I have to subtract such numbers from 280 but how will I calculate how many numbers are repeating in this process so I can subtract them.

2 Answers2

3

Denote the number by $abc$, where $a$ is left-most digit.

Let $A = \{abc| a = 7\}$, $B = \{abc| b = 7\}$, $C = \{abc| c = 7\}$. At least one of $a, b,$ or $c = 7$ is to count the union of these sets.

Thus, by the principle of Inclusion-Exclusion,

$$|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|$$

enter image description here

Include $|A| = 100$ (since bc range from 00 to 99), $|B| = 90 $(ac from 10 to 99), $|C| = 90$.

Exclude $|A \cap B| = 10$ (as c ranges from 0 to 9)., $|A \cap C| = 10$, and $|B \cap C| = 9$ (as $a$ ranges from 1 to 9).

Finally, include again $|A \cap B \cap C| = 1$ choice.

Therefore, there are 252 numbers.

Weaam
  • 2,849
0

Easier to count how many numbers are possible avoiding the digit 7. Call that $x$. Now subtract this $x$ from 900.

  • This got it!! But wanted to know how should I correct my solution. – Freelancer Oct 10 '15 at 07:56
  • I mean I agree that if you can solve the question in two lines why stretch it?? But still its not like this question is the last question of my life and I should solve it quickly.. So I just wanted to know how should I proceed after I solved half the question by my method – Freelancer Oct 10 '15 at 07:56