How many of the integers between $1$ and $200$ are odd numbers or divisible by $3$ or divisible by $5$

combinatoricsdiscrete mathematicselementary-number-theoryinclusion-exclusion

How many of the integers between $1$ and $200$ are odd numbers or divisible by $3$ or divisible by $5$?
\begin{align*}
A_1 & = \left\lfloor{\frac{200}{3}} \right\rfloor = 66 && \text{(divisible by $3$)}\\
A_2 & = \left\lfloor{\frac{200}{5}} \right\rfloor = 40 && \text{(divisible by $5$)}\\
A_3 & = \left\lfloor{\frac{200}{2}} \right\rfloor = 100 && \text{(odd)}\\
| A_1 \cap A_2 | & = \left\lfloor{\frac{200}{3 \cdot 5}}\right\rfloor = 13\\
| A_1 \cap A_3 | & = \left\lfloor{\frac{200}{3 \cdot 2}}\right\rfloor = 33\\
| A_2 \cap A_3 | & = \left\lfloor{\frac{200}{5 \cdot 2}} \right\rfloor= 20\\
| A_1 \cap A_2 \cap A_3 | & = \left\lfloor{\frac{200}{5 \cdot 2 \cdot 3}}\right\rfloor = 6
\end{align*}

Therefore, by the principle exclusion inclusion theorem
$= 66 + 40 + 100- (13 + 33 + 20) + 6 = 146$

Is this logically right?

Best Answer

Your answer is incorrect. While it is true that there are positive odd integers less than or equal to $200$, what you have actually calculated with the expression $$\left\lfloor \frac{200}{2} \right\rfloor$$ is the number of even integers less than or equal to $200$. It just so happens that $200 - 100 = 100$. Similarly, there are $$\left\lfloor \frac{200}{2 \cdot 3} \right\rfloor = 33$$ positive integers less than or equal to $200$ that are divisible by both $2$ and $3$, $$\left\lfloor \frac{200}{2 \cdot 5} \right\rfloor = 20$$ positive integers less than or equal to $200$ that are divisible by both $2$ and $5$, and $$\left\lfloor \frac{200}{2 \cdot 3 \cdot 5} \right\rfloor = 6$$ positive integers less than or equal to $200$ that are divisible by $2$, $3$, and $5$.

However, we can work with these numbers.

Let $A$ be the set of positive odd integers less than or equal to $200$ which are odd; let $B$ be the set of positive integers less than or equal to $200$ which are multiples of $3$; let $C$ be the set of positive integers less than or equal to $200$ which are multiples of $5$. Then \begin{align*} |A| & = 200 - \left\lfloor \frac{200}{2} \right\rfloor = 100\\ |B| & = \left\lfloor \frac{200}{3} \right\rfloor = 66\\ |C| & = \left\lfloor \frac{200}{5} \right\rfloor = 40\\ |A \cap B| & = 66 - \left\lfloor \frac{200}{2 \cdot 3} \right\rfloor = 66 - 33 = 33\\ |A \cap C| & = 40 - \left\lfloor \frac{200}{2 \cdot 5} \right\rfloor = 40 - 20 = 20\\ |B \cap C| & = \left\lfloor \frac{200}{3 \cdot 5} \right\rfloor = 13\\ |A \cap B \cap C| & = 13 - \left\lfloor \frac{200}{2 \cdot 3 \cdot 5} \right\rfloor = 7 \end{align*} where we obtain $|A \cap B|$ by subtracting the number of even multiples of $3$ less than or equal to $200$ from the number of positive integer multiples of $3$ which are at most $200$, $|A \cap C|$ by subtracting the number of even multiples of $5$ less than or equal to $200$ from the number of positive integer multiples of $5$ which are at most $200$, and $|A \cap B \cap C|$ by subtracting the number of even multiples of $3$ and $5$ less than or equal to $200$ from the number of positive integer multiples of $3$ and $5$ less than or equal to $200$.

Hence, by the Inclusion-Exclusion Principle, the number of positive integers less than or equal to $200$ which are odd or divisible by $3$ or divisible by $5$ is $$100 + 66 + 40 - 33 - 20 - 13 + 7 = 147$$