Talk:Tuple
From Wikipedia, the free encyclopedia
an n-tuple can be defined in terms of sets as (a1,a2,...,an)= {a1,{a1,a2},{a1,a2,a3},...,{a1,a2,...an}}
Would that not give the same for (1,2,1) and (1,2,2)? - Patrick 11:01 Mar 30, 2003 (UTC)
Yes it would. At least the inductive definition seems to be able to cope with duplicate elements without losing information.
Would anyone object if I would split the article in tuple (mathematics) and tuple (computer science)? I believe their usage is different enought to warrant that. Apart from that I find the term n-tupel a bit odd, and it is one I have not heard as such very often. -- Jan Hidders 01:07, 17 Feb 2004 (UTC)
The usage of tuples in computer science, as described in the article (where "components are identified by a unique field name and not by a position"), is not entirely correct. The Python programming language, for example, has a tuple datatype where components are referenced by their position. It also has a datatype where components are referenced by a unique name, however this is called dictionary. In other languages such a structure is also known as an associative array or a hashtable.
- True. But note that it doesn't say that this is how the term is always used in computer science. Guido, being the mathematician that he is, uses the term in its mathematical meaning and I as a computer scientist also very often do. However, if you look into the scientific literature on the theory of programming languages and database theory you will see that this is the standard definition. And of course, as is usual in computer science, people will give it their own meaning as they see fit. Even so, you are right that these usages should be reflected in the article. Note, btw, that associative arrays are not always the same as tuples because in PHP, for example, they do have a notion of position. And a hash table says something about how it is implemented, and is therefore also not exactly equivalent. -- Jan Hidders 09:18, 17 Feb 2004 (UTC)
- This definition indeed doesn't seem right. Here's the one on Foldoc: http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?tuple Fredrik 18:04, 27 Feb 2004 (UTC)
- What I find disturbing, is the example. In particular "Note that the order of the components is not relevant" ... in Python, the order is very important ... does this show up in computer science literature as a definition? If not I highly recommend removing someone's opionion of what a tuple is as shown in the example. -- Mwtoews Tuesday, April 11, 2006 at 20:14:01
Contents |
[edit] Move from N-tuple to tuple
The n in the title could just as well have been any other letter. It has no significance. I suggest we move this page to tuple. Unfortunately history exists there so I can't do it. --MarSch 15:28, 19 May 2005 (UTC)
- Support. James F. (talk) 16:34, 19 May 2005 (UTC)
- Support. Jitse Niesen 10:32, 20 May 2005 (UTC)
- Weak oppose. If we're using common names, I've always come across this as an "n-tuple", not a "tuple". Yes, n could have been any other letter, but it is the standard as far as I am aware: no one says "p-tuple" or "g-tuple". Merriam-Webster has no entry for "n-tuple", but lists "tuple" as a suffix, "-tuple", not as an independent word. MathWorld's entry is at "n-tuple". — Knowledge Seeker দ 13:35, 20 May 2005 (UTC)
This article has been renamed as the result of a move request. violet/riga (t) 14:45, 24 May 2005 (UTC)
[edit] Anyone notice...
That this article is just a shortened version of this?
Did you notice :"The source of this article is Wikipedia, the free encyclopedia. The text of this article is licensed under the GFDL." at the bottom? --MarSch 1 July 2005 10:14 (UTC)
[edit] suggest change
Am I the only one who thinks, that
if (a1, a2,...) = (a1, (a2,...)) then (1, 2, 2) = (1, (2,2)) = (1, (2), (2)) I really don't understand the reasoning that makes this into
(1,(2,(2,()))) = (1,(2, {{2}, {2, ∅}} )) = (1, {{2}, {2, {{2}, {2, ∅}}}} ) = {{1}, {1, {{2}, {2, {{2}, {2, </nowiki>∅}}}}}} in the "formal definitions" part in the middle. It seems to me like a copy-paste error.
Silencer1981 10:55, 7 September 2006 (UTC)
- (1,2,2) = (1,(2,2)) = (1,(2,(2))) = (1,(2,(2,()))). At each stage you take the innermost tuple and separate the first item from the remainder of the tuple. This finishes only when the innermost tuple has no first item i.e. when it is the empty tuple. EdC 22:25, 21 October 2006 (UTC)
[edit] Usage in computer science
The section says tuples have "three distinct meanings". I'm having difficulty finding more than two. Are the records defined in the first paragraph distinct from the sort of tuples Eiffel has? Those two are clearly distinct from the associative array usage.
Also, I'm not exactly clear on how the Python notion of tuples as immutable lists is related to the notion of records here. If anyone can clarify these points, I'd appreciate it.Chris Johnson 23:43, 10 March 2007 (UTC)
[edit] 100tuple
This is obviously incosequential but I was under the impression that 100-tuple in a joke like manner is called a "hectic". Cetuple is also right as it is just the normal english latin-based multiple word. I currently have not the time to reference that. anyone familiar with it? —Preceding unsigned comment added by Squidonius (talk • contribs) 00:18, 16 November 2007 (UTC)