What it is
Bank papers show a "machine" that rearranges a line of numbers or words step by step, with an input and a few steps as an example. You work out the rule and answer questions like "What is Step 3?" or "How many steps to finish?"
Here the rule is: at each step, the smallest number not yet placed moves to just after the numbers already placed; the rest keep their order.
How to solve it
- Find the rule from the example (or read it, as here).
- Apply it one step at a time, writing each step out in full.
- Count the steps if asked. The machine stops when the line is in order.
Tips and shortcuts
- Only one number moves per step. Everything else keeps its relative order.
- Write each step under the last, so a slip is easy to spot.
- The last step may come early: if the line is already in order, nothing moves.
- Words work the same way, with dictionary order instead of size.
Solved examples
Example 1 (easy)
Input: 45 12 78 33 60. Step 1?
The smallest, 12, moves to the front: 12 45 78 33 60.
Example 2 (medium)
Same input. Step 2?
The smallest of the rest, 33, moves just after 12: 12 33 45 78 60.
Example 3 (hard)
Same input. Step 3?
The next smallest, 45, is already in place, so nothing moves: 12 33 45 78 60.
Example 4 (hard)
Same input. Step 4?
60 moves before 78: 12 33 45 60 78. Now the line is in order.
Example 5 (medium): how many steps
For input 25 10 40 15, how many steps until it is sorted?
Step 1: 10 25 40 15. Step 2: 10 15 25 40 (sorted). 2 steps.