- Practice
- About 12 min
- 5 practice questions
Word arrangement machines
Follow a machine that arranges words in alphabetical order one word per step, and predict any step of the output.
If something looks wrong, please tell us.
In an input-output question a machine rearranges a line of words or numbers step by step. You are shown the input and sometimes a few steps, and you must find the rule and predict another step. The rule is applied in the same way at every step.
How to find the rule
- Compare the input with Step I: what moved, and where did it go?
- Compare Step I with Step II to confirm the same kind of move.
- State the rule in words, including the order (alphabetical, ascending, descending).
- Apply the rule to the new input, writing out every step.
Worked example
Input: pear fig apple kiwi date. The alphabetical order is apple, date, fig, kiwi, pear. At each step the next word in alphabetical order moves to the next place from the left.
| Step | Arrangement |
|---|---|
| Input | pear fig apple kiwi date |
| I | apple pear fig kiwi date |
| II | apple date pear fig kiwi |
| III | apple date fig pear kiwi |
| IV | apple date fig kiwi pear |
In Step I, apple moved to the first place and the other words kept their order. In Step II, date moved to the second place. The arrangement is finished at Step IV, which is one less than the number of words, because the last word falls into place by itself.
Find what moves at Step I, confirm at Step II, then apply the rule. A machine with n words finishes in at most n - 1 steps.
Key takeaways: describe the rule in words, check it on two steps, and write each step in full.
Check your understanding
-
1. Machine: at each step the next word in alphabetical order moves to the next place from the left, and the other words keep their order. Input: plum mango banana cherry. What is Step II?
- banana cherry plum mango
- banana plum mango cherry
- banana cherry mango plum
- cherry banana plum mango
Show answer
Answer: A. Order: banana, cherry, mango, plum. Step I: banana plum mango cherry. Step II: cherry moves to second place, giving banana cherry plum mango.
-
2. Machine: at each step the next word in alphabetical order moves to the next place from the left, and the other words keep their order. Input: plum mango banana cherry. How many steps are needed?
- 2
- 3
- 4
- 5
Show answer
Answer: B. Step I: banana plum mango cherry. Step II: banana cherry plum mango. Step III: banana cherry mango plum, which is finished. So 3 steps.
-
3. For the same machine, at most how many steps are needed for seven words?
- 7
- 5
- 6
- 8
Show answer
Answer: C. A machine with n words finishes in at most n - 1 steps, because the last word falls into place by itself: 7 - 1 = 6.
-
4. Machine: at each step the next word in alphabetical order moves to the next place from the left, and the other words keep their order. Input: wolf goat ant deer bee. What is Step III?
- ant bee wolf goat deer
- ant bee deer goat wolf
- ant wolf goat deer bee
- ant bee deer wolf goat
Show answer
Answer: D. Order: ant, bee, deer, goat, wolf. Step I: ant wolf goat deer bee. Step II: ant bee wolf goat deer. Step III: deer moves to third place, giving ant bee deer wolf goat.
-
5. You are shown an input and Step I of an unknown machine. What should you do first to find the rule?
- Look only at the last step
- Compare the input with Step I to see what moved and where it went
- Count the letters in each word
- Assume the line is reversed
Show answer
Answer: B. The lesson's method starts by comparing the input with Step I to see what moved, then confirming the same kind of move from Step I to Step II.
Sign in to keep track of the lessons you finish.