All courses › Discrete Mathematics › Sets

Sets

A set is a collection of distinct elements. The union contains everything that is in at least one of the sets, and the intersection what is in both. The size of a union is found by inclusion and exclusion, so nobody is counted twice.

A∪BA \cup Bunion: in A or B
A∩BA \cap Bintersection: in both A and B
∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|inclusion and exclusion

Symbols

∣A∣|A|number of elements in A
∈\inis an element of
∅\emptysetempty set

Example

30 students take maths, 20 physics and 12 both:

∣M∪F∣=30+20−12=38|M \cup F| = 30 + 20 - 12 = 38.

Subtract the intersection, or you count those in both twice.
Practise logic and sets for free →

← De Morgan's laws · The multiplication principle →

Part of Discrete Mathematics: Logic and sets.