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: 27 85 31 50 70 94
Step I: 94 27 85 31 50 70
Step II: 94 85 27 31 50 70
Step III: 94 85 70 27 31 50
Step IV: 94 85 70 50 27 31
Step V: 94 85 70 50 31 27
Step V is the last step of this input.
Input: 19 98 63 57 43 77
Following the same rule, which of the following will be Step II for this input?
Answer & explanation
Correct answer: option 1
The correct answer is Option (1) → 98 77 19 63 57 43
Compare each step of the illustration with the one before it. In each step, the largest of the numbers not yet arranged moves to the next place from the left end, and all the other numbers keep their order.
Step I: 94 is the largest of the numbers left, so it moves to the first place from the left
Step II: 85 is the largest of the numbers left, so it moves to the second place from the left
Step III: 70 is the largest of the numbers left, so it moves to the third place from the left
Step IV: 50 is the largest of the numbers left, so it moves to the fourth place from the left
Step V: 31 is the largest of the numbers left, so it moves to the fifth place from the left
After Step V every one of the numbers is in its final place, so the arrangement is complete.
Apply the same rule to the input 19 98 63 57 43 77.
Step I: 98 is the largest of the numbers left, so it moves to the first place from the left, giving 98 19 63 57 43 77
Step II: 77 is the largest of the numbers left, so it moves to the second place from the left, giving 98 77 19 63 57 43
So Step II is 98 77 19 63 57 43.
Why the other options are incorrect
Option (2) 98 19 63 57 43 77 — Incorrect. This is Step I; in Step II 77 must also move.
Option (3) 98 77 63 57 43 19 — Incorrect. Here 77 changes places with 19; the machine moves 77 into the second place from the left and the other numbers keep their order.
Option (4) 98 63 19 57 43 77 — Incorrect. Here 63 has been moved in Step II, but the number to move is 77, the largest of the numbers left.