In
mathematics
Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, a tuple is a finite
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 cal ...
or ''ordered list'' of
number
A number is a mathematical object used to count, measure, and label. The most basic examples are the natural numbers 1, 2, 3, 4, and so forth. Numbers can be represented in language with number words. More universally, individual numbers can ...
s or, more generally,
mathematical object
A mathematical object is an abstract concept arising in mathematics. Typically, a mathematical object can be a value that can be assigned to a Glossary of mathematical symbols, symbol, and therefore can be involved in formulas. Commonly encounter ...
s, which are called the ''elements'' of the tuple. An -tuple is a tuple of elements, where is a non-negative
integer
An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
. 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
In mathematics, an ordered pair, denoted (''a'', ''b''), is a pair of objects in which their order is significant. The ordered pair (''a'', ''b'') is different from the ordered pair (''b'', ''a''), unless ''a'' = ''b''. In contrast, the '' unord ...
, respectively. The term ''"infinite tuple"'' is occasionally used for ''"infinite sequences"''.
Tuples are usually written by listing the elements within parentheses "" and separated by commas; for example, denotes a 5-tuple. Other types of brackets are sometimes used, although they may have a different meaning.
An -tuple can be formally defined as the
image
An image or picture is a visual representation. An image can be Two-dimensional space, two-dimensional, such as a drawing, painting, or photograph, or Three-dimensional space, three-dimensional, such as a carving or sculpture. Images may be di ...
of a
function that has the set of the first
natural number
In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positive in ...
s as its
domain. Tuples may be also defined from ordered pairs by a
recurrence starting from an
ordered pair
In mathematics, an ordered pair, denoted (''a'', ''b''), is a pair of objects in which their order is significant. The ordered pair (''a'', ''b'') is different from the ordered pair (''b'', ''a''), unless ''a'' = ''b''. In contrast, the '' unord ...
; indeed, an -tuple can be identified with the ordered pair of its first elements and its th element, for example,
.
In
computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, tuples come in many forms. Most typed
functional programming
In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declarat ...
languages implement tuples directly as
product types, 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 data type, i.e., a data type formed by combining other types.
Two common classes of algebraic types are product ty ...
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 must be exact: "either it will or will not be a ...
, 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 database
A relational database (RDB) is a database based on the relational model of data, as proposed by E. F. Codd in 1970.
A Relational Database Management System (RDBMS) is a type of database management system that stores data in a structured for ...
s 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 for modeling data and defining queries on it with well founded semantics (computer science), semantics. The theory was introduced by Edgar F. Codd.
The main applica ...
; when programming the
semantic web
The Semantic Web, sometimes known as Web 3.0, is an extension of the World Wide Web through standards set by the World Wide Web Consortium (W3C). The goal of the Semantic Web is to make Internet data machine-readable.
To enable the encoding o ...
with the
Resource Description Framework
The Resource Description Framework (RDF) is a method to describe and exchange graph data. It was originally designed as a data model for metadata by the World Wide Web Consortium (W3C). It provides a variety of syntax notations and formats, of whi ...
(RDF); in
linguistics
Linguistics is the scientific study of language. The areas of linguistic analysis are syntax (rules governing the structure of sentences), semantics (meaning), Morphology (linguistics), morphology (structure of words), phonetics (speech sounds ...
; and in
philosophy
Philosophy ('love of wisdom' in Ancient Greek) is a systematic study of general and fundamental questions concerning topics like existence, reason, knowledge, Value (ethics and social sciences), value, mind, and language. It is a rational an ...
.
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 languages, Italic branch of the Indo-European languages. Latin was originally spoken by the Latins (Italic tribe), Latins in Latium (now known as Lazio), the lower Tiber area aroun ...
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 (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
. 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 for ...
can be represented as a 2‑tuple of reals, a
quaternion
In mathematics, the quaternion number system extends the complex numbers. Quaternions were first described by the Irish mathematician William Rowan Hamilton in 1843 and applied to mechanics in three-dimensional space. The algebra of quater ...
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, hypercomplex Number#Classification, number system. The octonions are usually represented by the capital letter O, using boldface or ...
can be represented as an 8‑tuple, and a
sedenion
In abstract algebra, the sedenions form a 16-dimension of a vector space, dimensional commutative property, noncommutative and associative property, nonassociative algebra over a field, algebra over the real numbers, usually represented by the cap ...
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
Medieval Latin was the form of Literary Latin used in Roman Catholic Church, Roman Catholic Western Europe during the Middle Ages. It was also the administrative language in the former Western Roman Empire, Roman Provinces of Mauretania, Numidi ...
''plus'' (meaning "more") related to
Greek ‑πλοῦς, which replaced the classical and late antique ''‑plex'' (meaning "folded"), as in "duplex".
Properties
The general rule for the identity of two -tuples is
:
if and only if
In logic and related fields such as mathematics and philosophy, "if and only if" (often shortened as "iff") is paraphrased by the biconditional, a logical connective between statements. The biconditional is true in two cases, where either bo ...
.
Thus a tuple has properties that distinguish it from a
set
Set, The Set, SET or SETS may refer to:
Science, technology, and mathematics Mathematics
*Set (mathematics), a collection of elements
*Category of sets, the category whose objects and morphisms are sets and total functions, respectively
Electro ...
:
# 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
In mathematics, a multiset (or bag, or mset) is a modification of the concept of a set that, unlike a set, allows for multiple instances for each of its elements. The number of instances given for each element is called the ''multiplicity'' of ...
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
In mathematics, a function from a set to a set assigns to each element of exactly one element of .; the words ''map'', ''mapping'', ''transformation'', ''correspondence'', and ''operator'' are sometimes used synonymously. The set is called ...
. For
the
-tuple
may be identified with the (
surjective
In mathematics, a surjective function (also known as surjection, or onto function ) is a function such that, for every element of the function's codomain, there exists one element in the function's domain such that . In other words, for a f ...
)
function
:
with
domain
:
and with
codomain
In mathematics, a codomain, counter-domain, or set of destination of a function is a set into which all of the output of the function is constrained to fall. It is the set in the notation . The term '' range'' is sometimes ambiguously used to ...
:
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 pair
In mathematics, an ordered pair, denoted (''a'', ''b''), is a pair of objects in which their order is significant. The ordered pair (''a'', ''b'') is different from the ordered pair (''b'', ''a''), unless ''a'' = ''b''. In contrast, the '' unord ...
s. 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 -tuple, with , can be defined as an ordered pair of its first entry and an -tuple (which contains the remaining entries when :
#:
This definition can be applied recursively to the -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 :
#:
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
Set theory is the branch of mathematical logic that studies Set (mathematics), sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory – as a branch of mathema ...
:
# The 0-tuple (i.e. the empty tuple) is represented by the empty set
;
# Let
be an -tuple
, and let
. Then,
. (The right arrow,
, could be read as "adjoined with".)
In this formulation:
:
-tuples of -sets
In
discrete mathematics
Discrete mathematics is the study of mathematical structures that can be considered "discrete" (in a way analogous to discrete variables, having a bijection with the set of natural numbers) rather than "continuous" (analogously to continuous f ...
, especially
combinatorics
Combinatorics is an area of mathematics primarily concerned with counting, both as a means and as an end to obtaining results, and certain properties of finite structures. It is closely related to many other areas of mathematics and has many ...
and finite
probability theory
Probability theory or probability calculus is the branch of mathematics concerned with probability. Although there are several different probability interpretations, probability theory treats the concept in a rigorous mathematical manner by expre ...
, -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'', ''
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
The thumb is the first digit of the hand, next to the index finger. When a person is standing in the medical anatomical position (where the palm is facing to the front), the thumb is the outermost digit. The Medical Latin English noun for thum ...
, this number is the cardinality of the -fold
Cartesian power . Tuples are elements of this product set.
Type theory
In
type theory
In mathematics and theoretical computer science, a type theory is the formal presentation of a specific type system. Type theory is the academic study of type systems.
Some type theories serve as alternatives to set theory as a foundation of ...
, commonly used in
programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
s, 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
The relational model (RM) is an approach to managing data using a structure and language consistent with first-order predicate logic, first described in 1969 by English computer scientist Edgar F. Codd, where all data are represented in terms of t ...
has a
record type. Both of these types can be defined as simple extensions of the
simply typed lambda calculus
The simply typed lambda calculus (), a form
of type theory, is a typed interpretation of the lambda calculus with only one type constructor () that builds function types. It is the canonical and simplest example of a typed lambda calculus. The ...
.
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
A model is an informative representation of an object, person, or system. The term originally denoted the plans of a building in late 16th-century English, and derived via French and Italian ultimately from Latin , .
Models can be divided in ...
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 -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
In academic publishing, a preprint is a version of a scholarly or scientific paper that precedes formal peer review and publication in a peer-reviewed scholarly or scientific journal. The preprint may be available, often as a non-typeset versi ...
:
The unit type has as semantic interpretation the 0-tuple.
See also
*
Arity
In logic, mathematics, and computer science, arity () is the number of arguments or operands taken by a function, operation or relation. In mathematics, arity may also be called rank, but this word can have many other meanings. In logic and ...
*
Coordinate vector
In linear algebra, a coordinate vector is a representation of a vector as an ordered list of numbers (a tuple) that describes the vector in terms of a particular ordered basis. An easy example may be a position such as (5, 2, 1) in a 3-dimension ...
*
Exponential object
In mathematics, specifically in category theory, an exponential object or map object is the category theory, categorical generalization of a function space in set theory. Category (mathematics), Categories with all Product (category theory), fini ...
*
Formal language
In logic, mathematics, computer science, and linguistics, a formal language is a set of strings whose symbols are taken from a set called "alphabet".
The alphabet of a formal language consists of symbols that concatenate into strings (also c ...
*
Multidimensional Expressions
Multidimensional Expressions (MDX) is a query language for online analytical processing (OLAP) using a database management system. Much like SQL, it is a query language for OLAP cubes. It is also a calculation language, with syntax similar to spre ...
(OLAP)
*
Prime ''k''-tuple
*
Relation (mathematics)
In mathematics, a relation denotes some kind of ''relationship'' between two mathematical object, objects in a Set (mathematics), set, which may or may not hold. As an example, "''is less than''" is a relation on the set of natural numbers; it ...
*
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 cal ...
*
Tuplespace
*
Tuple Names
Notes
References
Sources
*
*
Keith Devlin
Keith James Devlin (born 16 March 1947) is a British mathematician and popular science writer. Since 1987 he has lived in the United States. He has dual British-American citizenship. , ''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
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