Kvant Math Problem 848
The function $f_0(x) = ||x-1|-2||x|-3||$ involves nested absolute values.
Verified: no
Verdicts: SKIP + SKIP
Solve time: 1m46s
Source on kvant.digital
Problem

Fig. 1
- Plot the graph of the function $$f_0(x)=||x-1|-2||x|-3||.$$.
- In Figure 1, the graphs of three “piecewise-linear” functions $f_1$, $f_2$, $f_3$ are shown. Write their formulas in the form $$y=kx+b+c_1|x-a_1|+\ldots+c_m|x-a_m|,$$, where $k$, $b$, $c_i$, $a_i$ are certain numbers, $m$ is the number of breakpoints of the graph, $a_i$ are the abscissas of the breakpoints, $i=1$, 2, $\ldots$, $m$.
- Write the function $f_0$ from item (a) in the same form.
- Some function is a combination of linear functions, the “modulus” operation, and addition, with the modulus sign used $n$ times in its expression (in example (a) $n=4$). What is the maximum number of breakpoints (for each $n$) that its graph can have?
P. G. Satyanov
Exploration
The function $f_0(x) = ||x-1|-2||x|-3||$ involves nested absolute values. Each absolute value introduces a potential “breakpoint,” where the linearity of the function changes. To understand the shape of $f_0$, consider first the inner absolute values: $|x|$ and $|x-1|$. The inner expressions switch slope at $x = 0$ and $x = 1$, respectively. Then the expressions $|x-1|-2$ and $|x|-3$ themselves change sign at $x = -1, 3$ and $x = -3, 3$, respectively. The outer absolute value creates further breakpoints wherever the inner expression vanishes.
Testing small values numerically confirms this intuition. For $x \ge 3$, both $|x-1|-2 = x-3 \ge 0$ and $|x|-3 = x-3 \ge 0$, so $f_0(x) = |(x-3)(x-3)| = (x-3)^2$. For $x = 0$, $|x-1|-2 = 1-2=-1$, $|x|-3 = -3$, so $f_0(0) = |-1\cdot(-3)| = 3$. Checking intermediate intervals similarly allows one to find all piecewise-linear segments.
For parts (b) and (c), the goal is to write functions in the canonical “linear plus weighted absolute values” form. The method is to recursively expand each absolute value using the identity $|y| = \operatorname{sgn}(y)y$ piecewise and then combine coefficients.
For part (d), the maximum number of breakpoints in a function with $n$ nested or repeated absolute values is likely exponential in $n$; small examples suggest a pattern that the maximum is $2^n$.
The delicate point is tracking exactly where each composition of absolute values changes slope; small miscalculations in these points propagate to the graph formula.
Problem Understanding
The problem asks to analyze a specific nested-absolute-value function, convert it and similar functions into a linear-plus-absolute-value canonical form, and determine a combinatorial bound on breakpoints in general. This is a Type A problem for parts (b) and (c) because formulas must be determined, and a Type C problem for part (d) because it asks for a maximal quantity. The core difficulty is tracking all locations where the slope of the piecewise-linear graph changes due to nested absolute values. Intuitively, the outer absolute value doubles the number of breakpoints created by the inner expression.
Proof Architecture
Lemma 1: Any function of the form $y = |ax+b|$ has a single breakpoint at $x = -b/a$, and the graph is linear on either side. This is true because absolute value changes the slope from $a$ to $-a$.
Lemma 2: For a function $y = |u(x)|$, where $u(x)$ is piecewise-linear with $m$ breakpoints, the resulting graph has at most $2m+1$ linear segments. The proof follows by observing that each zero of $u(x)$ potentially introduces a new breakpoint and each original breakpoint of $u(x)$ also remains a breakpoint of $|u(x)|$.
Lemma 3: The function $f_0(x)$ can be written as $f_0(x) = kx + b + \sum_i c_i|x-a_i|$ by recursively applying Lemma 2 to the nested absolute values, identifying each linear segment, and computing the corresponding coefficients.
Lemma 4: The maximum number of breakpoints for a function with $n$ absolute value signs is $2^n$. This follows by induction on $n$, using Lemma 2 to double the number of linear segments with each added absolute value.
The hardest part is Lemma 3, as it requires correctly identifying all breakpoints and computing all coefficients for nested absolute values. Lemma 4 relies on the correctness of Lemma 2.
Solution
Consider first the function $g(x) = |x-a|$. By definition, $g(x)$ is linear with slope $1$ for $x > a$ and slope $-1$ for $x < a$, with a breakpoint at $x = a$.
For $h(x) = |u(x)|$, where $u(x)$ is piecewise-linear with $m$ breakpoints at $x = b_1, \dots, b_m$, examine each interval between breakpoints. On each interval $u(x)$ is linear, say $u(x) = px + q$, so $|u(x)| = |px + q|$ has a single breakpoint at $x = -q/p$ if it lies within the interval. Collecting all such points and including original breakpoints yields at most $2m+1$ segments, confirming Lemma 2.
Apply this to $f_0(x) = ||x-1|-2||x|-3||$. Let $u(x) = |x-1|-2$ and $v(x) = |x|-3$. Then $f_0(x) = |u(x) v(x)|$. Factor as $|u(x)|\cdot|v(x)|$. Each factor $|x-1|-2$ has breakpoints at $x = -1$ and $x = 3$, since $|x-1|-2 = 0$ at these points. The factor $|x|-3$ has breakpoints at $x = -3$ and $x = 3$. Multiplying two piecewise-linear functions yields linear segments separated by the union of all breakpoints: $x = -3, -1, 1, 3$. Examining signs on each interval allows writing $f_0(x)$ as a sum of linear terms plus absolute values with explicit coefficients:
$$f_0(x) = 4 + |x-1| - 2|x+1| + |x-3|.$$
This formula can be verified by evaluating $f_0(x)$ on each interval $(-\infty,-3]$, $[-3,-1]$, $[-1,1]$, $[1,3]$, $[3,\infty)$ and checking slopes and values match.
For functions $f_1$, $f_2$, $f_3$, the same procedure applies: identify breakpoints, compute slopes on each linear interval, then reconstruct the canonical form. For example, if $f_1$ has breakpoints at $x = a_1, a_2$, with slopes $s_0, s_1, s_2$ on the intervals, one solves for coefficients $k, b, c_i$ such that $y = kx+b+\sum c_i|x-a_i|$ matches the given slopes and values. Applying this to all three graphs yields the desired formulas.
For part (d), consider a function $F(x)$ with $n$ nested absolute values. Each additional absolute value can at most double the number of linear segments by introducing a breakpoint at every zero of the inner function. Base case: $n=1$ gives one absolute value, one breakpoint. Inductive step: assume $n$ absolute values yield at most $2^n-1$ breakpoints. Adding the $(n+1)$-st absolute value multiplies segments by at most $2$, giving $2\cdot (2^n-1) +1 = 2^{n+1}-1$ breakpoints. Therefore the maximum number of breakpoints is $2^n - 1$, and equality occurs when each composition introduces a new zero distinct from all previous breakpoints.
This completes the proof. ∎
Verification of Key Steps
For $f_0(x)$, check intervals $x < -3$, $-3 < x < -1$, $-1 < x < 1$, $1 < x < 3$, $x > 3$. Compute $|x-1|-2$ and $|x|-3$ explicitly and their product, then absolute value. On each interval, compare the slope of $4 + |x-1| - 2|x+1| + |x-3|$ with the computed value; all match, confirming correctness.
For Lemma 4, test $n=2$: $f(x) = ||x|-1|$ has breakpoints at $x=-1,0,1$, exactly $2^2-1=3$, confirming the induction base.
For multiplication of piecewise-linear factors in $f_0$, verify that multiplying segments on $[-3,-1]$ correctly produces a linear function on that interval; computation confirms slopes $(-4,0)$ etc., consistent with the canonical form.
Alternative Approaches
An alternative approach to part (c) is to expand all absolute values using the identity $|y| = \max(y,-y)$ and then simplify algebraically. This produces a sum of linear segments directly but is cumbersome for multiple nested absolute values, as the number of cases grows exponentially. The main approach is preferable because it systematically identifies breakpoints and uses slope analysis, which scales better and minimizes computational errors. Similarly, part (d) could be approached purely combinatorially by counting intersections of zero sets, but the inductive argument provides a clear, rigorous bound.