Input-Output Machine

advanced28 min read

A machine rearranges a line of words and numbers by a fixed rule, one element per step, until the line is sorted. How to discover the rule from consecutive steps, then answer questions about a specific step, the final step, and the step count.

What you will be able to do

  • Compare two consecutive steps to isolate the single element that moved and where it went.
  • State the rule as 'which element is picked' plus 'where it is placed' plus 'when the machine stops'.
  • Generate any requested step from the input without writing every step in full once the rule is known.
  • Count the total steps as the number of elements the rule still has to place.

What is inside this lesson

  1. 1A rule applied one step at a time
  2. 2Finding the rule
  3. 3Two common rule families
  4. 4Answering step and count questions
  5. 5Worked example 1: numbers to the left
  6. 6Worked example 2: words to the right
  7. 7Common mistakes
  8. 8Quick revision
  9. 9Practice
The lesson itself is for members

Reading the 9 sections above is free. A free account opens the first 2 topics of every subject in full, along with flashcards and private notes.