• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Absolute value problems

Not open for further replies.
This one is actually a bit more tricky than it looks on first sight.
I won't solve this for you, simply because you learn more if you solve it yourself, but here are the steps to solve it:

1) build the dx/dy of the function (note: you need a case differentiation for 2x-3 < 0 and 2x-3 > 0 to get rid of abs()! So solve 2x-3 = 0 first to get the unsteady)

2) solve dx/dy to 0 for both cases. Can't, because they are constants? Good. This means you don't have to differentiate cases further and can jump straight to solving the corner cases:

3) solve lim f(x) by putting in the x values for the left boundary, right boundary and the unsteady (from both sides).
Absolute value functions are tricky. It is often helpful to write it out as a piecewise function. Let's pick that part out first:

What does this mean? Piecewise functions look intimidating, but they are great for visualizing what is going on in the scene. If you're new to piecewise functions, then take a look at a simpler example first, the regular absolute value function |x|:

What is this saying? When the value of x is greater than or equal to 0, we'll just use x directly. If the value of x is less than 0, we'll use -x. Here is a quick example to demonstrate:
  • Let x = -1. If you look in the piecewise function, -1 < 0. As such, we can conclude that |x| = -x = -(-1) = 1. More briefly, |-1| = 1.
  • Let x = 5. If you look in the piecewise function, 5 > 0. As such, we can conclude that |x| = x = 5. More briefly, |5| = 5.

We can extend this concept for absolute value functions as whole. For the case of |2x - 3|, all we need to do is find where its vertex is and how it behaves on either side of the vertex.

To do this, let's solve the inequalities presented in the first image. For the first piecewise function:

We get that the vertex is at x = 3/2 (or 1.5). Therefore, the graph of |2x - 3| would look like this:

The range of |2x - 3| is [0, ∞)

... wait. But how do we apply this to 5 - |2x - 3|? If I were taking a test, there would be two routes I'd consider: (1) common sense/intuition (2) transformations.
Can't go wrong with the old-fashioned plug-and-chug method. Since all we care about is the range, we just need to figure out what the max and minimum values are.

5 - |2x - 3|. We know that |2x - 3| is always >= 0 (that is a rule with absolute value functions). Worst-case scenario, let's assume x = 3/2, so we get 5 - (0) = 5.

Next, we get the behavior on the left and right side of the vertex. Plug in x = 0: 5 - |0 - 3| = 5 - |-3| = 5 - 3 = 2. This is less than 5, so we know that the function is going down towards -∞ on the left side.

Plug in x = 2: 5 - |2x - 3| = 5 - |1| = 4. This is less than 5, so we know that the function is going down towards -∞ on the right side.

With this information, you should be able to make a basic graph:

Transformations. I never really covered this properly until linear algebra, but it might be useful to know.

First, let's rewrite the function as f(x) = -|2x - 3| + 5.

Consider -|2x - 3|. It is the same as |2x - 3|, but it is flipped about the x-axis (all the positive values become negative, all the negative values become positive). Since |2x - 3| has only positive values, we just flip it like so:

Adding a constant (5) just moves the entire graph up 5 units. Lo and behold, we have the graph:

Judging by the graph, we know that the range is (-∞, 5]. But the question restricts you to -1 < x <= 3. So we simply plug those end-points into our function:
f(-1) = 5 - |2(-1) - 3| = 5 - |-5| = 5 - 5 = 0
f(3) = 5 - |2(3) - 3| = 5 - |3| = 2

It looks like our max is still 5, but our min (with the restricted endpoints) is now 0. But be careful! The question asks for x > -1 (not including -1), so the proper way to write out the range is like-so:
(0, 5]


  • Screen Shot 2015-08-06 at 12.55.12 AM.png
    Screen Shot 2015-08-06 at 12.55.12 AM.png
    10.9 KB · Views: 201
  • Screen Shot 2015-08-06 at 12.59.11 AM.png
    Screen Shot 2015-08-06 at 12.59.11 AM.png
    8 KB · Views: 209
  • Screen Shot 2015-08-06 at 1.06.53 AM.png
    Screen Shot 2015-08-06 at 1.06.53 AM.png
    8.2 KB · Views: 203
  • graff.png
    17.7 KB · Views: 240
  • graff2.png
    17.4 KB · Views: 207
  • graff3.png
    17.4 KB · Views: 229
Not open for further replies.