AMC 10 Step by Step

2021 AMC 10A Problem 20

P16-20~6 minPrint

In how many ways can the sequence 1,2,3,4,51, 2, 3, 4, 5 be rearranged so that no three consecutive terms are increasing and no three consecutive terms are decreasing?

Log in to save your progress.
Show solution without answering

Key insight

The terms must go up, down, up, down, or the reverse. In the up-down pattern 5 must sit in position 2 or 4, and each spot gives 8 ways.

Solution

1. Between each pair of neighbours the sequence goes either up or down. Two ups in a row would make three increasing terms, and two downs in a row three decreasing terms. So ups and downs must alternate.
2. That leaves two patterns: up, down, up, down (like 2,5,1,4,32, 5, 1, 4, 3) and down, up, down, up.
3. Count the up-down pattern first: a1<a2>a3<a4>a5a_1 < a_2 > a_3 < a_4 > a_5. Positions 22 and 44 are "peaks" (bigger than both neighbours) and positions 1,3,51, 3, 5 are "valleys".
4. The biggest number, 55, cannot be in a valley, because a valley is smaller than a neighbour. So 55 is at position 22 or position 44.
5. 55 at position 22. The condition a1<5a_1 < 5 holds automatically, so a1a_1 can be any of the other four numbers: 44 choices. The three numbers left fill positions 3,4,53, 4, 5 with a3<a4>a5a_3 < a_4 > a_5, so the biggest of the three goes in the middle and the other two can go either way round: 22 choices. That is 4×2=84 \times 2 = 8 ways.
For example, with a1=3a_1 = 3 the numbers left are 1,2,41, 2, 4, giving 3,5,1,4,23, 5, 1, 4, 2 and 3,5,2,4,13, 5, 2, 4, 1.
6. 55 at position 44. Reading a sequence backwards turns this case into the last one, so it also gives 88 ways.
7. So there are 1616 up-down sequences.
8. For the down-up pattern, replace every number kk by 6−k6 - k (so 1↔51 \leftrightarrow 5, 2↔42 \leftrightarrow 4, and 33 stays). This turns every up into a down, so each up-down sequence becomes a down-up one: 3,5,1,4,23, 5, 1, 4, 2 becomes 3,1,5,2,43, 1, 5, 2, 4. There are 1616 down-up sequences too.
9. Total: 16+16=3216 + 16 = 32.

The answer is (D) 32\boxed{\textbf{(D)}\ 32}.

Why this works

"No three in a row going the same way" forces the sequence to zigzag, and in a zigzag the biggest number must be a peak. Placing the biggest number first makes the rest of the count short, and two flips (reading backwards, and replacing kk by 6−k6 - k) mean only one small case has to be counted by hand.

Alternative approach

In the up-down pattern, count by which two numbers are the peaks (positions 22 and 44).
- Peaks 55 and 44: they can be in either order, and the valleys 1,2,31, 2, 3 can go anywhere, since every valley is smaller than every peak. That is 2×6=122 \times 6 = 12 ways.
- Peaks 55 and 33: the valley 44 is bigger than 33, so it may only touch 55. It must sit at the end next to 55, and then 11 and 22 fill the other two valleys in 22 ways. With 55 in either peak spot, that is 2×2=42 \times 2 = 4 ways.
- A peak of 22 or less is impossible, since it would need two smaller neighbours.

That gives 12+4=1612 + 4 = 16, and doubling for the down-up pattern gives 3232.

Concise solution

A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.

Between consecutive terms the sequence either rises or falls. Two rises in a row would be three increasing terms, and two falls in a row three decreasing terms, so rises and falls must alternate. There are two shapes: up-down-up-down (a1<a2>a3<a4>a5a_1 < a_2 > a_3 < a_4 > a_5) and down-up-down-up.

Count the up-down shape. The value 55 can only sit at a peak, position 22 or 44.

  • 55 in position 22: the condition a1<5a_1 < 5 is automatic, so a1a_1 can be any of the other four values. The remaining three values fill positions 3,4,53, 4, 5 with a3<a4>a5a_3 < a_4 > a_5: a4a_4 must be their maximum and a3,a5a_3, a_5 can be in either order, 22 ways. Total 4⋅2=84 \cdot 2 = 8.
  • 55 in position 44: the mirror image (read the sequence backwards), also 88.

So there are 1616 up-down arrangements. Replacing each term kk by 6−k6 - k flips every comparison, matching up-down arrangements with down-up ones, so there are 1616 of those too.

Total: 16+16=3216 + 16 = 32. The answer is (D) 32\boxed{\textbf{(D)}\ 32}.

Review in the AoPS books

Similar problems

Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.