2007 AIME II Problem 6

Attempt Problem 6 of the 2007 AIME II below, then check your answer against the professionally curated solution from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 2007 AIME II solutions, or check the answer key.

All problems are used with official legal permission of the Mathematical Association of America (MAA).

6.

An integer is called parity-monotonic if its decimal representation a1a2a3aka_1 a_2 a_3 \ldots a_k satisfies ai<ai+1a_i \lt a_{i+1} if aia_i is odd, and ai>ai+1a_i \gt a_{i+1} if aia_i is even. How many four-digit parity-monotonic integers are there?

Answer: 640
Concepts:digitsparitymultiplication principle
Difficulty rating: 2390
Small Hint:

Build the number from right to left, counting how many digits may immediately precede a given digit

Big Hint:

For every digit d,d, exactly 44 digits can precede it: the odd digits below dd together with the even digits above d.d. The digit 00 never qualifies.

Solution:

A digit aia_i may immediately precede ai+1=da_{i+1} = d exactly when aia_i is odd and less than d,d, or even and greater than d.d. Checking each dd from 00 to 9,9, this always allows exactly 44 digits: for example, d=0d = 0 allows 2,2, 4,4, 6,6, 8;8; d=4d = 4 allows 1,1, 3,3, 6,6, 8;8; d=9d = 9 allows 1,1, 3,3, 5,5, 7.7. (Raising dd by 11 trades odd choices for even ones, keeping the total at 4.4.) Note that 00 is never an allowed predecessor, since 00 is even but exceeds no digit.

So choose the last digit a4a_4 in 1010 ways, then each of a3,a_3, a2,a_2, a1a_1 in 44 ways; the leading digit is automatically nonzero. The count is 4310=640.4^3 \cdot 10 = 640.

Problem 5#5
Full Exam

Problem 6 in Other Years