A number arrangement machine, when given an input line of numbers, rearranges them step by step following a particular rule. An illustration of an input and its rearrangement is given below.
Input: 14 78 70 72 11 27 93
Step I: 70 78 14 72 11 27 93
Step II: 70 11 14 72 78 27 93
Step III: 70 11 72 14 78 27 93
Step IV: 70 11 72 93 78 27 14
Step V: 70 11 72 93 14 27 78
Step V is the last step of this input.
Input: 54 28 65 26 62 70 27
Following the same rule, which of the following will be Step II for this input?
Answer & explanation
Correct answer: option 3
The correct answer is Option (3) → 70 62 65 26 28 54 27
Compare each step of the illustration with the one before it. In each step, the number with the smallest unit digit (last digit), among the numbers not yet arranged, changes places with the number standing in the next place from the left; no other number moves.
Step I: 70 has unit digit 0, the smallest among the numbers left; it changes places with 14, the number in the first place from the left
Step II: 11 has unit digit 1, the smallest among the numbers left; it changes places with 78, the number in the second place from the left
Step III: 72 has unit digit 2, the smallest among the numbers left; it changes places with 14, the number in the third place from the left
Step IV: 93 has unit digit 3, the smallest among the numbers left; it changes places with 14, the number in the fourth place from the left
Step V: 14 has unit digit 4, the smallest among the numbers left; it changes places with 78, the number in the fifth place from the left
After Step V the numbers stand in increasing order of their unit digits, so the arrangement is complete.
Apply the same rule to the input 54 28 65 26 62 70 27.
Step I: 70 has unit digit 0, the smallest among the numbers left; it changes places with 54, the number in the first place from the left, giving 70 28 65 26 62 54 27
Step II: 62 has unit digit 2, the smallest among the numbers left; it changes places with 28, the number in the second place from the left, giving 70 62 65 26 28 54 27
So Step II is 70 62 65 26 28 54 27.
Why the other options are incorrect
Option (1) 70 62 54 26 28 65 27 — Incorrect. This is Step III, where 54 has also been moved.
Option (2) 70 62 28 65 26 54 27 — Incorrect. Here 62 has been moved up and the other numbers have shifted; the machine only interchanges 62 and 28, and no other number moves.
Option (4) 70 28 65 26 62 54 27 — Incorrect. This is Step I; in Step II 62 must also move.