Here is an excellent demonstration of the

Inclusion Exclusion Principle.

Let

B be the set of all integers from 1 to 1000 divisible by 3

C be the set of all integers from 1 to 1000 divisible by 5

By the Inclusion Exclusion Principle we have,

|B u C|=|B| + |C| - |B n C|

Now,

|B n C| is the set of all numbers divisible by 3 and 5. Since gcd (3,5)=1 it is equivalent to saying divisible by 15.

Let us count number of such integers,

15,30,45,...,990

Or in more elegant form,

15(1),15(2),15(3),...,15(66)

We can easily see 66 such integers exist

Thus,

|B n C|=66.

You can easily find that,

|B|=333

|C|=200

Thus,

|B u C|=333+200-66=467