- Practice
- About 13 min
- 5 practice questions
Other orderings: word length, reverse alphabet and the right-hand end
Follow machines that arrange words by length or in reverse dictionary order, and machines that fill the right-hand end first, without mixing up direction and order.
If something looks wrong, please tell us.
The alphabetical and ascending-number machines are the simplest, but exams also use machines with a different order or a different end. The method does not change: write the rule in words, apply it to Step I, then continue. What changes is the order that decides which item moves next and the end of the line at which it is placed. This lesson shows three common variations.
Variation 1: arrange by number of letters
Here the rule is: at each step the word with the fewest letters, among those not yet placed, moves to the next place from the left. A fair question has no two words of the same length. If two words had the same length, the question would have to say which comes first.
Example 1. Input: lion rabbit ox tiger cat. The lengths are 4, 6, 2, 5, 3, so the order is ox, cat, lion, tiger, rabbit.
| Step | Arrangement |
|---|---|
| Input | lion rabbit ox tiger cat |
| I | ox lion rabbit tiger cat |
| II | ox cat lion rabbit tiger |
| III | ox cat lion rabbit tiger |
| IV | ox cat lion tiger rabbit |
Step III repeats Step II because lion is already in third place. The machine finishes at Step IV.
Variation 2: reverse dictionary order
If the rule says the word that comes last in the dictionary moves first, the final line reads from the last word in the dictionary to the first. In the input mango, apple, peach, grape the order is peach, mango, grape, apple.
Example 2. Input: mango apple peach grape. Step I: peach moves to the front, giving peach mango apple grape. Step II: mango should move to second place, but it is already there, so the line is unchanged. Step III: grape moves to third place, giving peach mango grape apple. The machine takes 3 steps.
Variation 3: the right-hand end
Some machines fill the line from the right. The rule might be: at each step the largest number, among those not yet placed, moves to the next place from the right. Step I puts the largest at the far right, Step II puts the next largest second from the right, and so on. The items not moved keep their order. The final line reads in ascending order from left to right.
Example 3. Input: 34 71 18 56 40.
| Step | Arrangement |
|---|---|
| Input | 34 71 18 56 40 |
| I | 34 18 56 40 71 |
| II | 34 18 40 56 71 |
| III | 34 18 40 56 71 |
| IV | 18 34 40 56 71 |
Step II moved 56 to the second place from the right. In Step III, 40 was already third from the right, so nothing changed. The machine finishes at Step IV, with 18 34 40 56 71.
Decide two things before you start: which item moves next (smallest, largest, shortest, last in the dictionary) and which end it moves to (left or right).
Checking your result
- The first Step must put the correct item at the correct end. If it does not, you have misread the rule.
- At the end, read the line from the end that was filled first. It should follow the rule in order.
- Count the items. If a step loses or repeats an item, there is a slip.
Example 4. Input: moon planet to cloud sun, with the rule 'the longest word moves first to the left'. The word lengths are 4, 6, 2, 5, 3, so the order is planet, cloud, moon, sun, to. Step I: planet moon to cloud sun. Step II: planet cloud moon to sun. Step III: moon is already in third place, so the line is unchanged. Step IV: sun moves to fourth place, giving planet cloud moon sun to. The machine takes 4 steps.
Key takeaways. Settle the order and the end before Step I. Equal-length words need a stated tie-break. Steps in which an item is already in place still count. For a right-hand-end machine, the result reads in ascending order from left to right when the largest goes to the right first.
Check your understanding
-
1. Rule: the word with the fewest letters moves first to the left. Input: ox tiger cat rabbit lion. What is Step II?
- ox cat lion tiger rabbit
- ox tiger cat rabbit lion
- ox cat tiger rabbit lion
- cat ox tiger rabbit lion
Show answer
Answer: C. The order is ox, cat, lion, tiger, rabbit. Step I leaves the line unchanged because ox is already first. Step II moves cat to second place, giving ox cat tiger rabbit lion.
-
2. Rule: the largest number moves first to the far right, then the next largest to the second place from the right, and so on. Input: 52 17 90 33 65. How many steps does the machine need?
- 3
- 2
- 4
- 5
Show answer
Answer: A. Step I: 52 17 33 65 90. Step II: 65 is already second from the right, so the line is unchanged. Step III: 52 moves to third from the right, giving 17 33 52 65 90. So there are 3 steps.
-
3. Rule: the word last in the dictionary moves first to the left. Input: pen ant bee cow. What is the final arrangement?
- ant bee cow pen
- pen cow bee ant
- pen bee cow ant
- cow pen bee ant
Show answer
Answer: B. The order is pen, cow, bee, ant. Step I leaves the line unchanged, Step II gives pen cow ant bee, and Step III gives pen cow bee ant.
-
4. Rule: the longest word moves first to the left. Input: moon planet to cloud sun. How many steps does the machine need?
- 3
- 5
- 2
- 4
Show answer
Answer: D. The order is planet, cloud, moon, sun, to. Step I: planet moon to cloud sun. Step II: planet cloud moon to sun. Step III leaves the line unchanged. Step IV: planet cloud moon sun to. So there are 4 steps.
-
5. A machine puts the smallest number at the far right first, then the next smallest second from the right, and so on. How does the final line read from left to right?
- Numbers in ascending order
- Numbers in the input order
- Numbers in descending order
- Numbers with the largest in the middle
Show answer
Answer: C. The smallest ends at the far right, then the next smallest to its left, and so on. So the largest is at the left and the line reads in descending order.
Sign in to keep track of the lessons you finish.