3

Here, I tried guessing possibilities of the following problem. Consider the set $\{100, 101, \ldots, 110\}$. All these are desirable and there are $11$ elements in this set. Now consider $\{115, 116, \ldots, 195\}$, here if we consider the finite arithmetic progression $115,120,125,\ldots,195$ of $17$ terms, none of them is desirables. So from $100$ to $195$ there are $28$ desirable numbers. Similarly, from $200$ to $295$ there are $28$ desirable numbers. Between $300$ and $395$ there are also $28$ desirable numbers.

And so on... But every integer between $500$ and $599$ is also desirable, so there are $100$ more desirable numbers.

So we can say that the required answer would be $28 \cdot 8+100=324$.

But in answer key, the correct answer is $388$. Where did I go wrong?

Marco Ripà
  • 1,062
  • 2
  • 19
  • It is hard to follow your approach. To be clear, have you remembered to include $151, 152, 153, 154,\dots$? – JMoravitz Jan 08 '24 at 14:59
  • 5
    There are $900$ three-digit integers. Of these $8\times 8\times 8$ have no $0$'s and no $5$'s. Since we want the opposite, numbers that have at least one 0 or at least one 5 this gives $900 - 8^3 = 388$, requiring mere seconds to arrive at. I feel your approach made things much harder than they needed to be, possibly taking a minute or more. – JMoravitz Jan 08 '24 at 15:01
  • I attempted to rewrite your question in a proper form, using LaTex. Please, try to do the same for future questions. – Marco Ripà Jan 08 '24 at 15:07
  • As mentioned by JMoravitz[https://math.stackexchange.com/users/179297/jmoravitz], when you get a question, like "How many numbers are there who contain ... (or ...)", best is to ask yourself "How many do not contain?" and subtract this from the total amount. – Dominique Jan 08 '24 at 15:22
  • Another approach would be to consider that there are $100$ three-digit numbers starting with a $5$, and for each digit $d \in {1,2,3,4,6,7,8,9}$, there are $36$ three-digit numbers starting with a $d$ where at least one of the last two digits is a $0$ or a $5$. This gives $100+(8)(36)=388$ possible numbers. – Geoffrey Trang Jan 08 '24 at 15:26
  • @GeoffreyTrang that is literally the OP's approach, but where they mistakenly thought there were 28 rather than 36 such numbers for each case (again, because of forgetting to consider the second digit). – JMoravitz Jan 08 '24 at 15:56

3 Answers3

1

Where did I go wrong?

"Now consider $\{115,116,…,195\}$ , here if we consider the finite arithmetic progression $115,120,125,…,195$ of $\color{red}{17}$ terms"

Wrong. Because, $\color{green}{\{151,152,153,154\}} \, \& \, \color{green}{\{156,157,158,159\}}$ i.e $8$ terms are also eligible. So. there is total $17+8=25$ eligible terms not $17$ in $\{115,116,…,195\}$.

Now, you can count $(25+11)\cdot 8+100=388$

O M
  • 2,094
0

Inclusion Exclusion works here.

There are exactly $~900~$ numbers (i.e. elements) between $~100~$ and $~999,~$ inclusive. Let $~S~$ denote the set $~\{1,2,\cdots,999\}.$

For $~k \in \{1,2,3\},~$ let $~S_k~$ denote the subset of such elements that have a [0 or 5] in column $~k,~$ of the 3 digit number.

Then, you want $~|S_1 \cup S_2 \cup S_3|.~$


See this article for an introduction to Inclusion-Exclusion. Then, see this answer for an explanation of and justification for the Inclusion-Exclusion formula.

So, the desired computation is

$$|S_1| + |S_2| + |S_3| \\ - \left\{ ~|S_1 \cap S_2| + |S_1 \cap S_3| + |S_2 \cap S_3| ~\right\} \\ + |S_1 \cap S_2 \cap S_3|.$$

Clearly $~S_3~$ which focuses on the rightmost column has $~\dfrac{900}{5} = 180~$ elements, since a number has $~0~$ or $~5~$ in its rightmost column if and only if it is divisible by $~5.~$

By symmetrical considerations, $~|S_2|~$ is also equal to $~180.~$

Similarly, since each element in $~S~$ can not have a $~0,~$ in its leftmost column, $~|S_1|~$ must equal $~\dfrac{|S|}{9} = 100.~$

Therefore, $~|S_1| + |S_2| + |S_3| = 460.~$

In considering the subset $~S_1 \cap S_2,~$ the coordination between $~0,5~$ in column-3 with $~0,5~$ in column-2 is random. So, you must have that $~|S_1 \cap S_2| = |S| \times \frac{1}{5} \times \frac{1}{5} = 36.$

Similarly, both $~|S_1 \cap S_3|~$ and $~|S_2 \cap S_3|~$ must equal $~|S| \times \frac{1}{5} \times \frac{1}{9} = 20.$

Therefore, $~|S_1 \cap S_2| + |S_1 \cap S_3| + |S_2 \cap S_3| = 76.~$

Similarly, $~|S_1 \cap S_2 \cap S_3| = |S| \times \frac{1}{5} \times \frac{1}{5} \times \frac{1}{9} = 4.~$

Therefore, the final computation is

$$[460 - 76] + 4 = 388.$$

user2661923
  • 35,619
  • 3
  • 17
  • 39
0

What you're doing is equivalent to considering three positions

$$—~—~—$$

and asking yourself how many possibilities are there where you can place digits from $0$ to $9$ in each position with the mentioned restrictions.

Well, we can't fix $0$ on the first position, but you can fix $1$ (as you did in your first and second sets), so now we have to count how many desirable possibilities are there for the other two digits with the first fixed at $1$. Well, if we fix $0$ on position two, we are left with $10$ possibilities for the last one, and each is desirable because we have at least $0$, and the same occurs if you fix $5$ ($10$ more possibilities).

$$\overset{1}{—} ~ \overset{0}{—} ~ \overset{p_3}{—} ~~~ : ~~~ 10 ~ \text{choices}$$

$$\overset{1}{—} ~ \overset{5}{—} ~ \overset{p_3}{—} ~~~ : ~~~ 10 ~ \text{choices}$$

For the rest of the choices of the middle position, we always get two desirable choices for the last one ($0$ or $5$), and since there are $8$ more such choices for the middle (we already used $0$ and $5$), we have $8\cdot 2=16$ remaining possibilities. Adding them gives $2\cdot 10+16=36$, not $28$.

Now, if you choose any other digit for the first position (other than $5$), you'll get the same number of possibilities as you got with $1$, but since $0$ is not allowed (and $5$ a special one), we have $8$ choices, and therefore $8\cdot 36=288$ possibilities.

To address $5$ in the first position is easy, because any choice of the other two digits is desirable, and we have $10$ choices for the second and third positions, totalizing $10\cdot 10=100$ possibilities when $5$ is fixed.

Adding everything gives $288+100=388$.