Overview
In mathematics, a tuple is a finite ordered collection of elements. It is often called an ordered list or finite sequence; the phrase finite sequence emphasizes that both order and length are fixed. Tuples are commonly written using parentheses, for example (1, 2) , or using angle brackets, for example ⟨1, 2⟩ , depending on context and author preference.
Notation and basic properties
An n-tuple is a tuple with exactly n components and is sometimes named by placing a numeral before the suffix "-tuple" (for example, a 2-tuple is a pair, a 3-tuple is a triple). Each position in a tuple is identified by its index, normally starting at 1 in mathematical contexts. Key properties of tuples include:
- Order matters: (a, b) is generally different from (b, a) unless a = b.
- Repetition allowed: the same element may appear multiple times, so (a, a, b) is a valid tuple distinct from (a, b).
- Fixed length: an n-tuple has precisely n components; length is part of the tuple's identity.
Relation to other concepts
Tuples are closely related to Cartesian products: the Cartesian product of sets A1 × A2 × … × An is the set of all n-tuples whose i-th entry lies in Ai. This connection makes tuples useful for coordinatizing product spaces and for describing points in Euclidean space. Tuples differ from sets chiefly because sets ignore order and multiplicity, and they are distinct from multisets because multisets still disregard order; tuples are most like ordered multisets, retaining both multiplicity and sequence information (multiset captures only multiplicity).
Uses and examples
Tuples appear across mathematics and computer science. In algebra and geometry they represent coordinates, solutions of systems, and elements of product structures. In logic and type theory an n-ary relation is a set of n-tuples. In practical computing, tuples model fixed collections of values: database systems commonly call rows "tuples" (databases) and programming languages provide tuple types to group heterogenous values without creating a custom record type.
Tuples in programming and databases
Many languages support tuples in different ways. Some treat tuples as immutable, fixed-length heterogenous containers (for example, a two-element tuple of a string and a number). Others emulate tuples using arrays or record structures. In database theory a relation is defined as a set of tuples; each tuple corresponds to one row with a fixed set of attributes. Tuples therefore play a central role in schema design, query results, and constraints.
Operations, distinctions and notable facts
Common operations on tuples include indexing (access by position), projection (selecting a subtuple by specified positions), concatenation (joining two tuples to form a longer tuple), and equality testing (tuples are equal when they have equal length and equal components in corresponding positions). Tuples should not be confused with sequences that are infinite, or with lists in programming languages that may be mutable and variable in length. Historically, the idea of an ordered n-tuple grew from practices of naming pairs and triples; the general term and the notation for n-tuples provide a concise way to talk about fixed-size ordered data in both theoretical and applied contexts. For further reading on formal definitions and variants, see introductions in algebra and type theory resources (angle bracket notation and other conventions) and surveys on collection types in programming languages (mathematics, sequence).
The concise, position-aware nature of tuples makes them a fundamental construction when order and cardinality both matter.