- Foundation
- About 14 min
- 5 practice questions
Mixed rules and pattern questions
Handle machines that combine two rules, such as sorting words first and numbers next, and answer questions about the final arrangement.
If something looks wrong, please tell us.
Harder machines mix different kinds of items (words and numbers) or alternate between two rules. Read the first two steps carefully and write the rule for odd steps and for even steps separately.
Strategy
Strategy for mixed machines
- Input and first two steps Write them down.
- State each rule One sentence for each step type.
- Run the rules On the new input, one step at a time.
- Check the last step Look for the sorted state.
- Write the input and the first two steps.
- State the rule in one sentence for each step type.
- Run the rules on the new input, one step at a time.
- Check the last step for the sorted state.
Worked examples
Example 1. Input: 42 tree 17 ball 85 apple. Rule: in each of the first three steps, the next word in alphabetical order moves to the next free place at the left end. After the words are placed, each further step moves the next smallest number into the next place. The words in alphabetical order are apple, ball, tree. Step I: apple 42 tree 17 ball 85. Step II: apple ball 42 tree 17 85. Step III: apple ball tree 42 17 85.
Example 2. Continue Example 1. The numbers in ascending order are 17, 42, 85. Step IV: the smallest number, 17, moves to the next place: apple ball tree 17 42 85. The numbers 42 and 85 are now already in order. The final output is apple ball tree 17 42 85, reached in 4 steps.
Example 3 (alternating rules). Input: 24 8 16 4. Rule: odd steps move the largest remaining number to the right end; even steps move the smallest remaining number to the left end. Step I: 8 16 4 24 (24 goes to the right end). Step II: 4 8 16 24 (4 goes to the left end). The line is sorted after 2 steps.
State the rule for odd and even steps separately, and apply them in turn.
Key takeaways
- 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.
Check your understanding
-
1. Rule: first the words move, one per step, in alphabetical order to the next place from the left; after that, the numbers move, one per step, in ascending order to the next place. Input: 64 kite 23 jug 51 ant. What is Step II?
- ant jug 64 kite 23 51
- ant 64 kite 23 jug 51
- ant jug kite 64 23 51
- jug ant 64 kite 23 51
Show answer
Answer: A. Words in order: ant, jug, kite. Step I: ant 64 kite 23 jug 51. Step II: jug moves to second place, giving ant jug 64 kite 23 51.
-
2. Rule: first the words move, one per step, in alphabetical order to the next place from the left; after that, the numbers move, one per step, in ascending order to the next place. Input: 64 kite 23 jug 51 ant. How many steps in all?
- 4
- 6
- 5
- 3
Show answer
Answer: C. Steps I-III place ant, jug, kite: ant jug kite 64 23 51. Step IV places 23: ant jug kite 23 64 51. Step V places 51: ant jug kite 23 51 64. So 5 steps.
-
3. Rule: first the words move, one per step, in alphabetical order to the next place from the left; after that, the numbers move, one per step, in ascending order to the next place. Input: 64 kite 23 jug 51 ant. What is the final output?
- ant jug kite 64 51 23
- ant jug kite 23 51 64
- 23 51 64 ant jug kite
- ant jug kite 23 64 51
Show answer
Answer: B. The words end in alphabetical order on the left (ant jug kite) and the numbers in ascending order after them (23 51 64).
-
4. Rule: odd steps move the largest remaining number to the next place from the right; even steps move the smallest remaining number to the next place from the left. Input: 36 12 48 6 24. What is Step II?
- 36 12 6 24 48
- 6 12 24 36 48
- 6 36 12 48 24
- 6 36 12 24 48
Show answer
Answer: D. Step I: 48 goes to the right end, giving 36 12 6 24 48. Step II: 6 goes to the left end, giving 6 36 12 24 48.
-
5. Rule: words move to the left in alphabetical order, one per step; numbers are not moved. Input: 9 pot 4 bun 2. What is the final arrangement?
- bun pot 2 4 9
- bun pot 9 4 2
- pot bun 9 4 2
- 9 4 2 bun pot
Show answer
Answer: B. Step I: bun 9 pot 4 2. Step II: bun pot 9 4 2. The rule does not mention numbers, so they keep their original order 9 4 2.
Sign in to keep track of the lessons you finish.