• Foundation
  • About 12 min
  • 5 practice questions

What an input-output machine does

Understand the machine-rearrangement format and learn to spot the rule from the first step by comparing the input with step I.

If something looks wrong, please tell us.

In an input-output question, a machine takes a line of words or numbers (the input) and rearranges it step by step according to a fixed rule. You are shown the input and some steps, and asked to find a later step, the final step, or the number of steps. Everything depends on finding the rule from the steps you can see.

How to find the rule

Finding the rule

  1. Input over Step I Write the input and Step I one above the other.
  2. See what moved Note what moved, where it went and what stayed in order.
  3. Confirm with Step II Check that the same rule is repeated.
  4. Apply step by step Run the rule on the new input, writing every step.
  1. Write the input and Step I one above the other.
  2. See what moved, and where it went, and what stayed in order.
  3. Compare Step I with Step II to confirm the same rule is repeated.
  4. Apply the rule to the new input, step by step, writing every step.

Typical rules: move the smallest number to the left end, move the largest to the right end, arrange words alphabetically one at a time, or alternate between two rules. The rest of the line does not change unless the rule says so.

Worked examples

Example 1. Input: 52 31 18 76 40. Step I: 18 52 31 76 40. Step II: 18 31 52 76 40. Step III: 18 31 40 52 76. What is the rule? In Step I the smallest number (18) moved to the front and the others kept their order. In Step II the next smallest (31) moved to second place. In Step III the next smallest (40) moved to third place. Rule: each step puts the next smallest number into its correct position from the left. The machine stops when the line is in ascending order, which here takes 3 steps.

Example 1, step by step

  1. Input: 52 31 18 76 40
  2. Step I: 18 52 31 76 40 18, the smallest, moves to the front.
  3. Step II: 18 31 52 76 40 31 moves to second place.
  4. Step III: 18 31 40 52 76 40 moves to third place; the line is in ascending order.

Example 2. Apply the same rule to the input 60 25 14 33. Step I: 14 60 25 33 (smallest to the front). Step II: 14 25 60 33 (25 moves to second place). Step III: 14 25 33 60 (33 moves to third place). The line is now in ascending order. It takes 3 steps.

Example 3. Input: tea milk cup. Rule: arrange the words in alphabetical order, one word per step, starting from the left. The alphabetical order is cup, milk, tea. Step I: cup tea milk. Step II: cup milk tea. The answer to 'how many steps?' is 2.

Find the rule from Step I and Step II, then apply it one step at a time. Write every step.

— Rule to remember

Key takeaways

  • Compare input and Step I to find what moved.
  • The rest of the line stays in order unless the rule says otherwise.
  • The machine stops when the line meets the final arrangement.

Check your understanding

  1. 1. Rule: at each step the smallest remaining number moves to the next place from the left, and the others keep their order. Input: 45 19 62 7 30. What is Step I?

    1. 7 45 19 62 30
    2. 7 19 30 45 62
    3. 19 45 62 7 30
    4. 45 19 62 30 7
    Show answer

    Answer: A. The smallest number, 7, moves to the front and the others keep their order: 7 45 19 62 30.

  2. 2. Rule: at each step the smallest remaining number moves to the next place from the left, and the others keep their order. Input: 45 19 62 7 30. What is Step II?

    1. 7 19 30 45 62
    2. 7 19 45 62 30
    3. 7 45 19 30 62
    4. 19 7 45 62 30
    Show answer

    Answer: B. Step I is 7 45 19 62 30. In Step II the next smallest, 19, moves to second place: 7 19 45 62 30.

  3. 3. Rule: at each step the smallest remaining number moves to the next place from the left, and the others keep their order. Input: 45 19 62 7 30. In how many steps is the line in ascending order?

    1. 2
    2. 4
    3. 3
    4. 5
    Show answer

    Answer: C. Step I: 7 45 19 62 30. Step II: 7 19 45 62 30. Step III: 30 moves to third place, giving 7 19 30 45 62, which is in order. So 3 steps.

  4. 4. Input: 38 12 50 21. Step I: 12 38 50 21. Which rule does Step I show?

    1. The largest number moves to the right end
    2. The whole line is reversed
    3. Every number increases by 1
    4. The smallest number moves to the left end and the others keep their order
    Show answer

    Answer: D. Comparing the input with Step I, only 12 (the smallest) moved, to the front, and 38 50 21 stayed in the same order.

  5. 5. Rule: one word per step moves to the next place from the left in alphabetical order. Input: rice dal oil. How many steps are needed?

    1. 1
    2. 2
    3. 3
    4. 4
    Show answer

    Answer: B. Alphabetical order is dal, oil, rice. Step I: dal rice oil. Step II: dal oil rice, which is sorted. So 2 steps.

Privacy · Terms · Refunds · Delivery