Informally, a **relation** is a rule that describes how elements of a set relate, or interact, with elements of another set. Relations can include, but are not limited to, familial relations (Person A is Person B's mother; or Person A and Person B have the same last name), geographic relations (State A shares a border with State B), and numerical relations ($ A=B $; or $ x \leq y $).

A **relation **is also a set of ordered tuples.

A **relation** from (or on) sets $ S_1,\ldots,S_n $ is any subset of the Cartesian product $ S_1 \times \ldots \times S_n $.

For example, if we let $ S $ be the set of all cities, and $ T $ the set of all U.S. States, we can define a relation $ R $ to be the the set of ordered pairs $ (s,t) $ for which the city $ s $ is in the state $ t $.

See also total order.

## Binary relation

If a set is a subset of a cartesian product of two sets A and B, it is called a binary relation on A and B. If a set is a subset of a cartesian square $ S^2 $, then it is said to be a binary relation on S.

## Notation

As a relation $ \sim $ from a set $ S $ to a set $ T $ is formally viewed as a subset of the Cartesian product $ S \times T $, the expression $ \left(s,t\right)\in \sim $ is a valid mathematical expression. However, such an expression can be cumbersome to write, and so we may adopt the alternate notation $ s \sim t $. Another possible notaton is $ \sim(x,y) $.