# Tuple

(Redirected from n-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.

**AKA:**Ordered Finite Multiset.**Context:**- It can be an operation input to a Tuple Operation, such as Tuple Size/Tuple Dimensions.
- It can be a member of a Tuple Set (such as a Metric Space?).
- It can range from being a 1-Tuple, 2-Tuple, 3-Tuple, 4-Tuple, 5-Tuple, ..., n-Tuple, based on its Tuple Dimensions.
- It can range from being an Abstract Tuple to being a Tuple Structure (such as a tuple record).

**Example(s):**- a Vector, with numeric members.
- (0.9, RED), a 2-Tuple.
- (
*S, f*), a 2-Tuple (e.g. representing a Multiset). - (0.9, RED,
*π*), a 3-Tuple. - (0.1,
*π*, 1.1), a Vector. - {A/6, B/11, C+/20, ..., F/2}, marks reported for an course exam.
- (
*D, d*) is a 2-Tuple representing a Metric Space. - … is a 3-Tuple representing an RDF Relation.
- (N, Σ, P, S) is a 4-Tuple representing a Formal Grammar.
- an n-gram, such as a trigram.
- …

**Counter-Example(s):**- a Numerical Multiset, such as: {1.3, 4.5, 1.3, 7.5}.
- a Numerical Sequence, such as (1, 2, 3, 4, ...).
- a String, such as a linguistic sentence ..

**See:**Tuple Space, Multiset, Abstract Space, Ground Fact, Ordered Pair, Recursive Definition, Functional Programming, Relational Algebra.

## References

### 2015

- (Wikipedia, 2015) ⇒ http://en.wikipedia.org/wiki/tuple Retrieved:2015-2-23.
- A
**tuple**is an ordered list of elements. In mathematics, anis 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*n*-tuple^{[1]}and philosophy.^{[2]}

- A

- (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.
- 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] .
- 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] .
- A tuple has a finite number of elements, while a set or a multiset may have an infinite number of elements.

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

- (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]

- If we are dealing with sets, an [math]\displaystyle{ n }[/math] -tuple can be regarded as a function,