
Mehmet D. answered 02/22/23
PhD student with 5 years of experience in tutoring Discrete Math
To count the number of integers between 1 and 7000 that are divisible by 2, 5, or 7, we use the principle of inclusion-exclusion. Let A, B, and C be the sets of integers between 1 and 7000 that are divisible by 2, 5, and 7, respectively.
We can use the formula:
|A ∪ B ∪ C| = |A| + |B| + |C| - |A ∩ B| - |A ∩ C| - |B ∩ C| + |A ∩ B ∩ C|
where |X| denotes the cardinality (number of elements) of set X.
Using the formula, we have:
|A| = ⌊7000/2⌋ = 3500
|B| = ⌊7000/5⌋ = 1400
|C| = ⌊7000/7⌋ = 1000
|A ∩ B| = ⌊7000/10⌋ = 700
|A ∩ C| = ⌊7000/14⌋ = 500
|B ∩ C| = ⌊7000/35⌋ = 200
|A ∩ B ∩ C| = ⌊7000/70⌋ = 100
Substituting the values into the formula, we get:
|A ∪ B ∪ C| = 3500 + 1400 + 1000 - 700 - 500 - 200 + 100 = 4600
Therefore, there are 4600 integers between 1 and 7000 that are divisible by 2, 5, or 7.
We subtract certain numbers from the sum of the three sets of numbers because some numbers are being counted twice. For example, the numbers that are divisible by both 2 and 5 are being counted once in set A and once in set B. Similarly, the numbers that are divisible by both 2 and 7 are being counted once in set A and once in set C, and the numbers that are divisible by both 5 and 7 are being counted once in set B and once in set C.
To correct for this double counting, we need to subtract the numbers that are being counted twice. However, we must also be careful not to subtract them more than once. This is why we add back the numbers that are divisible by all three divisors, as they were subtracted twice in the above calculations.
By subtracting the appropriate numbers and adding them back where necessary, we get the correct count of integers between 1 and 7000 that are divisible by 2, 5, or 7.