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: 97 64 42 70 47 14 77
Step I: 14 97 64 42 70 47 77
Step II: 14 42 97 64 70 47 77
Step III: 14 42 70 97 64 47 77
Step IV: 14 42 70 64 97 47 77
Step V: 14 42 70 64 47 97 77
Step VI: 14 42 70 64 47 77 97
Step VI is the last step of this input.
Input: 98 40 87 65 35 34 79
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) → Six
Compare each step of the illustration with the one before it. In each step, the number with the smallest digit sum (the sum of its two digits), among the numbers not yet arranged, moves to the next place from the left end, and all the other numbers keep their order.
Step I: 14 has digit sum 1 + 4 = 5, the smallest among the numbers left, so it moves to the first place from the left
Step II: 42 has digit sum 4 + 2 = 6, the smallest among the numbers left, so it moves to the second place from the left
Step III: 70 has digit sum 7 + 0 = 7, the smallest among the numbers left, so it moves to the third place from the left
Step IV: 64 has digit sum 6 + 4 = 10, the smallest among the numbers left, so it moves to the fourth place from the left
Step V: 47 has digit sum 4 + 7 = 11, the smallest among the numbers left, so it moves to the fifth place from the left
Step VI: 77 has digit sum 7 + 7 = 14, the smallest among the numbers left, so it moves to the sixth place from the left
After Step VI the numbers stand in increasing order of their digit sums, so the arrangement is complete.
Apply the same rule to the input 98 40 87 65 35 34 79.
Step I: 40 has digit sum 4 + 0 = 4, the smallest among the numbers left, so it moves to the first place from the left, giving 40 98 87 65 35 34 79
Step II: 34 has digit sum 3 + 4 = 7, the smallest among the numbers left, so it moves to the second place from the left, giving 40 34 98 87 65 35 79
Step III: 35 has digit sum 3 + 5 = 8, the smallest among the numbers left, so it moves to the third place from the left, giving 40 34 35 98 87 65 79
Step IV: 65 has digit sum 6 + 5 = 11, the smallest among the numbers left, so it moves to the fourth place from the left, giving 40 34 35 65 98 87 79
Step V: 87 has digit sum 8 + 7 = 15, the smallest among the numbers left, so it moves to the fifth place from the left, giving 40 34 35 65 87 98 79
Step VI: 79 has digit sum 7 + 9 = 16, the smallest among the numbers left, so it moves to the sixth place from the left, giving 40 34 35 65 87 79 98
After Step VI all the numbers are in their final places, so Step VI is the last step: six steps are needed.