Home / Discrete Math

Set Theory

An Introduction to Sets

A very useful concept in mathematics is the idea of the set. A set is essentially a collection of items. Here are some examples of sets:

{1,2,3}(1)\{ 1, 2, 3 \} \tag{1}
{apple,banana,orange}(2)\{ \text{apple}, \text{banana}, \text {orange}\} \tag{2}
{f,g,h}(3)\{ f, g, h \} \tag{3}

Set (1)(1) is a set of the first three natural numbers, set (2)(2) is a set of fruits, and set (3)(3) is a set of mathematical functions.

Set Operations

It is often useful to perform operations on sets to compare them.

The intersection of two sets is a new set that contains elements that are only in both sets. This is denoted using the \cap symbol. For example,

{2,4,6,8,10,12}{3,6,9,12}={6,12}\{2, 4, 6, 8, 10, 12\} \cap \{3, 6, 9, 12\} = \{6, 12\}

The union of two sets is a new set that contains elements that are in either set. This is denoted using the \cup symbol. For example,

{1,2,3}{3,4,5}={1,2,3,4,5}\{1, 2, 3\} \cup \{3, 4, 5\} = \{1, 2, 3, 4, 5\}

Sets and Graphs

Set Builder Notation

{f(x)P(x)}\{f(x) \mid P(x) \}