A word arrangement machine, when given an input line of words, rearranges them step by step following a particular rule. An illustration of an input and its rearrangement is given below.
Input: quartz breeze olive hail banana compass shovel
Step I: banana quartz breeze olive hail compass shovel
Step II: banana breeze quartz olive hail compass shovel
Step III: banana breeze compass quartz olive hail shovel
Step IV: banana breeze compass hail quartz olive shovel
Step V: banana breeze compass hail olive quartz shovel
Step V is the last step of this input.
Input: pencil honey meteor ring calendar brick calf
Following the same rule, how many steps will be needed to complete the arrangement of this input?
Answer & explanation
Correct answer: option 2
The correct answer is Option (2) → Five
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 not yet arranged moves to the next place from the left end, and all the other words keep their order.
Step I: ‘banana’ comes first in dictionary order, so it moves to the first place from the left
Step II: ‘breeze’ comes first in dictionary order, so it moves to the second place from the left
Step III: ‘compass’ comes first in dictionary order, so it moves to the third place from the left
Step IV: ‘hail’ comes first in dictionary order, so it moves to the fourth place from the left
Step V: ‘olive’ comes first in dictionary order, so it moves to the fifth place from the left
After Step V the words stand in dictionary order, so the arrangement is complete.
Apply the same rule to the input pencil honey meteor ring calendar brick calf.
Step I: ‘brick’ comes first in dictionary order, so it moves to the first place from the left, giving brick pencil honey meteor ring calendar calf
Step II: ‘calendar’ comes first in dictionary order, so it moves to the second place from the left, giving brick calendar pencil honey meteor ring calf
Step III: ‘calf’ comes first in dictionary order, so it moves to the third place from the left, giving brick calendar calf pencil honey meteor ring
Step IV: ‘honey’ comes first in dictionary order, so it moves to the fourth place from the left, giving brick calendar calf honey pencil meteor ring
Step V: ‘meteor’ comes first in dictionary order, so it moves to the fifth place from the left, giving brick calendar calf honey meteor pencil ring
After Step V all the words are in their final places, so Step V is the last step: five steps are needed.