$[$ Inclusion-Exclusion Principle $]$

Petya plans to spend all 90 days of his vacation in the village and during this time, he will go swimming every second day (i.e., every other day), go to the store for groceries every third day, and solve math problems every fifth day. (On the first day, Petya did the first, second, and third activities and got very tired.) How many "pleasant" days will Petya have, when he needs to go swimming but does not need to go to the store or solve math problems? How many "boring" days will there be when he has no activities at all?
Let's number the days from 0 to 89. Petya swims on days with even numbers, goes to the store on days with numbers divisible by 3, and solves problems on days with numbers divisible by 5.

Thus, we need to answer two questions:

1) How many even numbers from 0 to 89 are not divisible by either 3 or 5?
2) How many odd numbers from 0 to 89 are not divisible by either 3 or 5?

The answers to these questions are the same. Indeed, let's divide our numbers into pairs with a difference of 45: \{0, 45\}, \{1, 46\}, \ldots, \{44, 89\}. In each pair, there are two numbers of different parity, and if one number in the pair is not divisible by 3 or 5, then the other is also not divisible by 3 or 5.

Therefore, it is sufficient to answer question 1).

Notice that there are exactly half as many even numbers from 0 to 89, which is 45. Of these, every third number is divisible by 3 (a total of 15 numbers), every fifth number is divisible by 5 (9 numbers), and every fifteenth number is divisible by 15 (3 numbers). Thus, the number of even numbers that are divisible by either 3 or 5 is $15 + 9 - 3 = 21$ (we subtract 3 because in the sum $15 + 9$ the numbers divisible by 15 are counted twice). Therefore, the number of numbers of interest to us is $45 - 21 = 24$.

Submit a comment