In mathematics and computer science, a tuple is an ordered list of elements. In set theory, an (ordered) ntuple is a sequence (or ordered list) of n elements, where n is a positive integer. There is also one 0tuple, an empty sequence. An ntuple is defined inductively using the construction of an ordered pair. Tuples are usually written by listing the elements within parentheses '( )' and separated by commas; for example, (2, 7, 4, 1, 7) denotes a 5tuple. Sometimes other delimiters are used, such as brackets '[ ]' or angle brackets '⟨ ⟩'. Braces '{ }' are almost never used for tuples, as they are the standard notation for sets.
Tuples are often used to describe other mathematical objects. In algebra, for example, a ring is commonly defined as a 3tuple (E,+,×), where E is some set, and '+', and '×' are functions from the Cartesian product E×E to E with specific properties. In computer science, tuples are directly implemented as product types in most functional programming languages. More commonly, they are implemented as record types, where the components are labeled instead of being identified by position alone. This approach is also used in relational algebra.
Contents
Origin of name
The term originated as an abstraction of the sequence: single, double, triple, quadruple, quintuple, sextuple, septuple, octuple, ..., n‑tuple, ... The unique 0‑tuple is called the null tuple. A 1‑tuple is called a singleton, a 2‑tuple is called a pair and a 3‑tuple is a triple or triplet. The n can be any nonnegative integer. For example, a complex number can be represented as a 2‑tuple, a quaternion can be represented as a 4‑tuple, an octonion can be represented as an octuple, (many mathematicians write the abbreviation "8‑tuple") and a sedenion can be represented as a 16‑tuple.
Although these uses treat ‑tuple as the suffix, the original suffix was ‑ple as in "decuple", ten‑fold. This originates from a medieval Latin suffix ‑plus, "more", related to Greek ‑πλοῦς, which replaced the classical and late antique ‑plex "folded".^{[1]}
Full article ▸
