AMC 10 Step by Step

2019 AMC 10B Problem 9

P1-10~3 minPrint

The function ff is defined by f(x)=⌊∣x∣⌋−∣⌊x⌋∣f(x) = \lfloor|x|\rfloor - |\lfloor x \rfloor| for all real numbers xx , where ⌊r⌋\lfloor r \rfloor denotes the greatest integer less than or equal to the real number rr . What is the range of ff ?

Log in to save your progress.
Show solution without answering

Key insight

Try a positive number, a negative whole number, and a negative number with a decimal part. Only the last kind gives something other than 0, and it always gives -1.

Solution

Floors and absolute values behave differently for negative numbers, so test a few kinds of numbers first.

xx⌊∣x∣⌋\lfloor \lvert x\rvert \rfloor∣⌊x⌋∣\lvert \lfloor x \rfloor \rvertf(x)f(x)
3.73.7⌊3.7⌋=3\lfloor 3.7 \rfloor = 3∣3∣=3\lvert 3 \rvert = 300
−2-2⌊2⌋=2\lfloor 2 \rfloor = 2∣−2∣=2\lvert -2 \rvert = 200
−2.5-2.5⌊2.5⌋=2\lfloor 2.5 \rfloor = 2∣−3∣=3\lvert -3 \rvert = 3−1-1

The table suggests the only values are 00 and −1-1. Now check that this is true for every xx.

  1. xx is 00 or positive. Then ∣x∣=x\lvert x \rvert = x and ⌊x⌋\lfloor x \rfloor is 00 or positive, so both parts equal ⌊x⌋\lfloor x \rfloor. So f(x)=0f(x) = 0.
  2. xx is a negative whole number, like −5-5. Both parts equal 55, the number without its sign. So f(x)=0f(x) = 0.
  3. xx is negative with a decimal part, like −5.3-5.3. Then ∣x∣=5.3\lvert x \rvert = 5.3 and its floor is 55. But the floor of −5.3-5.3 is −6-6 (the floor rounds down, and down means further from zero for negatives), and its absolute value is 66. So f(x)=5−6=−1f(x) = 5 - 6 = -1. The same thing happens for any such number: the first part is one less than the second.

Every real number falls in one of these three groups, so the range is exactly {−1,0}\{-1, 0\}.

The answer is (A) {−1,0}\boxed{\textbf{(A)}\ \{-1, 0\}}.

Why this works

Taking the absolute value first and then rounding down moves a negative number toward zero. Rounding down first moves it away from zero. The two orders disagree by exactly 11 whenever the number is negative and not whole. Whenever a floor appears, test a positive number, a negative whole number and a negative number with a decimal part; the last one is where surprises happen.

Concise solution

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

Split by the sign and integrality of xx.

Case 1: x≥0x \ge 0. Then ∣x∣=x|x| = x and ⌊x⌋≥0\lfloor x \rfloor \ge 0, so f(x)=⌊x⌋−⌊x⌋=0f(x) = \lfloor x \rfloor - \lfloor x \rfloor = 0.

Case 2: xx is a negative integer. Then ∣x∣=−x|x| = -x is an integer, so ⌊∣x∣⌋=−x\lfloor |x| \rfloor = -x, and ∣⌊x⌋∣=∣x∣=−x|\lfloor x \rfloor| = |x| = -x. Again f(x)=0f(x) = 0.

Case 3: xx is negative and not an integer. Write x=−k−θx = -k - \theta with kk a nonnegative integer and 0<θ<10 < \theta < 1. Then ∣x∣=k+θ|x| = k + \theta, so ⌊∣x∣⌋=k\lfloor |x| \rfloor = k. But ⌊x⌋=−k−1\lfloor x \rfloor = -k - 1, whose absolute value is k+1k + 1. Hence f(x)=k−(k+1)=−1f(x) = k - (k+1) = -1.

For example, f(−2.5)=⌊2.5⌋−∣⌊−2.5⌋∣=2−3=−1f(-2.5) = \lfloor 2.5 \rfloor - |\lfloor -2.5 \rfloor| = 2 - 3 = -1, while f(3.7)=3−3=0f(3.7) = 3 - 3 = 0.

The range is {−1,0}\{-1, 0\}. The answer is (A) {−1,0}\boxed{\textbf{(A)}\ \{-1, 0\}}.

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.