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: 65 31 88 19 52 74 27
Step I: 19 31 88 65 52 74 27
Step II: 19 27 88 65 52 74 31
Step III: 19 27 31 65 52 74 88
Step IV: 19 27 31 52 65 74 88
Step IV is the last step of this input.
Input: 44 90 18 63 27 81 35
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) → 18 27 44 63 90 81 35
Compare each step of the illustration with the one before it. In each step, the smallest of the numbers not yet arranged changes places with the number standing in the next place from the left; no other number moves.
Step I: 19 is the smallest of the numbers left; it changes places with 65, the number in the first place from the left
Step II: 27 is the smallest of the numbers left; it changes places with 31, the number in the second place from the left
Step III: 31 is the smallest of the numbers left; it changes places with 88, the number in the third place from the left
Step IV: 52 is the smallest of the numbers left; it changes places with 65, the number in the fourth place from the left
After Step IV the numbers stand from the smallest to the largest, so the arrangement is complete.
Apply the same rule to the input 44 90 18 63 27 81 35.
Step I: 18 is the smallest of the numbers left; it changes places with 44, the number in the first place from the left, giving 18 90 44 63 27 81 35
Step II: 27 is the smallest of the numbers left; it changes places with 90, the number in the second place from the left, giving 18 27 44 63 90 81 35
So Step II is 18 27 44 63 90 81 35.
Why the other options are incorrect
Option (1) 18 90 44 63 27 81 35 — Incorrect. This is Step I; in Step II 27 must also be placed.
Option (2) 18 27 44 90 63 81 35 — Incorrect. Here 27 is put second and the numbers after it are pushed along; the machine interchanges 27 and 90, so 90 goes to the place where 27 stood.
Option (4) 18 27 35 63 90 81 44 — Incorrect. This is Step III, where 35 has also been placed.