Ordered Pairs and Tuples
Ordered pairs and tuples are fundamental concepts in set theory and computer science.
They describe how multiple elements can be grouped where the order matters. This is an important difference from ordinary sets, where the order does not matter.
Ordered pair
An ordered pair is a collection of two elements, written as \( \large (a,b)\). Here the order matters: \( \large (a,b) \neq (b,a)\), unless \( \large a = b\).
Examples:
- \( \large (1,2) \neq (2,1)\)
- \( \large (x,y) \) and \( \large (y,x)\) are different if \( \large x \neq y\).
Ordered pairs are used to describe coordinates in the plane, e.g. the point \( \large (3,5)\) in a coordinate system.
Tuples
A tuple is a generalization of the ordered pair to more elements. A 3-tuple has the form \( \large (a,b,c)\), a 4-tuple has the form \( \large (a,b,c,d)\), etc.
Examples:
- \( \large (1,2,3)\) is a 3-tuple.
- \( \large (x,y,z)\) can describe a point in space \( \large \mathbb{R}^3\).
- \( \large (name, age, city)\) can be a tuple in a database.
The difference between tuples and sets
It is important to distinguish between sets and tuples:
- In a set, the order does not matter: \( \large \{1,2\} = \{2,1\}\).
- In a tuple, the order is crucial: \( \large (1,2) \neq (2,1)\).
- In a set, repetitions are not counted, but in tuples one can have e.g. \( \large (a,a)\).
Meaning and applications
Ordered pairs and tuples are used in many areas of mathematics and computer science:
- Coordinates in geometry (\( \large (x,y)\), \( \large (x,y,z)\)).
- Cartesian products (\( \large A \times B\) consist of ordered pairs).
- Graphs, where edges can be described as ordered pairs of nodes.
- Databases, where rows can be regarded as tuples.
Tuples thus provide a flexible way to structure information, where both the order and the number of elements matter.