| advertise add site services publishers database health videos | ![]() | about toolbar stats live show health store more stuff JOIN/LOGIN |
4-tuple - Hypnosis - Hypnotherapy - Hypnotic Advancements hypnoticadvancements.com |
This article is about the mathematical concept. For the musical term, see Tuplet. For the achievement in football (soccer), see The Sextuple. In mathematics and computer science a tuple captures the intuitive notion of an ordered list of elements. Depending on the mathematical foundation chosen, the formal notion differs slightly. In set theory, an (ordered) n-tuple is a sequence (or ordered list) of n elements, where n is a positive integer. There is also one 0-tuple, which is just an empty sequence. When n is understood from context, an n-tuple is sometimes referred to just as tuple, but this practice is not common in set theory texts. An n-tuple is defined inductively using the construction of an ordered pair. In type theory, commonly used in programming languages, a tuple has a product type: not only is the length fixed, but also the types of the components have to be specified, thus the length alone is not sufficient to inductively define a notion. Tuples are usually written by listing the elements within parenthesis '( )' and separated by commas; for example, (2, 7, 4, 1, 7) denotes a 5-tuple. Sometimes other delimiters are used, such as brackets '[ ]' or angle parentheses ' Tuples are often used to describe other mathematical objects. In algebra, for example, a ring is commonly defined as a 3-tuple (E,+,×), where E is some set, 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 though, they are (also) implemented as record types, where the components are labeled instead of being identified by position alone. This approach is also used in relational algebra, one of the cornerstones of relational database theory.
[edit] Origin of nameThe term originated as an abstraction of the sequence: single, double, triple, quadruple, quintuple, sextuple, septuple, octuple, ..., n-tuple, ... A 2-tuple is called a pair; 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, and a quaternion can be represented as a 4-tuple. Further constructed names are possible, such as octuple, but many mathematicians find it quicker to write "8-tuple", even if still pronouncing this "octuple". Although the word tuple was taken as an apparent suffix of some of the names for tuples of specific length, such as quintuple, this is based on a false analysis. The word quintuple comes from Latin quintuplex, which should be analyzed as quintu-plex, in which the suffix plex comes from plicare "to fold", from which also English ply (and hence also the calque fivefold). [edit] Formal definitions[edit] Characteristic propertiesThe main properties that distinguish a tuple from, for example, a set are that
Note that (1) distinguishes it from an ordered set and that (2) distinguishes it from a multiset. This is often formalized by giving the following rule for the identity of two n-tuples:
[edit] Tuples as functionsAn n-tuple can also be regarded as a function whose domain is the natural numbers { 1, 2, …, n } (or { 0, 1, …, n-1 }); that is, a set of index-element pairs:
or
[edit] Tuples as nested ordered pairsAnother way of formalizing tuples is as nested ordered pairs. Namely,
Thus, for example, the tuple (3, 5, 3) would be the same as (3,(5,(3,Ø))). This definition mirrors the most common representation of tuples as linked lists — as used, for example, in standard implementations of the Lisp programming language. A variant of this definition starts "peeling off" elements from the other end:
Thus, for example, the tuple (3, 5, 3) would be the same as (((Ø,3),5),3). [edit] Tuples as nested setsUsing Kuratowski's representation for an ordered pair, the second definition above can be reformulated in terms of pure set theory as:
In this formulation, the tuple (3, 5, 3) would be
[edit] Relational modelIn database theory, the relational model uses a definition similar with tuples as functions above, but each tuple element is identified by a distinct name, called an attribute, instead of a number. A tuple in the relational model is formally defined as a finite function that maps attributes to values. Its purpose is the same as in mathematics, that is, to indicate that an object consists of certain components, but the components are identified by name instead of position, which leads to a more user-friendly and practical notation,[1] for example:
In this notation, attribute–value pairs may appear in any order. The distinction between tuples in the relational model and those in set theory is only superficial. Imposing an arbitrary total order on the attributes, e.g. player ≤ score in the above example, and then ignoring the attribute names yields a 2-tuple. Conversely, a 2-tuple may be interpreted as relational model tuple over the attributes {1, 2}.[1] In the relational model, a relation is a (possibly empty) finite set of tuples all having the same finite set of attributes, which is more formally called the sort of the relation, or just referred to as column names.[1] A tuple is usually implemented as a row in a database table, but see relational algebra for means of deriving tuples not physically represented in a table. [edit] Type theoryIn 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 (x1, ...,xn) : T1×...×Tn, and the projections are term constructors π1(x) : T1, ..., πn(x) : Tn. The tuple with labeled elements used in the relational model (see section above) has a record type. Both of these types can be defined as simple extensions of simply typed lambda calculus.[2] 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 T1, ..., Tn (note: the use of italics here that distinguishes sets from types) such that [edit] See also
[edit] References
The set theory definitions herein are found in any textbook on the topic, e.g.
[edit] External links |
| ↑ top of page ↑ | about thumbshots |