Suppose that cards numbered are arranged in a row. The task is to pick them up in numerically increasing order, working repeatedly from left to right. In the example below, cards are picked up on the first pass, and on the second pass, on the third pass, on the fourth pass, and on the fifth pass. For how many of the possible orderings of the cards will the cards be picked up in exactly two passes?

- A)
- B)
- C)
- D)
- E)
Answer
D
Key insight
If the first pass collects 1 through k, the arrangement is determined by which k positions hold them: C(13,k) choices, minus the one sorted arrangement done in a single pass.
Solution
Suppose the first pass collects exactly the cards and the second pass collects , where . A pass picks up cards in increasing order while scanning left to right, so in the row the cards appear in increasing order, and so do the cards .
Conversely, take any row in which both blocks and appear in increasing order. The first pass certainly collects . It continues to only if sits to the right of . But is the rightmost card of the first block and the leftmost of the second, so that would put the entire second block to the right of the entire first block, making the row , which is collected in one pass. Every other such row takes exactly two passes, with the first pass ending at .
For a fixed , a row with both blocks increasing is determined by choosing which of the positions hold the first block: rows, of which one (the sorted row) must be excluded. Different give different rows, since is the number of cards collected in the first pass. Therefore the count is
The answer is .
Why this works
"Collected in one pass" is the same as "appears in increasing order," so a two-pass row is an interleaving of two increasing blocks, and interleavings are counted by choosing positions. The subtle points are the one degenerate interleaving per (the fully sorted row) and the fact that is determined by the row, so the cases do not overlap.
The trap
Forgetting to exclude the sorted arrangement 1, 2, ..., 13 for each k (giving 8190), or letting k run to 13 or from 0 (giving 8191 or 8192).
Common mistakes
- Forgetting to exclude the sorted arrangement 1, 2, ..., 13 for each k (giving 8190), or letting k run to 13 or from 0 (giving 8191 or 8192).
- Believing rows can be double counted across different ; the split point is the size of the first pass, which the row itself fixes.
Techniques
Map the objects to something easier to count · Split into exhaustive cases and handle each