AQA 7517, section 4.5.1.6
Ordinal numbers describe the position of objects in an ordered set: 1st, 2nd, 3rd, and so on. They tell you where something is, not how many there are.
Ordinal and cardinal numbers
| Cardinal number | Ordinal number | |
|---|---|---|
| Tells you | How many | Position in order |
| Example | 3 apples | the 3rd apple in the row |
| Question answered | "How many are there?" | "Which one is it?" |
Well-ordered sets
When objects are placed in order, ordinal numbers tell you each one's position. For example, take the well-ordered set
Then a is the 1st object, b is the 2nd, c is the 3rd and d is the 4th. A set is well-ordered if every part of it has a clear first item, so there is an unambiguous order.
Ordinals in programming
An array or list is an ordered collection, so each item has a position.
letters = ["a", "b", "c", "d"]
print(letters[0]) # a: the 1st item (index 0)
print(letters[2]) # c: the 3rd item (index 2)
Watch out for the off by one difference. In most languages the index starts at 0, but the ordinal position starts at 1. So the item at index 2 is the 3rd item.
| Index | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| Item | a | b | c | d |
| Ordinal position | 1st | 2nd | 3rd | 4th |
Ordinal numbers are also used for:
- the rank of a result: 1st, 2nd, 3rd place;
- the order of steps in an algorithm;
- the position of a record in a sorted file.
Worked example
Task: a sorted list is [3, 8, 12, 19, 25]. Give the ordinal position of 12, and the index of the 4th item.
- 12 is the 3rd item, so its ordinal position is 3rd (index 2).
- The 4th item is 19, which is at index 3.
The ordinal is always one more than the index when counting from 0.
Exam tip: keep ordinals (position) separate from cardinals (how many). When a question talks about "the 5th element", check whether the numbering starts at 0 or 1.
Check yourself
What do ordinal numbers describe?
The position of objects in an ordered set, such as 1st, 2nd and 3rd.
In the set {p, q, r, s}, what is the 3rd object?
r.
How does an ordinal number differ from a cardinal number?
An ordinal number gives position in order (the 3rd item), whereas a cardinal number says how many there are (3 items).