Tuple: Difference between revisions
imported>Jochen Burghardt →top: sentence is flawed, and not really necessary |
Rearranged disambiguation hatnotes at the top of the page |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{Short description|Finite ordered list of elements}} | ||
{{ | |||
}} | {{For|the musical term|Tuplet}} | ||
{{Redirect|Octuple|the boat|Octuple scull}} | |||
{{Redirect|Duodecuple|the musical technique|Twelve-tone technique}} | |||
{{Redirect|Sextuple|the sports achievement in association football|Sextuple (association football)}} | |||
In [[mathematics]], a '''tuple''' is a finite [[sequence]] or ''ordered list'' of [[number]]s or, more generally, [[mathematical object]]s, which are called the ''elements'' of the tuple. An '''{{mvar|n}}-tuple''' is a tuple of {{mvar|n}} elements, where {{mvar|n}} is a non-negative [[integer]]. There is only one 0-tuple, called the ''empty tuple''. A 1-tuple and a 2-tuple are commonly called a [[singleton (mathematics)|singleton]] and an [[ordered pair]], respectively. The term ''"infinite tuple"'' is occasionally used for ''"infinite sequences"''. | In [[mathematics]], a '''tuple''' is a finite [[sequence]] or ''ordered list'' of [[number]]s or, more generally, [[mathematical object]]s, which are called the ''elements'' of the tuple. An '''{{mvar|n}}-tuple''' is a tuple of {{mvar|n}} elements, where {{mvar|n}} is a non-negative [[integer]]. There is only one 0-tuple, called the ''empty tuple''. A 1-tuple and a 2-tuple are commonly called a [[singleton (mathematics)|singleton]] and an [[ordered pair]], respectively. The term ''"infinite tuple"'' is occasionally used for ''"infinite sequences"''. | ||
| Line 7: | Line 10: | ||
Tuples are usually written by listing the elements within parentheses "{{math|( )}}" and separated by commas; for example, {{math|(2, 7, 4, 1, 7)}} denotes a 5-tuple. Other types of brackets are sometimes used, although they may have a different meaning.{{efn|[[Square bracket]]s are used for [[matrix (mathematics)|matrices]], including [[row vector]]s. [[Braces (punctuation)|Braces]] are used for [[set (mathematics)|set]]s. Each [[programming language]] has its own convention for the different brackets.}} | Tuples are usually written by listing the elements within parentheses "{{math|( )}}" and separated by commas; for example, {{math|(2, 7, 4, 1, 7)}} denotes a 5-tuple. Other types of brackets are sometimes used, although they may have a different meaning.{{efn|[[Square bracket]]s are used for [[matrix (mathematics)|matrices]], including [[row vector]]s. [[Braces (punctuation)|Braces]] are used for [[set (mathematics)|set]]s. Each [[programming language]] has its own convention for the different brackets.}} | ||
An {{mvar|n}}-tuple can be formally defined as the [[image ( | An {{mvar|n}}-tuple can be formally defined as the [[image (mathematics)|image]] of a [[function (mathematics)|function]] that has the set of the {{mvar|n}} first [[natural number]]s as its [[domain of a function|domain]]. Tuples may be also defined from ordered pairs by a [[recurrence relation|recurrence]] starting from an [[ordered pair]]; indeed, an {{mvar|n}}-tuple can be identified with the ordered pair of its {{math|(''n'' − 1)}} first elements and its {{mvar|n}}th element, for example, <math> | ||
\left( \left( \left( 1,2 \right),3 \right),4 \right)=\left( 1,2,3,4 \right)</math>. | \left( \left( \left( 1,2 \right),3 \right),4 \right)=\left( 1,2,3,4 \right)</math>. | ||
| Line 52: | Line 55: | ||
===Tuples as functions=== | ===Tuples as functions=== | ||
The <math>0</math>-tuple may be identified as the [[Function (mathematics)#General properties|empty function]]. For <math>n \geq 1,</math> the <math>n</math>-tuple <math>\left(a_1, \ldots, a_n\right)</math> may be identified with the | The <math>0</math>-tuple may be identified as the [[Function (mathematics)#General properties|empty function]]. For <math>n \geq 1,</math> the <math>n</math>-tuple <math>\left(a_1, \ldots, a_n\right)</math> may be identified with the [[Surjective function|surjective]] [[Function (mathematics)#Definition|function]] | ||
:<math>F ~:~ \left\{ 1, \ldots, n \right\} ~\to~ \left\{ a_1, \ldots, a_n \right\}</math> | :<math>F ~:~ \left\{ 1, \ldots, n \right\} ~\to~ \left\{ a_1, \ldots, a_n \right\}</math> | ||
| Line 163: | Line 166: | ||
: <math>[\![(x_1, x_2, \ldots, x_n)]\!] = (\,[\![x_1]\!], [\![x_2]\!], \ldots, [\![x_n]\!]\,)</math> | : <math>[\![(x_1, x_2, \ldots, x_n)]\!] = (\,[\![x_1]\!], [\![x_2]\!], \ldots, [\![x_n]\!]\,)</math> | ||
The [[unit type]] has as semantic interpretation the 0-tuple. | The [[unit type]] has as semantic interpretation the 0-tuple. | ||
For a list of tuple types in programming languages, see [[Product type#Product types in programming languages]]. | |||
==See also== | ==See also== | ||
| Line 183: | Line 188: | ||
==Sources== | ==Sources== | ||
* {{citation|first1=John P.|last1=D'Angelo|first2=Douglas B.|last2=West|title=Mathematical Thinking/Problem-Solving and Proofs|year=2000|edition=2nd|publisher=Prentice-Hall|isbn=978-0-13-014412-6}} | * {{citation|author1-link=John D'Angelo|first1=John P.|last1=D'Angelo|first2=Douglas B.|last2=West|title=Mathematical Thinking/Problem-Solving and Proofs|year=2000|edition=2nd|publisher=Prentice-Hall|isbn=978-0-13-014412-6}} | ||
* [[Keith Devlin]], ''The Joy of Sets''. Springer Verlag, 2nd ed., 1993, {{isbn|0-387-94094-4}}, pp. 7–8 | * [[Keith Devlin]], ''The Joy of Sets''. Springer Verlag, 2nd ed., 1993, {{isbn|0-387-94094-4}}, pp. 7–8 | ||
* [[Abraham Adolf Fraenkel]], [[Yehoshua Bar-Hillel]], [[Azriel Lévy]], ''[https://books.google.com/books?id=ah2bwOwc06MC Foundations of school Set Theory]'', Elsevier Studies in Logic Vol. 67, 2nd Edition, revised, 1973, {{isbn|0-7204-2270-1}}, p. 33 | * [[Abraham Adolf Fraenkel]], [[Yehoshua Bar-Hillel]], [[Azriel Lévy]], ''[https://books.google.com/books?id=ah2bwOwc06MC Foundations of school Set Theory]'', Elsevier Studies in Logic Vol. 67, 2nd Edition, revised, 1973, {{isbn|0-7204-2270-1}}, p. 33 | ||
Latest revision as of 08:37, 25 December 2025
Script error: No such module "For". Script error: No such module "redirect hatnote". Script error: No such module "redirect hatnote". Script error: No such module "redirect hatnote".
In mathematics, a tuple is a finite sequence or ordered list of numbers or, more generally, mathematical objects, which are called the elements of the tuple. An Template:Mvar-tuple is a tuple of Template:Mvar elements, where Template:Mvar is a non-negative integer. There is only one 0-tuple, called the empty tuple. A 1-tuple and a 2-tuple are commonly called a singleton and an ordered pair, respectively. The term "infinite tuple" is occasionally used for "infinite sequences".
Tuples are usually written by listing the elements within parentheses "( )Script error: No such module "Check for unknown parameters"." and separated by commas; for example, (2, 7, 4, 1, 7)Script error: No such module "Check for unknown parameters". denotes a 5-tuple. Other types of brackets are sometimes used, although they may have a different meaning.Template:Efn
An Template:Mvar-tuple can be formally defined as the image of a function that has the set of the Template:Mvar first natural numbers as its domain. Tuples may be also defined from ordered pairs by a recurrence starting from an ordered pair; indeed, an Template:Mvar-tuple can be identified with the ordered pair of its (n − 1)Script error: No such module "Check for unknown parameters". first elements and its Template:Mvarth element, for example, .
In computer science, tuples come in many forms. Most typed functional programming languages implement tuples directly as product types,[1] tightly associated with algebraic data types, pattern matching, and destructuring assignment.[2] Many programming languages offer an alternative to tuples, known as record types, featuring unordered elements accessed by label.[3] 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; when programming the semantic web with the Resource Description Framework (RDF); in linguistics;[4] and in philosophy.[5]
Etymology
The term originated as an abstraction of the sequence: single, couple/double, triple, quadruple, quintuple, sextuple, septuple, octuple, ..., nScript error: No such module "Check for unknown parameters".‑tuple, ..., where the prefixes are taken from the Latin 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 nScript error: No such module "Check for unknown parameters". can be any nonnegative integer. For example, a complex number can be represented as a 2‑tuple of reals, a quaternion can be represented as a 4‑tuple, an octonion can be represented as an 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 "triple" (three-fold) or "decuple" (ten‑fold). This originates from medieval Latin plus (meaning "more") related to Greek ‑πλοῦς, which replaced the classical and late antique ‑plex (meaning "folded"), as in "duplex".[6]Template:Efn
Properties
The general rule for the identity of two nScript error: No such module "Check for unknown parameters".-tuples is
Thus a tuple has properties that distinguish it from a set:
- A tuple may contain multiple instances of the same element, so
tuple ; but set . - Tuple elements are ordered: tuple , 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 -tuple may be identified as the empty function. For the -tuple may be identified with the surjective function
with domain
and with codomain
that is defined at by
That is, is the function defined by
in which case the equality
necessarily holds.
- Tuples as sets of ordered pairs
Functions are commonly identified with their 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 can be defined as:
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 .
- An nScript error: No such module "Check for unknown parameters".-tuple, with n > 0Script error: No such module "Check for unknown parameters"., can be defined as an ordered pair of its first entry and an (n − 1)Script error: No such module "Check for unknown parameters".-tuple (which contains the remaining entries when n > 1)Script error: No such module "Check for unknown parameters".:
This definition can be applied recursively to the (n − 1)Script error: No such module "Check for unknown parameters".-tuple:
Thus, for example:
A variant of this definition starts "peeling off" elements from the other end:
- The 0-tuple is the empty set .
- For n > 0Script error: No such module "Check for unknown parameters".:
This definition can be applied recursively:
Thus, for example:
Tuples as nested sets
Using 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 ;
- Let be an nScript error: No such module "Check for unknown parameters".-tuple , and let . Then, . (The right arrow, , could be read as "adjoined with".)
In this formulation:
Script error: No such module "anchor".nScript error: No such module "Check for unknown parameters".-tuples of mScript error: No such module "Check for unknown parameters".-sets
In discrete mathematics, especially combinatorics and finite probability theory, nScript error: No such module "Check for unknown parameters".-tuples arise in the context of various counting problems and are treated more informally as ordered lists of length nScript error: No such module "Check for unknown parameters"..[7] nScript error: No such module "Check for unknown parameters".-tuples whose entries come from a set of mScript error: No such module "Check for unknown parameters". elements are also called arrangements with repetition, permutations of a multiset and, in some non-English literature, variations with repetition. The number of nScript error: No such module "Check for unknown parameters".-tuples of an mScript error: No such module "Check for unknown parameters".-set is mnScript error: No such module "Check for unknown parameters".. This follows from the combinatorial rule of product.[8] If SScript error: No such module "Check for unknown parameters". is a finite set of cardinality mScript error: No such module "Check for unknown parameters"., this number is the cardinality of the nScript error: No such module "Check for unknown parameters".-fold Cartesian power S × S × ⋯ × SScript error: No such module "Check for unknown parameters".. Tuples are elements of this product set.
Type theory
Script error: No such module "Labelled list hatnote".
In type theory, commonly used in programming languages, a tuple has a product type; this fixes not only the length, but also the underlying types of each component. Formally:
and the projections are term constructors:
The tuple with labeled elements used in the relational model has a record type. Both of these types can be defined as simple extensions of the simply typed lambda calculus.[9]
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 of a type theory, and use the Scott brackets to indicate the semantic interpretation, then the model consists of some sets (note: the use of italics here that distinguishes sets from types) such that:
and the interpretation of the basic terms is:
- .
The nScript error: No such module "Check for unknown parameters".-tuple of type theory has the natural interpretation as an nScript error: No such module "Check for unknown parameters".-tuple of set theory:[10]
The unit type has as semantic interpretation the 0-tuple.
For a list of tuple types in programming languages, see Product type#Product types in programming languages.
See also
- Arity
- Coordinate vector
- Exponential object
- Formal language
- Multidimensional Expressions (OLAP)
- Prime k-tuple
- Relation (mathematics)
- Sequence
- Tuplespace
- Tuple Names
Notes
References
<templatestyles src="Reflist/styles.css" />
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ OED, s.v. "triple", "quadruple", "quintuple", "decuple"
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "Footnotes".
- ↑ Script error: No such module "citation/CS1".
- ↑ Steve Awodey, From sets, to types, to categories, to sets, 2009, preprint
Script error: No such module "Check for unknown parameters".
Sources
- Script error: No such module "citation/CS1".
- Keith Devlin, The Joy of Sets. Springer Verlag, 2nd ed., 1993, Template:Isbn, 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, Template:Isbn, p. 33
- Gaisi Takeuti, W. M. Zaring, Introduction to Axiomatic Set Theory, Springer GTM 1, 1971, Template:Isbn, p. 14
- George J. Tourlakis, Lecture Notes in Logic and Set Theory. Volume 2: Set Theory, Cambridge University Press, 2003, Template:Isbn, pp. 182–193