Practice30Create account

A word-and-number arrangement machine, when given an input line of words and numbers, rearranges it in steps. The elements it has not yet touched always stand together at the left of the line, in their original order. In each step the machine takes one untouched element and places it at the extreme right end of the line: in odd-numbered steps it takes the leftmost untouched element, and in even-numbered steps it takes the rightmost untouched element. The machine stops once no untouched element is left.
Step 3 of a certain run of this machine reads: 27 pine 48 63 quill opal.
Which of the following was the input line?

Competition practiceInput-Output
  • A63 opal 27 pine 48 quill
  • Bopal 63 27 pine 48 quill
  • C63 opal 27 pine quill 48
  • D27 opal 63 pine 48 quill

Step-by-Step Solution

Run each candidate forward three steps. From 63 opal 27 pine 48 quill: Step 1 takes 63 and gives opal 27 pine 48 quill 63; Step 2 takes quill and gives opal 27 pine 48 63 quill; Step 3 takes opal and gives 27 pine 48 63 quill opal — a match. The other three fail on the detail of which element is where. Starting opal 63 27 pine 48 quill reaches 27 pine 48 opal quill 63; starting 63 opal 27 pine quill 48 reaches 27 pine quill 63 48 opal; and starting 27 opal 63 pine 48 quill reaches 63 pine 48 27 quill opal. A useful check on the quoted line: the three untouched elements left at its head, 27 pine 48, must still be in their input order, which they are only in the correct candidate.
Answer: A) 63 opal 27 pine 48 quill

Master this topic in 30 minutes a day.

Don't just memorise the answer — build a daily practice habit.

Practice 5 Similar Questions Free →

All Input-Output practice questions

More Input-Output practice

A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…A word-and-number arrangement machine, when given an input line of words and numbers,…