f(x) = expr(["+", ["*", A, ["^", "x", 2]], B])
What is the range of f(x)
?
\{\, y \in \RR \mid y
A > 0 ? "≥" : "≤"
B
\,\}
f(x) = \begin{cases}
3 * A + B & \text{IF } x = HOLE \\
expr(["+", ["*", A, ["^", "x", 2]], B]) & \text{OTHERWISE}
\end{cases}
What is the range of f(x)
?
\{\, y \in \RR \mid y
A > 0 ? "≥" : "≤"
B
\,\}
First consider the behavior for x \ne HOLE
.
If x = HOLE
, then f(x) = 3 * A + B
.
Since 3 * A + B ≤ B
,
the range is still \{\, y \in \RR \mid y ≤ B \,\}
.
Since 3 * A + B ≥ B
,
the range is still \{\, y \in \RR \mid y ≥ B \,\}
.
\{\, y \in \RR \mid y
A > 0 ? ">" : "<"
B
\,\}
First consider the behavior for x \ne HOLE
.
If x = HOLE
, then f(x) = 3 * A + B
, which eliminates f(x) = B
from the range.
So the range of f(x)
is \{\, y \in \RR \mid y > B \,\}
.
So the range of f(x)
is \{\, y \in \RR \mid y < B \,\}
.
Consider the range of expr(["*", A, ["^", "x", 2]])
.
The range of x^2
is \{\, y \in \RR \mid y \ge 0 \,\}
.
Multiplying by A
doesn't change the range.
The range of x^2
is \{\, y \in \RR \mid y \ge 0 \,\}
.
Multiplying by A
flips the range to \{\, y \in \RR \mid y \le 0 \,\}
.
To get expr(["+", ["*", A, ["^", "x", 2]], B])
, we add abs(B)
.
To get expr(["+", ["*", A, ["^", "x", 2]], B])
, we subtract abs( B )
.
So the range becomes: \{\, y \in \RR \mid y ≥ B \,\}
.
So the range becomes: \{\, y \in \RR \mid y ≤ B \,\}
.