Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Tuple
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Finite ordered list of elements}} {{hatnote group|{{for|the musical term|Tuplet}}{{redirect|Octuple|the boat|Octuple scull}}{{redirect|Duodecuple|the musical technique|Twelve-tone technique}}{{redirect|Sextuple|the sporting achievement of association football|Sextuple (association football)}} }} In [[mathematics]], a '''tuple''' is a finite [[sequence]] or ''ordered list'' of [[number]]s or, more generally, [[mathematical object]]s, which are called the ''elements'' of the tuple. An '''{{mvar|n}}-tuple''' is a tuple of {{mvar|n}} elements, where {{mvar|n}} is a non-negative [[integer]]. There is only one 0-tuple, called the ''empty tuple''. A 1-tuple and a 2-tuple are commonly called a [[singleton (mathematics)|singleton]] and an [[ordered pair]], respectively. The term ''"infinite tuple"'' is occasionally used for ''"infinite sequences"''. Tuples are usually written by listing the elements within parentheses "{{math|( )}}" and separated by commas; for example, {{math|(2, 7, 4, 1, 7)}} denotes a 5-tuple. Other types of brackets are sometimes used, although they may have a different meaning.{{efn|[[Square bracket]]s are used for [[matrix (mathematics)|matrices]], including [[row vector]]s. [[Braces (punctuation)|Braces]] are used for [[set (mathematics)|set]]s. Each [[programming language]] has its own convention for the different brackets.}} An {{mvar|n}}-tuple can be formally defined as the [[image (function)|image]] of a [[function (mathematics)|function]] that has the set of the {{mvar|n}} first [[natural number]]s as its [[domain of a function|domain]]. Tuples may be also defined from ordered pairs by a [[recurrence relation|recurrence]] starting from an [[ordered pair]]; indeed, an {{mvar|n}}-tuple can be identified with the ordered pair of its {{math|(''n'' β 1)}} first elements and its {{mvar|n}}th element, for example, <math> \left( \left( \left( 1,2 \right),3 \right),4 \right)=\left( 1,2,3,4 \right)</math>. In [[computer science]], tuples come in many forms. Most typed [[functional programming]] languages implement tuples directly as [[product type]]s,<ref>{{cite web|url=https://wiki.haskell.org/Algebraic_data_type|title=Algebraic data type - HaskellWiki|website=wiki.haskell.org}}</ref> tightly associated with [[algebraic data type]]s, [[pattern matching]], and [[Assignment (computer science)#Parallel assignment|destructuring assignment]].<ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment|title=Destructuring assignment|website=MDN Web Docs|date=18 April 2023 }}</ref> Many programming languages offer an alternative to tuples, known as [[Record (computer science)|record types]], featuring unordered elements accessed by label.<ref>{{cite web|url=https://stackoverflow.com/q/5525795 |title=Does JavaScript Guarantee Object Property Order?|website=Stack Overflow}}</ref> A few programming languages combine ordered tuple product types and unordered record types into a single construct, as in [[struct (C programming language)|C structs]] and Haskell records. [[Relational database]]s may formally identify their [[Row (database)|rows]] (records) as ''tuples''. Tuples also occur in [[relational algebra]]; when programming the [[semantic web]] with the [[Resource Description Framework]] (RDF); in [[linguistics]];<ref>{{cite encyclopedia|url= http://www.oxfordreference.com/view/10.1093/acref/9780199202720.001.0001/acref-9780199202720-e-2276|title= N-tuple|encyclopedia=The Concise Oxford Dictionary of Linguistics|date= January 2007|publisher= Oxford University Press|isbn= 9780199202720|editor-first=P. H.|editor-last=Matthews|access-date= 1 May 2015}}</ref> and in [[philosophy]].<ref> {{cite book | last1 = Blackburn | first1 = Simon | author-link1 = Simon Blackburn | year = 1994 | chapter = ordered n-tuple | title = The Oxford Dictionary of Philosophy | url = https://books.google.com/books?id=Mno8CwAAQBAJ | edition = 3 | location = Oxford | publisher = Oxford University Press | publication-date = 2016 | page = 342 | series = Oxford guidelines quick reference | isbn = 9780198735304 | access-date = 2017-06-30 | quote = ordered n-tuple[:] A generalization of the notion of an [...] ordered pair to sequences of n objects. }} </ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)