Information about Tuple



In mathematics, a tuple is a finite sequence (also known as an "ordered list") of objects, each of a specified type. A tuple containing n objects 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 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".

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 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".

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, and
  2. the objects appear in a certain order.


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:

(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 from a subset of :
(a1, a2, …,an) ≡ fa: ℕn → A: iai.


Another way of formalizing tuples is by mapping them to more primitive constructs in set theory such as ordered pairs. For example, an n-tuple (with n > 2) can be defined as an ordered pair 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 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 {{a}, {a, x}} is an (n + 1)-tuple.


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

(1,(2,(2,))) = (1,(2, {{2}, {2, }} )) = (1, ) =


There is an important similarity here with the way Lisp 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.

Usage in computer science

In computer science, tuple has three distinct meanings. Typically in functional and some other programming languages, a tuple is a data object that holds several objects, similar to a mathematical tuple. Such an object is also known as a record.

The Eiffel programming language has a built-in notion of tuple. The type

TUPLE [X, Y, Z]

has, as its values, tuples of three or more elements, of which the first is of type X, the second of type Y and the third of type Z. This can also be written with tags:

TUPLE [tag1: X, tag2: Y, tag3: Z]

without affecting the resulting type. An actual tuple, corresponding to this type, is written in bracket notation, for example

[x1, y1, z1]

with x1 of type X etc. If t is such a tuple, its elements can be accessed, in the form using tags, as t.tag1 etc.; they can also be set in the same way, as in t.tag2 := y2 which replaces the second element, of type Y, by y2. A value of type TUPLE [X, Y, Z] can be assigned to a variable of the same type but also to one of type TUPLE [X, Y], or TUPLE [X], or just TUPLE which covers all tuples. This is thanks to the definition that TUPLE [X, Y], for example, covers sequences of at least (rather than exactly) two elements, with the first two of the types given. Tuple types fit well in an object-oriented context, where they save writing a class when all you need is simple sequences of values with associated access and set mechanisms for each field.

Information Modeling

With inherent Name/Value pair properties, along with a structured and ordered nature, the term 'tuple' extends readily to use in Information Modeling and Database Definition.

For example, XML-Tuples represent Name/Value tuple structures. The following is an example of an XML-Tuple

<name>Value</name>

Field names

In some languages, and especially in database theory, a tuple is defined as a finite function that maps field names to a certain value. Its purpose is the same as in mathematics, namely to indicate that a certain entity or object consists of certain components and/or has certain properties, but here these components are identified by a unique field name and not by a position, which often leads to a more user-friendly notation. The general term for this construct is an associative array; other programming languages have yet other names for the concept.

A small example of a tuple would be:
( player : "Harry", score : 25 )
which is a function that maps the field name "player" to the string "Harry" and the field name "score" to the number 25. Note that the order of the components is not relevant, so the same tuple can also be written as:
( score : 25, player : "Harry" )
In the relational model such tuples are typically used to represent a single proposition; in this case there exists a player with the name "Harry" and a score of 25.

In programming languages, tuples are used to form data structures. For example, the following could be a structure that represents a node in a doubly linked list:
( value : 16, previous-node : 1174782, next-node : 1174791 )

See also

External links

Mathematics (colloquially, maths or math) is the body of knowledge centered on such concepts as quantity, structure, space, and change, and also the academic discipline that studies them. Benjamin Peirce called it "the science that draws necessary conclusions".
..... Click the link for more information.
In mathematics, a set is called finite if there is a bijection between the set and some set of the form where n is a natural number. (The value n = 0 is allowed; that is, the empty set is finite.) An infinite set is a set which is not finite.
..... Click the link for more information.
sequence is an ordered list of objects (or events). Like a set, it contains members (also called elements or terms), and the number of terms (possibly infinite) is called the length of the sequence.
..... Click the link for more information.
In mathematics, a complex number is a number of the form


where a and b are real numbers, and i is the imaginary unit, with the property i ² = −1.
..... Click the link for more information.
quaternions are a non-commutative extension of complex numbers. They were first described by the Irish mathematician, Sir William Rowan Hamilton, in 1843 and applied to mechanics in three-dimensional space.
..... Click the link for more information.
Zero may refer to:

Mathematics

  • 0 (number) is a number and a placeholder symbol in positional notation.
  • Zero of a function
  • Division by zero
  • List of zero terms

..... Click the link for more information.

0 1 2 3 4 5 6 7 8 9

..... Click the link for more information.
In mathematics, a singleton is a set with exactly one element. For example, the set is a singleton.

Properties

Note that a set such as is also a singleton: the only element is a set (which itself is however not a singleton).
..... Click the link for more information.
Double may refer to:
  • Body double, someone who substitutes for the credited actor of a character
  • Doppelgänger, ghostly double of a living person
Sports
  • Doublebugg, a dancesport which is performed by three dancers.

..... Click the link for more information.
2 (two) is a number, numeral, and glyph. It is the natural number following 1 and preceding 3.

In mathematics

Two has many properties in mathematics.[1] An integer is called even if it is divisible by 2.
..... Click the link for more information.
The word pair, derived via the French words pair/paire from the Latin par 'equal', can mean:
  • the French equivalent of peer, holder of a French Pairie, French high title roughly equivalent to a member of the British peerage

..... Click the link for more information.
Twice may refer to:
  • 2 (number)
  • TWICE, a magazine published by Reed Business Information

See also

Double

TWICE

Type business magazine
Format Paper and online magazine


..... Click the link for more information.
In mathematics, a triple is an n-tuple with n being 3. A triple is a sequence of three elements. It is not a set of three elements, as the ordering of the elements matters, and an element can be present more than once in the same triple.
..... Click the link for more information.
3 (three) is a number, numeral, and glyph. It is the natural number following 2 and preceding 4.

In mathematics

Three is the first odd prime number, and the second smallest positive prime.
..... Click the link for more information.
A triplet is a set of three items, and includes in particular:
  • one of three babies in a multiple birth
  • in lapidary, a preparation of opal as a gemstone, with a thin layer of opal backed with a dark material and covered with cap of clear quartz

..... Click the link for more information.
Treble, a doublet of "triple" or "threefold" (from Latin triplus, "triple"; cf. "double" from duplus), is used in several contexts:

Music:
  • As a term applied in music to the high or acute part of the musical system; see clef.

..... Click the link for more information.
threesome is the term which describes a sexual act involving three people, also referred to as a ménage à trois. To clarify the roles, a threesome does not have to mean that all three people are engaging in sexual activity specifically with all people in the threesome, but can be
..... Click the link for more information.
A general meaning of the Russian word troika (Cyrillic alphabet: тройка) is threesome, a collection of three of any kind.
..... Click the link for more information.
A trio is a group of three identical or similar objects, or a grouping of three persons for a common purpose. (See tuple for alternative names.)

In music
  • Trio (music), three people performing music in some way
  • Piano trio (piano, violin, cello)

..... Click the link for more information.
In mathematics, a quadruple or quadruplet is an n-tuple with n being 4. This means it depicts four elements, with the order of the elements carrying meaning.
..... Click the link for more information.
This article discusses the number Four. For the year 4 AD, see 4. For other uses of 4, see 4 (disambiguation)

0 1 2 3 4 5 6 7 8 9

..... Click the link for more information.
This article discusses the number five. For the year 5 AD, see 5. For other uses of 5, see 5 (disambiguation).

0 1 2 3 4 5 6 7 8 9

..... Click the link for more information.
6 (six) is the natural number following 5 and preceding 7.

The SI prefix for 10006 is exa (E), and for its reciprocal atto (a).

In mathematics

Six is the second smallest composite number, its proper divisors being 1, 2 and 3.
..... Click the link for more information.
7 (seven) is the natural number following 6 and preceding 8.

In mathematics

  • Seven is the 4th prime number.
  • Seven is a Mersenne prime, since 2³ - 1 = 7.
  • Seven is the fourth Mersenne prime exponent.

..... Click the link for more information.
8 (eight) is the natural number following 7 and preceding 9. The SI prefix for 10008 is yotta (Y), and for its reciprocal yocto (y).

In mathematics

8 is a composite number, its proper divisors being 1, 2, and 4.
..... Click the link for more information.
9 (nine) is the natural number following 8 and preceding 10.

In mathematics

Nine is a composite number, its proper divisors being 1 and 3. It is 3 times 3 and hence the third square number. 9 is a Motzkin number. It is the first composite lucky number.
..... Click the link for more information.
10 (ten) is an even natural number following 9 and preceding 11.

0

..... Click the link for more information.
100 (one hundred) (the Roman numeral is C for centum) is the natural number following 99 and preceding 101.

In mathematics

One hundred is the square of 10 (in scientific notation it is written as ).
..... Click the link for more information.
SET may stand for:
  • Sanlih Entertainment Television, a television channel in Taiwan
  • Secure electronic transaction, a protocol used for credit card processing,

..... Click the link for more information.
Ordered set is used with distinct meanings in order theory.
  • A set with a binary relation R on its elements that is reflexive (for all a in the set, aRa), antisymmetric (if aRb and bRa, then a=b

..... Click the link for more information.


This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus


page counter