All Topics  
Tuple

 

   Email Print
   Bookmark   Link






 

Tuple



 
 
In mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, a tuple is a sequence
Sequence

In mathematics, a sequence is an ordered list of objects . Like a Set , it contains Element , and the number of terms is called the length of the sequence....
 (also known as an "ordered list
Ordered list

In HTML an ordered list .. is a HTML element#Lists for a list of items where each item is automatically prefixed by an indication of its position in the list....
") of a specific number of values, called the components of the tuple. These components can be any kind of mathematical objects, where each component of a tuple is a value of a specified type. A tuple containing n components is known as an "n-tuple". For example, the 4-tuple (or "quadruple"), with components of respective types PERSON, DAY, MONTH and YEAR, could be used to record that a certain person was born on a certain day of a certain month of a certain year.

Tuples are used to describe mathematical objects that consist of specified components.






Discussion
Ask a question about 'Tuple'
Start a new discussion about 'Tuple'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, a tuple is a sequence
Sequence

In mathematics, a sequence is an ordered list of objects . Like a Set , it contains Element , and the number of terms is called the length of the sequence....
 (also known as an "ordered list
Ordered list

In HTML an ordered list .. is a HTML element#Lists for a list of items where each item is automatically prefixed by an indication of its position in the list....
") of a specific number of values, called the components of the tuple. These components can be any kind of mathematical objects, where each component of a tuple is a value of a specified type. A tuple containing n components is known as an "n-tuple". For example, the 4-tuple (or "quadruple"), with components of respective types PERSON, DAY, MONTH and YEAR, could be used to record that a certain person was born on a certain day of a certain month of a certain year.

Tuples are used to describe mathematical objects that consist of specified components. For example, a directed graph
Directed graph

A directed graph or digraph is a pair G= of:* a Set V, whose element are called vertices or nodes,* a set A of ordered pairs of vertices, called arcs, directed edges, or arrows....
 is defined as a tuple (V, E) where V is the set of nodes and E is a subset of V × V that denotes the edges. The type of the first object is "set of nodes" and the type of the second is "set of edges".

In type theory
Type theory

In mathematics, logic and computer science, type theory is any of several formal systems that can serve as alternatives to naive set theory, or the study of such formalisms in general....
, tuples are associated with product type
Product type

In programming languages, the product of two types is the data type that characterizes the expressions which behaves, with respect to the evaluation mechanism, as pairs whose first component is an expression of the first type and whose second component is an expression of the second type....
s.

Names of tuples

The term originated as an abstraction of the sequence: single, double, triple, quadruple, quintuple, n-tuple. A tuple of length n is usually described as an 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
Complex number

In mathematics, the complex numbers are an extension of the real numbers obtained by adjoining an imaginary unit, denoted i, which satisfies:...
 can be represented as a 2-tuple, and a quaternion
Quaternion

Quaternions, in mathematics, are a non-commutative number system that extends the complex numbers. The quaternions were first described by Irish mathematician Sir William Rowan Hamilton in 1843 and applied to mechanics in three-dimensional space....
 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
Latin

Latin is an Italic language, historically spoken in Latium and Ancient Rome. Through the Military history of the Roman Empire, Latin spread throughout the Mediterranean and a large part of Europe....
 
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
Calque

In linguistics, a calque or loan translation is a word or phrase borrowed from another language by literal, word-for-word or root-for-root translation....
 
fivefold).

Names for tuples of specific length


Formal definitions

The main properties that distinguish a tuple from, for example, a set are that

  1. it can contain an object more than once;
  2. the objects appear in a certain order;
  3. it has finite size.


Note that (1) distinguishes it from an ordered set
Ordered set

Ordered set is used with distinct meanings in order theory.*A Set with a binary relation R on its elements that is reflexive relation , antisymmetric relation and transitive relation is described as a partially ordered set or poset....
 and that (2) distinguishes it from a multiset
Multiset

In mathematics, a multiset is a generalization of a Set . A Element of a multiset can have more than one Element , while each member of a set has only one membership....
. This is often formalized by giving the following rule for the identity of two
n-tuples:

(a1, a2, …,an) = (b1, b2, …, bn) ↔ a1 = b1, a2 = b2, …, an = bn.


Since a
n-tuple is indexed by the numbers 1…n (or 0…n-1), it can be regarded as a function
Function (mathematics)

The mathematical concept of a function expresses dependence between two quantities, one of which is known and the other which is produced. A function associates a single output to each input element drawn from a fixed Set , such as the real numbers , although different inputs may have the same output....
 from a subset of N
Natural number

In mathematics, a natural number can mean either an element of the Set = *n = = ? = ? ...
:
(a1, a2, …,an) = fa: Nn ? A: i ? ai.


Another way of formalizing tuples is by mapping them to more primitive constructs in set theory
Set theory

Set theory is the branch of mathematics that studies Set , which are collections of objects. Although any type of object can be collected into a set, set theory is applied most often to objects that are relevant to mathematics....
 such as ordered pair
Ordered pair

In mathematics, an ordered pair is a collection of two distinguishable objects, one being the first coordinate system , and the other being the second coordinate ....
s. For example, an
n-tuple (with n > 2) can be defined as an ordered pair
Ordered pair

In mathematics, an ordered pair is a collection of two distinguishable objects, one being the first coordinate system , and the other being the second coordinate ....
 of its first entry and an (
n−1)-tuple containing the remaining entries:

(a1, a2, …, an) = (a1, (a2, …, an)).


Using the usual set-theoretic definition of an ordered pair
Ordered pair

In mathematics, an ordered pair is a collection of two distinguishable objects, one being the first coordinate system , and the other being the second coordinate ....
 and letting the empty set represent the empty tuple, this results in the following inductive definition:
  1. the 0-tuple (i.e. the empty tuple) is represented by
  2. if x is an n-tuple then is an (n + 1)-tuple.


Using this definition, (1,2,2) would be

(1,(2,(2,))) = (1,(2, )) = (1, ) =


There is an important similarity here with the way Lisp
Lisp programming language

Lisp is a family of computer programming languages with a long history and a distinctive, fully parenthesized syntax. Originally specified in 1958, Lisp is the second-oldest high-level programming language in widespread use today; only Fortran is older....
 originally used the ordered pair abstraction to inductively create all of its
n-tuple and list structures:
  1. a special symbol NIL represents the empty list;
  2. if X is a list and A an arbitrary value then the pair (A X) represents a list with the head (i.e. first element) A and the tail (i.e. the remainder of the list without the head) X.


Relational model


In database theory
Database theory

Database theory encapsulates a broad range of topics related to the study and research of the theoretical realm of databases and database management systems....
, the relational model
Relational model

The relational model for database management is a database model based on first-order logic, first formulated and proposed in 1969 by Edgar F. Codd....
 extends the definition of a tuple to associate a distinct name with each component. A tuple in the relational model is formally defined as a finite function
Function (mathematics)

The mathematical concept of a function expresses dependence between two quantities, one of which is known and the other which is produced. A function associates a single output to each input element drawn from a fixed Set , such as the real numbers , although different inputs may have the same output....
 that maps field names to values, rather than a sequence, so its components may appear in any order.

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 often leads to a more user-friendly and practical notation, for example:

( player : "Harry", score : 25 )


Tuples are typically used to represent a row
Row (database)

In the context of a relational database, a row?also called a record or tuple?represents a single, implicitly structured data item in a table ....
 in a database table or a proposition
Proposition

This article is about the term proposition in logic and philosophy; for other uses see PropositionIn logic and philosophy, proposition refers to either the "content" or Meaning of a meaningful declarative sentence or the pattern of symbols, marks, or sounds that make up a meaningful declarative sentence....
; in this case, there exists a player "Harry" with a score of 25.

See also

  • Cartesian product
    Cartesian product

    In mathematics, the Cartesian product is a direct product of sets. The Cartesian product is named after Ren? Descartes, whose formulation of analytic geometry gave rise to this concept....
  • Formal language
    Formal language

    A formal language is a set of words, i.e. finite string of letters, or symbols. The inventory from which these letters are taken is called the alphabet over which the language is defined....
  • Linda (coordination language)
    Linda (coordination language)

    In computer science, Linda is a model of coordination and communication among several parallel processes operating upon objects stored in and retrieved from shared, virtual, associative memory....
  • OLAP: Multidimensional Expressions
    Multidimensional Expressions

    Multidimensional Expressions is a query language for OLAP databases, much like SQL is a query language for relational databases. It is also a calculation language, with syntax similar to spreadsheet formulas....
  • Relation (mathematics)
    Relation (mathematics)

    In mathematics , a relation is a property that assigns truth values to combinations of k first-order logic. Typically, the property describes a possible connection between the components of a k-tuple....
  • Row (database)
    Row (database)

    In the context of a relational database, a row?also called a record or tuple?represents a single, implicitly structured data item in a table ....
  • Tuple calculus
  • Unit type
    Unit type

    A unit type is a mathematical type theory that allows only one value .The carrier associated with a unit type can be any singleton set. There is an isomorphism between any two such sets, so it is customary to talk about the unit type and ignore the details of its value....
  • Arity
    Arity

    In logic, mathematics, and computer science, the arity of a function or operation is the number of arguments or operands that the function takes. The arity of a relation is the number of domains in the corresponding Cartesian product....


External links