Revision notes

Input-Output: Foundation

The key points, rules to remember, tables and diagrams from all 9 lessons, on one page for quick revision. To keep a copy, use your browser's Print and choose "Save as PDF".

Lesson 1

What an input-output machine does

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.

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.

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

— Rule to remember
  • 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.
Read the full lesson

Lesson 2

Arranging words alphabetically and numbers in order

One word per step

  1. Input: pen cat dog bag
  2. Step I: bag pen cat dog bag moves to the front.
  3. Step II: bag cat pen dog cat moves to second place.
  4. Step III: bag cat dog pen dog moves to third place; the line is sorted.

Do exactly one move per step. The final step is the first one where the line is fully in order.

— Rule to remember
  • Apply one move per step.
  • Sort words by first letter, then second letter, and so on.
  • The rest of the line keeps its order.
Read the full lesson

Lesson 3

Finding a given step and the number of steps

Two rules in alternation

  1. Input: 56 34 12 8 41
  2. Step I: 8 56 34 12 41 Odd step: the smallest remaining number moves to the left.
  3. Step II: 8 34 12 41 56 Even step: the largest remaining number moves to the right end.
  4. Step III: 8 12 34 41 56 Odd step: 12 goes to second place; the line is sorted.

After k steps of an ascending rule from the left, the k smallest numbers are fixed at the left end.

— Rule to remember
  • After k steps, k places are fixed.
  • The number of steps may be fewer than the number of elements.
  • Write each step on paper; do not skip.
Read the full lesson

Lesson 4

Mixed rules and pattern questions

Strategy for mixed machines

  1. Input and first two steps Write them down.
  2. State each rule One sentence for each step type.
  3. Run the rules On the new input, one step at a time.
  4. Check the last step Look for the sorted state.

State the rule for odd and even steps separately, and apply them in turn.

— Rule to remember
  • Follow the rule exactly as the examples show it.
  • Items not mentioned by a rule keep their order.
  • Write each step; do not guess the final line.
Read the full lesson

Lesson 5

Rotation, swapping and arithmetic machines

Machines that do not sort

  • Rotation In each step the first element moves to the end of the line.
  • Swapping inward Step I swaps the first and last; Step II the second and second-last, and so on.
  • Arithmetic Each step adds or subtracts a fixed amount at certain positions.

Rotation comes back to the input

  1. 7 3 9 5 The input, and Step IV.
  2. 3 9 5 7 Step I
  3. 9 5 7 3 Step II
  4. 5 7 3 9 Step III

Then back to step 1: 7 3 9 5

For an arithmetic machine, track each position separately: odd positions follow one rule, even positions another.

— Rule to remember
  • Name the rule in one sentence from Step I.
  • A rotation of n elements repeats after n steps.
  • Track odd and even positions separately in arithmetic machines.
Read the full lesson

Lesson 6

Sorting words by length and by last letter

Decide the key first (length or last letter), write the sorted order, and then move one word per step.

— Rule to remember
  • Count letters for a length rule; look at the final letter for a last-letter rule.
  • Equal keys keep their original order.
  • A word already in its place costs no step.
  • Write the final order first, so you know where each word is heading.
Read the full lesson

Lesson 7

Odd and even numbers in a machine

MachineStep IStep II
Machine 1All even numbers move to the left end in their original order, then the odd numbers in their original orderEach group is arranged in ascending order
Machine 2All odd numbers move to the left end in their original order, then the even numbers in their original orderThe odd numbers are arranged in ascending order and the even numbers in descending order

Separate by the last digit, keep the original order inside each group in Step I, and sort only when the rule says so.

— Rule to remember
  • The last digit decides whether a number is odd or even.
  • Step I usually only groups; sorting comes later.
  • Inside a group, keep the original order until a rule changes it.
  • Check that the total count of numbers is the same in every step.
Read the full lesson

Lesson 8

Reversing the line and reversing inside items

Find how many steps the pattern takes to repeat, divide the step number by that period, and use the remainder.

— Rule to remember
  • Reversing twice returns the original.
  • Rule A repeats every 4 steps; Rule B repeats every 2 steps.
  • If the remainder is 0, the step equals the last step of the cycle (Step IV in Rule A).
  • Keep reversals of the line and reversals inside items separate.
Read the full lesson

Lesson 9

Answering questions from a step

LineNumbers
Input64 27 91 38 55 12
Step I12 64 27 91 38 55
Step II12 27 64 91 38 55
Step III12 27 38 64 91 55
Step IV12 27 38 55 64 91

Use the right line, count from the right end, and count only the items between two named items.

— Rule to remember
  • Write every step before you answer.
  • Name the line and the end (left or right) before counting.
  • 'Between' means not counting the two named items.
  • Check the final line against the sorted order to be sure no step was missed.
Read the full lesson

Privacy · Terms · Refunds · Delivery