Tuple

From GM-RKB
(Redirected from tuple)
Jump to navigation Jump to search

A tuple is an ordered multiset that is a finite sequence with [math]\displaystyle{ n \ge 1 }[/math] tuple members.



References

2015

  • (Wikipedia, 2015) ⇒ http://en.wikipedia.org/wiki/tuple Retrieved:2015-2-23.
    • A tuple is an ordered list of elements. In mathematics, an n-tuple is a sequence (or ordered list) of [math]\displaystyle{ n }[/math] elements, where [math]\displaystyle{ n }[/math] is a non-negative integer. There is only one 0-tuple, an empty sequence. An [math]\displaystyle{ n }[/math] -tuple is defined inductively using the construction of an ordered pair. Tuples are usually written by listing the elements within parentheses " [math]\displaystyle{ (\text{ }) }[/math] " and separated by commas; for example, [math]\displaystyle{ (2, 7, 4, 1, 7) }[/math] denotes a 5-tuple. Sometimes other delimiters are used, such as square brackets " [math]\displaystyle{ [\text{ }] }[/math] " or angle brackets " [math]\displaystyle{ \langle\text{ }\rangle }[/math] ". Braces " [math]\displaystyle{ \{\} }[/math] " are almost never used for tuples, as they are the standard notation for sets. Tuples are often used to describe other mathematical objects, such as vectors. In computer science, tuples are directly implemented as product types in most functional programming languages. More commonly, they are implemented as record types, where the components are labeled instead of being identified by position alone. This approach is also used in relational algebra. Tuples are also used in relation to programming the semantic web with Resource Description Framework or RDF. Tuples are also used in linguistics [1] and philosophy. [2]
  • (Wikipedia, 2015) ⇒ http://en.wikipedia.org/wiki/tuple#Properties Retrieved:2015-2-23.
    • The general rule for the identity of two [math]\displaystyle{ n }[/math] -tuples is : [math]\displaystyle{ (a_1, a_2, \ldots, a_n) = (b_1, b_2, \ldots, b_n) }[/math] if and only if [math]\displaystyle{ a_1=b_1,\text{ }a_2=b_2,\text{ }\ldots,\text{ }a_n=b_n. }[/math] Thus a tuple has properties that distinguish it from a set.
      1. A tuple may contain multiple instances of the same element, so tuple [math]\displaystyle{ (1,2,2,3) \neq (1,2,3) }[/math] ; but set [math]\displaystyle{ \{1,2,2,3\} = \{1,2,3\} }[/math] .
      2. Tuple elements are ordered: tuple [math]\displaystyle{ (1,2,3) \neq (3,2,1) }[/math] , but set [math]\displaystyle{ \{1,2,3\} = \{3,2,1\} }[/math] .
      3. A tuple has a finite number of elements, while a set or a multiset may have an infinite number of elements.


  • (Wikipedia, 2015) ⇒ http://en.wikipedia.org/wiki/tuple#Tuples_as_functions Retrieved:2015-2-23.
    • If we are dealing with sets, an [math]\displaystyle{ n }[/math] -tuple can be regarded as a function, F, whose domain is the tuple's implicit set of element indices, X, and whose codomain, Y, is the tuple's set of elements. Formally: : [math]\displaystyle{ (a_1, a_2, \dots, a_n) \equiv (X,Y,F) }[/math] where: : [math]\displaystyle{ \begin{align} X & = \{1, 2, \dots, n\} \\ Y & = \{a_1, a_2, \ldots, a_n\} \\ F & = \{(1, a_1), (2, a_2), \ldots, (n, a_n)\}. \\ \end{align} }[/math] In slightly less formal notation this says: : [math]\displaystyle{ (a_1, a_2, \dots, a_n) := (F(1), F(2), \dots, F(n)). }[/math]