Names for tuples of specific lengths
   HOME

TheInfoList



OR:

In mathematics, a tuple is a finite ordered list (
sequence In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is calle ...
) of elements. An -tuple is a
sequence In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is calle ...
(or ordered list) of elements, where is a non-negative
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
. There is only one 0-tuple, referred to as ''the empty tuple''. An -tuple is defined inductively using the construction of an ordered pair. Mathematicians usually write tuples by listing the elements within parentheses "" and separated by a comma and a space; for example, denotes a 5-tuple. Sometimes other symbols are used to surround the elements, such as square brackets " nbsp; or angle brackets "⟨ ⟩". Braces "" are used to specify
array An array is a systematic arrangement of similar objects, usually in rows and columns. Things called an array include: {{TOC right Music * In twelve-tone and serial composition, the presentation of simultaneous twelve-tone sets such that the ...
s in some programming languages but not in mathematical expressions, as they are the standard notation for sets. The term ''tuple'' can often occur when discussing other mathematical objects, such as vectors. In
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includi ...
, tuples come in many forms. Most typed
functional programming In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that ...
languages implement tuples directly as
product type In programming languages and type theory, a product of ''types'' is another, compounded, type in a structure. The "operands" of the product are types, and the structure of a product type is determined by the fixed order of the operands in the prod ...
s, tightly associated with
algebraic data type In computer programming, especially functional programming and type theory, an algebraic data type (ADT) is a kind of composite type, i.e., a type formed by combining other types. Two common classes of algebraic types are product types (i.e., ...
s,
pattern matching In computer science, pattern matching is the act of checking a given sequence of tokens for the presence of the constituents of some pattern. In contrast to pattern recognition, the match usually has to be exact: "either it will or will not be ...
, and destructuring assignment. Many programming languages offer an alternative to tuples, known as record types, featuring unordered elements accessed by label. A few programming languages combine ordered tuple product types and unordered record types into a single construct, as in C structs and Haskell records. Relational databases may formally identify their rows (records) as ''tuples''. Tuples also occur in
relational algebra In database theory, relational algebra is a theory that uses algebraic structures with a well-founded semantics for modeling data, and defining queries on it. The theory was introduced by Edgar F. Codd. The main application of relational algebr ...
; when programming the semantic web with the Resource Description Framework (RDF); in
linguistics Linguistics is the science, scientific study of human language. It is called a scientific study because it entails a comprehensive, systematic, objective, and precise analysis of all aspects of language, particularly its nature and structure ...
; and in philosophy.


Etymology

The term originated as an abstraction of the sequence: single, couple/double, triple, quadruple, quintuple, sextuple, septuple, octuple, ..., ‑tuple, ..., where the prefixes are taken from the
Latin Latin (, or , ) is a classical language belonging to the Italic branch of the Indo-European languages. Latin was originally a dialect spoken in the lower Tiber area (then known as Latium) around present-day Rome, but through the power of the ...
names of the numerals. The unique 0-tuple is called the ''null tuple'' or ''empty tuple''. A 1‑tuple is called a ''single'' (or ''singleton''), a 2‑tuple is called an ''ordered pair'' or ''couple'', and a 3‑tuple is called a ''triple'' (or ''triplet''). The number can be any nonnegative
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
. For example, a
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the fo ...
can be represented as a 2‑tuple of reals, a quaternion can be represented as a 4‑tuple, an
octonion In mathematics, the octonions are a normed division algebra over the real numbers, a kind of hypercomplex number system. The octonions are usually represented by the capital letter O, using boldface or blackboard bold \mathbb O. Octonions hav ...
can be represented as an 8‑tuple, and a
sedenion In abstract algebra, the sedenions form a 16-dimensional noncommutative and nonassociative algebra over the real numbers; they are obtained by applying the Cayley–Dickson construction to the octonions, and as such the octonions are isomorphic to ...
can be represented as a 16‑tuple. Although these uses treat ''‑uple'' as the suffix, the original suffix was ''‑ple'' as in "triple" (three-fold) or "decuple" (ten‑fold). This originates from medieval Latin ''plus'' (meaning "more") related to Greek language, Greek ‑πλοῦς, which replaced the classical and late antique ''‑plex'' (meaning "folded"), as in "duplex".


Names for tuples of specific lengths

Note that for n \geq 3, the tuple name in the table above can also function as a verb meaning "to multiply [the direct object] by n"; for example, "to quintuple" means "to multiply by 5". If n = 2, then the associated verb is "to double". There is also a verb "sesquiple", meaning "to multiply by 3/2". Theoretically, "monuple" could be used in this way too.


Properties

The general rule for the identity of two -tuples is : (a_1, a_2, \ldots, a_n) = (b_1, b_2, \ldots, b_n) if and only if a_1=b_1,\texta_2=b_2,\text\ldots,\texta_n=b_n. Thus a tuple has properties that distinguish it from a Set (mathematics), set: # A tuple may contain multiple instances of the same element, so
tuple (1,2,2,3) \neq (1,2,3); but set \ = \. # Tuple elements are ordered: tuple (1,2,3) \neq (3,2,1), but set \ = \. # A tuple has a finite number of elements, while a set or a multiset may have an infinite number of elements.


Definitions

There are several definitions of tuples that give them the properties described in the previous section.


Tuples as functions

The 0-tuple may be identified as the Function (mathematics)#General properties, empty function. For n \geq 1, the n-tuple \left(a_1, \ldots, a_n\right) may be identified with the (Surjective function, surjective) Function (mathematics)#Definition, function :F ~:~ \left\ ~\to~ \left\ with Domain of a function, domain :\operatorname F = \left\ = \left\ and with codomain :\operatorname F = \left\, that is defined at i \in \operatorname F = \left\ by :F(i) := a_i. That is, F is the function defined by :\begin 1 \;&\mapsto&&\; a_1 \\ \;&\;\;\vdots&&\; \\ n \;&\mapsto&&\; a_n \\ \end in which case the equality :\left(a_1, a_2, \dots, a_n\right) = \left(F(1), F(2), \dots, F(n)\right) necessarily holds. ;Tuples as sets of ordered pairs Functions are commonly identified with their Graph of a function, graphs, which is a certain set of ordered pairs. Indeed, many authors use graphs as the definition of a function. Using this definition of "function", the above function F can be defined as: :F ~:=~ \left\.


Tuples as nested ordered pairs

Another way of modeling tuples in Set Theory is as nested ordered pairs. This approach assumes that the notion of ordered pair has already been defined. # The 0-tuple (i.e. the empty tuple) is represented by the empty set \emptyset. # An -tuple, with , can be defined as an ordered pair of its first entry and an -tuple (which contains the remaining entries when : #: (a_1, a_2, a_3, \ldots, a_n) = (a_1, (a_2, a_3, \ldots, a_n)) This definition can be applied recursively to the -tuple: : (a_1, a_2, a_3, \ldots, a_n) = (a_1, (a_2, (a_3, (\ldots, (a_n, \emptyset)\ldots)))) Thus, for example: : \begin (1, 2, 3) & = (1, (2, (3, \emptyset))) \\ (1, 2, 3, 4) & = (1, (2, (3, (4, \emptyset)))) \\ \end A variant of this definition starts "peeling off" elements from the other end: # The 0-tuple is the empty set \emptyset. # For : #: (a_1, a_2, a_3, \ldots, a_n) = ((a_1, a_2, a_3, \ldots, a_), a_n) This definition can be applied recursively: : (a_1, a_2, a_3, \ldots, a_n) = ((\ldots(((\emptyset, a_1), a_2), a_3), \ldots), a_n) Thus, for example: : \begin (1, 2, 3) & = (((\emptyset, 1), 2), 3) \\ (1, 2, 3, 4) & = ((((\emptyset, 1), 2), 3), 4) \\ \end


Tuples as nested sets

Using ordered pair#Kuratowski's definition, Kuratowski's representation for an ordered pair, the second definition above can be reformulated in terms of pure set theory: # The 0-tuple (i.e. the empty tuple) is represented by the empty set \emptyset; # Let x be an -tuple (a_1, a_2, \ldots, a_n), and let x \rightarrow b \equiv (a_1, a_2, \ldots, a_n, b). Then, x \rightarrow b \equiv \. (The right arrow, \rightarrow, could be read as "adjoined with".) In this formulation: : \begin () & & &=& \emptyset \\ & & & & \\ (1) &=& () \rightarrow 1 &=& \ \\ & & &=& \ \\ & & & & \\ (1,2) &=& (1) \rightarrow 2 &=& \ \\ & & &=& \ \\ & & & & \\ (1,2,3) &=& (1,2) \rightarrow 3 &=& \ \\ & & &=& \ \\ \end


-tuples of -sets

In discrete mathematics, especially combinatorics and finite probability theory, -tuples arise in the context of various counting problems and are treated more informally as ordered lists of length . -tuples whose entries come from a set of elements are also called ''arrangements with repetition'', ''Permutation#Permutations_of_multisets, permutations of a multiset'' and, in some non-English literature, ''variations with repetition''. The number of -tuples of an -set is . This follows from the combinatorial rule of product. If is a finite set of cardinality , this number is the cardinality of the -fold Cartesian product#n-ary Cartesian power, Cartesian power . Tuples are elements of this product set.


Type theory

In type theory, commonly used in programming languages, a tuple has a
product type In programming languages and type theory, a product of ''types'' is another, compounded, type in a structure. The "operands" of the product are types, and the structure of a product type is determined by the fixed order of the operands in the prod ...
; this fixes not only the length, but also the underlying types of each component. Formally: : (x_1, x_2, \ldots, x_n) : \mathsf_1 \times \mathsf_2 \times \ldots \times \mathsf_n and the Projection (mathematics), projections are term constructors: : \pi_1(x) : \mathsf_1,~\pi_2(x) : \mathsf_2,~\ldots,~\pi_n(x) : \mathsf_n The tuple with labeled elements used in the relational model has a Record (computer science), record type. Both of these types can be defined as simple extensions of the simply typed lambda calculus. The notion of a tuple in type theory and that in set theory are related in the following way: If we consider the natural model theory, model of a type theory, and use the Scott brackets to indicate the semantic interpretation, then the model consists of some sets S_1, S_2, \ldots, S_n (note: the use of italics here that distinguishes sets from types) such that: : [\![\mathsf_1]\!] = S_1,~[\![\mathsf_2]\!] = S_2,~\ldots,~[\![\mathsf_n]\!] = S_n and the interpretation of the basic terms is: : [\![x_1]\!] \in [\![\mathsf_1]\!],~[\![x_2]\!] \in [\![\mathsf_2]\!],~\ldots,~[\![x_n]\!] \in [\![\mathsf_n]\!]. The -tuple of type theory has the natural interpretation as an -tuple of set theory:Steve Awodey
''From sets, to types, to categories, to sets''
2009, preprint
: [\![(x_1, x_2, \ldots, x_n)]\!] = (\,[\![x_1]\!], [\![x_2]\!], \ldots, [\![x_n]\!]\,) The unit type has as semantic interpretation the 0-tuple.


See also

* Arity * Coordinate vector * Exponential object * Formal language * Multidimensional Expressions#MDX data types, OLAP: Multidimensional Expressions * Prime k-tuple, Prime ''k''-tuple * Relation (mathematics) * Sequence * Tuplespace


Notes


References


Sources

* * Keith Devlin, ''The Joy of Sets''. Springer Verlag, 2nd ed., 1993, , pp. 7–8 * Abraham Adolf Fraenkel, Yehoshua Bar-Hillel, Azriel Lévy,
Foundations of school Set Theory
', Elsevier Studies in Logic Vol. 67, 2nd Edition, revised, 1973, , p. 33 * Gaisi Takeuti, W. M. Zaring, ''Introduction to Axiomatic Set Theory'', Springer Graduate Texts in Mathematics, GTM 1, 1971, , p. 14 * George J. Tourlakis,
Lecture Notes in Logic and Set Theory. Volume 2: Set Theory
', Cambridge University Press, 2003, , pp. 182–193


External links

* {{Authority control Data management Mathematical notation Sequences and series Basic concepts in set theory Type theory