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: 68 16 cap 12 shoe coat 85 belt
Step I: belt 68 16 cap 12 shoe coat 85
Step II: belt cap 16 12 shoe coat 68 85
Step III: belt cap coat 12 shoe 16 68 85
Step IV: belt cap coat shoe 12 16 68 85
Step IV is the last step of this input.
Input: 31 44 hawk 77 swan 72 crow 54 dove kite
Following the same rule, how many steps will be needed to complete the arrangement of this input?
Answer & explanation
Correct answer: option 1
The correct answer is Option (1) → 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 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: ‘belt’ (first in dictionary order) moves to the first place from the left, and 85 (the largest number left) moves to the first place from the right
Step II: ‘cap’ (first in dictionary order) moves to the second place from the left, and 68 (the largest number left) moves to the second place from the right
Step III: ‘coat’ (first in dictionary order) moves to the third place from the left, and 16 (the largest number left) moves to the third place from the right
Step IV: ‘shoe’ (first in dictionary order) moves to the fourth place from the left, and 12 (the largest number left) moves to the fourth place from the right
After Step IV 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 31 44 hawk 77 swan 72 crow 54 dove kite.
Step I: ‘crow’ (first in dictionary order) moves to the first place from the left, and 77 (the largest number left) moves to the first place from the right, giving crow 31 44 hawk swan 72 54 dove kite 77
Step II: ‘dove’ (first in dictionary order) moves to the second place from the left, and 72 (the largest number left) moves to the second place from the right, giving crow dove 31 44 hawk swan 54 kite 72 77
Step III: ‘hawk’ (first in dictionary order) moves to the third place from the left, and 54 (the largest number left) moves to the third place from the right, giving crow dove hawk 31 44 swan kite 54 72 77
Step IV: ‘kite’ (first in dictionary order) moves to the fourth place from the left, and 44 (the largest number left) moves to the fourth place from the right, giving crow dove hawk kite 31 swan 44 54 72 77
Step V: ‘swan’ (first in dictionary order) moves to the fifth place from the left, and 31 (the largest number left) moves to the fifth place from the right, giving crow dove hawk kite swan 31 44 54 72 77
After Step V all the words and numbers are in their final places, so Step V is the last step: five steps are needed.