When a line of words and numbers is fed into a machine, the machine rearranges it step by step following a particular rule. An illustration of an input and its rearrangement is given below.
Input: zinc 91 88 coal 71 iron 58 gold
Step I: coal zinc 88 71 iron 58 gold 91
Step II: coal gold zinc 71 iron 58 88 91
Step III: coal gold iron zinc 58 71 88 91
Step III is the last step of this input.
Input: 22 72 30 desk 61 vase lamp sofa
Following the same rule, which of the following will be Step III for this input?
Answer & explanation
Correct answer: option 4
The correct answer is Option (4) → desk lamp sofa 22 vase 30 61 72
Compare each step of the illustration with the one before it. In each step, the word that comes first in dictionary order among the words left moves to the next place from the left end, and the largest of the numbers left moves to the next place from the right end; the others keep their order.
Step I: ‘coal’ (first in dictionary order) moves to the first place from the left, and 91 (the largest number left) moves to the first place from the right
Step II: ‘gold’ (first in dictionary order) moves to the second place from the left, and 88 (the largest number left) moves to the second place from the right
Step III: ‘iron’ (first in dictionary order) moves to the third place from the left, and 71 (the largest number left) moves to the third place from the right
After Step III the words stand in dictionary order on the left and the numbers from the smallest to the largest on the right, so the arrangement is complete.
Apply the same rule to the input 22 72 30 desk 61 vase lamp sofa.
Step I: ‘desk’ (first in dictionary order) moves to the first place from the left, and 72 (the largest number left) moves to the first place from the right, giving desk 22 30 61 vase lamp sofa 72
Step II: ‘lamp’ (first in dictionary order) moves to the second place from the left, and 61 (the largest number left) moves to the second place from the right, giving desk lamp 22 30 vase sofa 61 72
Step III: ‘sofa’ (first in dictionary order) moves to the third place from the left, and 30 (the largest number left) moves to the third place from the right, giving desk lamp sofa 22 vase 30 61 72
So Step III is desk lamp sofa 22 vase 30 61 72.
Why the other options are incorrect
Option (1) desk lamp 22 30 vase sofa 61 72 — Incorrect. This is Step II; in Step III ‘sofa’ and 30 must also be moved.
Option (2) desk lamp sofa vase 22 30 61 72 — Incorrect. This is Step IV, the last step, where ‘vase’ and 22 have also been moved.
Option (3) desk lamp sofa 22 30 vase 61 72 — Incorrect. Here 30 stands before ‘vase’; it must go to the third place from the right, just before 61.