From the universal set {1,2,...,100},
A = the subset of multiples of 5
B = the subset of multiples of 8
A and B = the subset of multiples of both 5 and 8, i.e.,
multiples of 40
N(A or B) = N(A) + N(B) - N(A and B)
There are 100/5 = 20 multiples of 5, so N(A) = 20
There are 100/8 = 12.5, round down to 12 multiples of 8,
so N(B) = 12
There are 100/40 = 2.5, round down to 2 multiples of 40,
so N(A and B) = 2
N(A or B) = N(A) + N(B) - N(A and B) = 20 + 12 - 2 = 30
Edwin