Finding something worth knowing…

Science

The word tuple was carved out of double, triple and quintuple

Mathematicians took the family of words single, double, triple, quadruple, quintuple and so on, and abstracted the ending into n-tuple, a finite ordered list of any length n. Yet the original suffix was really -ple, from a medieval Latin word meaning more, which had displaced an older ending meaning folded.

A tuple is written as items in parentheses separated by commas, so (2, 7, 4, 1, 7) is a 5-tuple. There is exactly one tuple with nothing in it, the empty tuple. A 1-tuple is a singleton, a 2-tuple an ordered pair, a 3-tuple a triple. Number systems can be described this way too: a complex number is a pair of reals, a quaternion a list of 4, an octonion 8 and a sedenion 16.

Three features set a tuple apart from a set. Order matters, so two tuples are equal only when their entries match position by position. Repeats are allowed, as the two sevens above show. And a tuple always has finitely many entries, whereas a set may be infinite.

Set theorists have several ways to build tuples from simpler parts. One treats an n-tuple as a function that assigns an item to each of the numbers 1 to n. Another nests ordered pairs, starting from the empty set: the triple (1, 2, 3) becomes 1 paired with 2 paired with 3 paired with nothing, and a mirror-image version peels entries off from the other end.

Programmers meet tuples everywhere. Typed functional languages build them in as product types, handy for pattern matching and unpacking several values at once. Record types offer the alternative of labelled, unordered fields, and C structs blend the two ideas. Relational databases formally treat each row as a tuple.

Source: Tuple

Related

More in Science · All topics