# I Can someone define what a tuple is for me?

Tags:
1. Mar 6, 2016

### Solid Snake

Ok, so I read that a tuple is an ordered list of n elements, where n is a non-negative integer. Sometimes I get confused with tuples and partially ordered sets. So if I organized a list of all the airplanes in a particular airport, would that be a tuple, or would that be a set? I'm leaning towards it being a set, but by reading the definition of a tuple, I can also see it being a tuple. Other than a point in a graph, or a vector, where else in real life would I see something and say, "look, there's a tuple!!!". I would really want a clear definition in layman's terms so that I can be able to have these concepts clear in my mind, in particular the concept of a tuple.

2. Mar 6, 2016

### Simon Bridge

The trick with tuples is that the position of the number in sequence has a meaning ... like the number 157 is a 3-tuple because the positions code hundreds, tens, and ones from left to right. The order has to be important ... like 1st, 2nd, 3rd ... i.e. a set of polygons could be described by a tuple where the nth entry in the list is the number of polygons with n sides in the set. If I draw the polygons from the set one at a time, then the sequence of polygons could be a tuple.
Ordered pairs are a list of 2-tuples in the order that they are to be drawn on a graph ... (x_i,y_i) if there are a finite number of them [edit: I am corrected, you cannot have an infinity-tuple] the position of the number in the list refers to a component of position on a graph.

In the end you define a mathematical object by it's list of properties ...
Distinguish from a set by:
1. $(1,2,3)\neq (3,2,1)$ while $\{1,2,3\} = \{3,2,1\}$
2. Multiple entries are allowed: $(1,1,3)$ would be a tuple from set $\{1,3\}$
3. Must have a finite number of elements.

So for the set of aircraft at an airport: organize by, say, weight, then that is just a sorted list. But if you have, say, 10 gates at the airport, then you can define a 10-tuple that stores the flight-number currently docked at each gate (0000 for empty gate, say). You could presumably define weight ranges so-many tonnes wide, and record the number of aircraft at the airport that fit in each weight range ... store that as a tuple. Similarly the top 3 heaviest aircraft would be a 3-tuple is the 1st position were heaviest etc. The names of the medal winners at an olympic event (if in a specific order each time) would be a 3-tuple like that.

It's unusual, in practise, that you actually care about the exact name of a mathematical structure like this though: you just use whatever seems appropriate at the time. Certainly not worth focussing on... this is probably the most I've used the word in a decade. The time the name becomes important is when you want to use someone elses result for a general property - in that case you realize the property and look up the name of the theorem that applies. (The other time is in an exam and you are specifically asked...) Thus: this is where I found out that I'm wrong ;)

3. Mar 7, 2016

### Solid Snake

So just to make sure I understand you well, can I understand a tuple to be a list of data where each element is related to each other and ordered in that each index holds a value representing a specific thing????

4. Mar 7, 2016

### Simon Bridge

The element position in the list should have meaning - the elements are related to each other in that they all appear on the list.
Examples of what I mean by the position in the list having meaning have been provided above: there is something special about being first, second, fifty-fourth or whatever on the list so that the order of the elements matters.

Imagine the kind of list where you number the entries ... a tuple is just such a list, only the numbers are implied by the position of the entry: #1 on the list is the 1st entry in the tuple.

Note: Everything is related to everything else in some way, though, usually, you don't bother making the list unless the elements are related in some way you find important.

5. Mar 7, 2016

### MrAnchovy

Using your example of an airport, a good example of a tuple would be (flight number, destination, departure time) or (flight number, date, seat number, passenger name).