Tuple

From Academic Kids

See also tuplet as in duple and triple.

In mathematics, a tuple is a finite sequence of objects (a list of a limited number of objects). (An infinite sequence is a family.) Tuples are used by mathematicians to describe mathematical objects that consist of certain 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.

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 an ordered pair; a 3-tuple is a triple or triplet. The n can be any positive integer; thus one can for example say that a quaternion can be represented as a 4-tuple, and further constructed names are possible, such as octuple, but many mathematicians find it quicker to write "8-tuple", even if still pronouncing "octuple".

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 (2) 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) iff a1 = b1, a2 = b2 and so on.

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, {{2}, {2, {{2}, {2, ∅}}}} ) = {{1}, {1, {{2}, {2, {{2}, {2, ∅}}}}}}

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 (especially in programming languages and database theory such as the relational model) a tuple is usually 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.

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 that there exists a player named "Harry", and that he has 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 )

cs:Uspořádaná n-tice de:Tupel et:N-korteež fr:N-uplet ja:タプル pl:Krotka zh:多元组

Navigation

Academic Kids Menu

  • Art and Cultures
    • Art (http://www.academickids.com/encyclopedia/index.php/Art)
    • Architecture (http://www.academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (http://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (http://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools