Let be a list of the first 10 positive integers such that for each either or or both appear somewhere before in the list. How many such lists are there?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
The numbers placed so far always form a block of consecutive integers, so reading backwards each removed number is an end of the block: 2 choices, nine times.
Solution
The rule says every new entry is a neighbor of something already listed. So the set is always a block of consecutive integers: it starts as a single number, and attaching a neighbor to a block of consecutive integers produces a longer block. Conversely, any list in which each prefix is a block satisfies the rule, because a new number that extends a block is adjacent to the block's end.
Now count by reading the list backwards. The full set is a block, and must be one of its two ends ( or ), otherwise the first nine entries would not form a block. Removing leaves a block of nine numbers, and must be one of its two ends. This continues: each of is an end of the current block, giving choices each, and is whatever single number remains.
Total:
The answer is .
Why this works
The condition is local ("adjacent to something earlier"), but its consequence is global: prefixes are intervals. Working backwards is what makes the count uniform, since the last element of an interval-building list is always an endpoint, while going forwards the number of options depends on whether the block has already hit or . Look for a reformulation where every step has the same number of choices.
Alternative approach
Small cases: with there is list; with there are ; with there are (). The pattern gives for , and is the only power of of that size among the choices.
The trap
Counting forward by choosing a_1 and multiplying by 2 per step, which overcounts because once the block hits 1 or 10 only one direction remains.
Common mistakes
- Counting forward by choosing a_1 and multiplying by 2 per step, which overcounts because once the block hits 1 or 10 only one direction remains.
- Answering by giving two choices as well; the last remaining number is forced.
Techniques
Map the objects to something easier to count · Compute small cases, spot the pattern, generalize · Start from the end state / desired conclusion and reverse