Definition (Union): The union of sets A and B, denoted by A union B , is the set defined as

             A union B = { x | x in A or x in B }

Example 1: If A = {1, 2, 3} and B = {4, 5} ,  then A union B = {1, 2, 3, 4, 5} .

Example 2: If A = {1, 2, 3} and B = {1, 2, 4, 5} ,  then A union B = {1, 2, 3, 4, 5} .

Note that elements are not repeated in a set.

Definition (Intersection): The intersection of sets A and B, denoted by A intersection B , is the set defined as

             A intersection B = { x | x in A and x in B }

Example 3: If A = {1, 2, 3} and B = {1, 2, 4, 5} ,  then A intersection B = {1, 2} .

Example 4: If A = {1, 2, 3} and B = {4, 5} ,  then A intersection B = emptyset .

Definition (Difference): The difference of sets A from B , denoted by A - B (or A \ B), is the set defined as

             A - B = { x | x in A and x not in B }

Example 5: If A = {1, 2, 3} and B = {1, 2, 4, 5} ,  then A - B = {3} .

Example 6: If A = {1, 2, 3} and B = {4, 5} ,  then A - B = {1, 2, 3} .

Note that in general A - B not equals B - A

Definition (ordered pair): An ordered pair is a pair of objects with an order associated with them.
If objects are represented by x and y, then we write the ordered pair as (x, y).

Two ordered pairs (a, b) and (c, d) are equal if and only if a = c and b = d. For example the ordered pair (1, 2) is not equal to the ordered pair (2, 1).

Definition (Cartesian product): The set of all ordered pairs (a, b), where a is an element of A and b is an element of B, is called the Cartesian product of A and B and is denoted by A cross B.
Example 1: Let A = {1, 2, 3} and B = {a, b}. Then
A cross B = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b)} .

Example 2: For the same A and B as in Example 1,
B cross A = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)} .

As you can see in these examples, in general, A cross B not equals B cross A unless A = emptyset , B = emptyset or A = B.
Note that A cross emptyset = emptyset cross A = emptyset because there is no element in emptyset to form ordered pairs with elements of A.

The concept of Cartesian product can be extended to that of more than two sets. First we are going to define the concept of ordered n-tuple.

Definition (ordered n-tuple): An ordered n-tuple is a set of n objects with an order associated with them . If n objects are represented by x1, x2, ..., xn, then we write the ordered n-tuple as (x1, x2, ..., xn) .

Definition (Cartesian product): Let A1, ..., An be n sets. Then the set of all ordered n-tuples (x1, ..., xn) , where xi in Ai for all i, 1 less or equal i less or equal n , is called the Cartesian product of A1, ..., An, and is denoted by A1 cross ... cross An .

Example 3:
Let A = {1, 2}, B = {a, b} and C = {5, 6}. Then
A cross B cross C = {(1, a, 5), (1, a, 6), (1, b, 5), (1, b, 6), (2, a, 5), (2, a, 6), (2, b, 5), (2, b, 6)} .

Definition (equality of n-tuples): Two ordered n-tuples (x1, ..., xn) and (y1, ..., yn) are equal if and only if xi = yi for all i, 1 less or equal i less or equal n .
For example the ordered 3-tuple (1, 2, 3) is not equal to the ordered n-tuple (2, 3, 1).

Definition (binary relation):
A binary relation from a set A to a set B is a set of ordered pairs (a, b) where a is an element of A and b is an element of B.
When an ordered pair (a, b) is in a relation R, we write a R b, or (a, b) in R. It means that element a is related to element b in relation R.
When A = B, we call a relation from A to B a (binary) relation on A .

Examples:
If A = {1, 2, 3} and B = {4, 5}, then {(1, 4), (2, 5), (3, 5)}, for example, is a binary relation from A to B.
However, {(1, 1), (1, 4), (3, 5)} is not a binary relation from A to B because 1 is not in B.
The parent-child relation is a binary relation on the set of people. (John, John Jr.), for example, is an element of the parent-child relation if John is the father of John Jr.