Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
459 lines (455 sloc) 22.971 kB
<!DOCTYPE html>
<html data-require="math math-format">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Absolute value equations</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="0">
<div class="vars">
<var id="A">randRange(2, 8)</var>
<var id="B">randRangeNonZero(-10, 10)</var>
<var id="C" data-ensure="C !== A">
randRangeNonZero(-6, 6)
</var>
<var id="D" data-ensure="D !== B">randRange(2, 10)</var>
<var id="E">randRangeNonZero(-10, 10)</var>
<var id="NO_SOLUTION">(D - B) / (A - C) &lt;= 0</var>
<var id="POS_SOLUTION">
[abs(D - B) - E * abs(A - C), abs(A - C)]
</var>
<var id="NEG_SOLUTION">
[-1 * abs(D - B) - E * abs(A - C), abs(A - C)]
</var>
<var id="SOLUTIONS">NO_SOLUTION ? [] : [
POS_SOLUTION[0] / POS_SOLUTION[1],
NEG_SOLUTION[0] / NEG_SOLUTION[1]
]</var>
<var id="SIMPLIFIED">fractionReduce(D - B, A - C)</var>
<var id="SIMPLIFIED_DENOM">
abs((A - C) / getGCD(D - B, A - C))
</var>
</div>
<p class="question">
Solve for <code>x</code>:
<br><br>
<code>
<var>A</var>|x + <var>E</var>| + <var>B</var> =
<var>C</var>|x + <var>E</var>| + <var>D</var>
</code>
</p>
<div class="solution" data-type="multiple">
<div class="sol" data-type="set">
<div class="set-sol" data-each="SOLUTIONS as SOLUTION">
<var>SOLUTION</var>
</div>
<p class="input-format">
<code>x = </code> <span class="entry short40"></span>
&nbsp; or
<code>x = </code> <span class="entry short40"></span>
</p>
</div>
<p></p>
<div>
<label>
<span class="sol" data-type="checkbox">
<var>NO_SOLUTION</var>
</span>
There is no solution
</label>
</div>
</div>
<div class="hints">
<div data-if="A > C" data-unwrap="">
<div>
<p data-if="C > 0">
Subtract
<code>
\red{<var>abs(C)</var>|x + <var>E</var>|}
</code>
from both sides:
</p><p data-else="">
Add
<code>
\red{<var>abs(C)</var>|x + <var>E</var>|}
</code>
to both sides:
</p>
<p><code>\qquad\begin{eqnarray}
<var>A</var>|x + <var>E</var>| + <var>B</var>
&amp;=&amp;
<var>C</var>|x + <var>E</var>| + <var>D</var>
\\ \\
\red{ - <var>C</var>|x + <var>E</var>|}
&amp;&amp;
\red{ - <var>C</var>|x + <var>E</var>|} \\ \\
<var>A - C</var>|x + <var>E</var>| +
<var>B</var>
&amp;=&amp; <var>D</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="B > 0">
Subtract
<code>\red{<var>abs(B)</var>}</code>
from both sides:
</p><p data-else="">
Add
<code>\red{<var>abs(B)</var>}</code>
to both sides:
</p>
<p><code>\qquad\begin{eqnarray}
<var>A - C</var>|x + <var>E</var>| +
<var>B</var> &amp;=&amp; <var>D</var> \\ \\
\red{ - <var>B</var>} &amp;&amp;
\red{ - <var>B</var>} \\ \\
<var>A - C</var>|x + <var>E</var>| &amp;=&amp;
<var>D - B</var>
\end{eqnarray}
</code></p>
</div>
<div data-if="abs(A - C) !== 1">
<p>
Divide both sides by
<code>\red{<var>A - C</var>}</code>:
</p>
<p><code>\qquad
\dfrac{<var>A - C</var>|x + <var>E</var>|}
{\red{<var>A - C</var>}} =
\dfrac{<var>D - B</var>}
{\red{<var>A - C</var>}}
</code></p>
</div>
<div>
<p>Simplify:</p>
<p>
<code>\qquad |x + <var>E</var>| =
<var>SIMPLIFIED</var></code>
</p>
</div>
<div data-if="!NO_SOLUTION" data-unwrap="">
<div>
<p>
Because the absolute value of an expression
is its distance from zero, it has two
solutions, one negative and one positive:
</p>
<p><code>\qquad
x + <var>E</var> = -<var>SIMPLIFIED</var>
</code></p>
<p>or</p>
<p><code>\qquad
x + <var>E</var> = <var>SIMPLIFIED</var>
</code></p>
</div>
<div>
<p>
Solve for the solution where
<code>x + <var>E</var></code> is negative:
</p>
<p><code>\qquad
x + <var>E</var> = -<var>SIMPLIFIED</var>
</code></p>
</div>
<div>
<p data-if="E > 0">
Subtract
<code>\red{<var>abs(E)</var>}</code>
from both
sides:
</p><p data-else="">
Add
<code>\red{<var>abs(E)</var>}</code>
to both
sides:
</p>
<p><code>\qquad\begin{eqnarray}
x + <var>E</var> &amp;=&amp;
-<var>SIMPLIFIED</var> \\ \\
\red{- <var>E</var>} &amp;&amp;
\red{- <var>E</var>} \\ \\
x &amp;=&amp; -<var>SIMPLIFIED</var> -
<var>E</var>
\end{eqnarray}
</code></p>
</div>
<div data-if="SIMPLIFIED_DENOM !== 1">
<p>
Change the
<code>\red{{} - <var>E</var>}</code>
to an equivalent fraction with a
denominator of
<code><var>SIMPLIFIED_DENOM</var></code>:
</p>
<p><code>\qquad
x = - <var>SIMPLIFIED</var>
\red{<var>E &gt; 0 ? "-" : "+"</var>
<var>fraction(abs(E) * SIMPLIFIED_DENOM,
SIMPLIFIED_DENOM)</var>}
</code></p>
</div>
<p><code>\qquad
x = <var>fractionReduce.apply(null,
NEG_SOLUTION)</var>
</code></p>
<div>
<p>
Then calculate the solution where
<code>x + <var>E</var></code> is positive:
</p>
<p><code>\qquad
x + <var>E</var> = <var>SIMPLIFIED</var>
</code></p>
</div>
<div>
<p data-if="E > 0">
Subtract
<code>\red{<var>abs(E)</var>}</code>
from both
sides:
</p><p data-else="">
Add
<code>\red{<var>abs(E)</var>}</code>
to both
sides:
</p>
<p><code>\qquad\begin{eqnarray}
x + <var>E</var> &amp;=&amp;
<var>SIMPLIFIED</var> \\ \\
\red{- <var>E</var>} &amp;&amp;
\red{- <var>E</var>} \\ \\
x &amp;=&amp; <var>SIMPLIFIED</var> -
<var>E</var>
\end{eqnarray}
</code></p>
</div>
<div data-if="SIMPLIFIED_DENOM !== 1">
<p>
Change the
<code>\red{{} - <var>E</var>}</code>
to an equivalent fraction with a
denominator of
<code><var>SIMPLIFIED_DENOM</var></code>:
</p>
<p><code>\qquad
x = <var>SIMPLIFIED</var>
\red{<var>E &gt; 0 ? "-" : "+"</var>
<var>fraction(abs(E) * SIMPLIFIED_DENOM,
SIMPLIFIED_DENOM)</var>}
</code></p>
</div>
<p><code>\qquad
x = <var>fractionReduce.apply(null,
POS_SOLUTION)</var>
</code></p>
</div>
</div>
<div data-else="" data-unwrap="">
<div>
<p data-if="A > 0">
Subtract
<code>
\red{<var>A</var>|x + <var>E</var>|}
</code>
from both sides:
</p><p data-else="">
Add
<code>
\red{<var>A</var>|x + <var>E</var>|}
</code>
to both sides:
</p>
<p><code>\qquad\begin{eqnarray}
<var>A</var>|x + <var>E</var>| + <var>B</var>
&amp;=&amp;
<var>C</var>|x + <var>E</var>| + <var>D</var>
\\ \\ \red{- <var>A</var>|x + <var>E</var>|}
&amp;&amp;
\red{- <var>A</var>|x + <var>E</var>|} \\ \\
<var>B</var> &amp;=&amp;
<var>C - A</var>|x + <var>E</var>| +
<var>D</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="D > 0">
Subtract
<code><var>abs(D)</var></code>
from both sides:
</p><p data-else="">
Add
<code><var>abs(D)</var></code>
to both sides:
</p>
<p><code>\qquad\begin{eqnarray}
<var>B</var> &amp;=&amp;
<var>C - A</var>|x + <var>E</var>| +
<var>D</var> \\ \\
\red{- <var>D</var>} &amp;&amp;
\red{- <var>D</var>} \\ \\
<var>B - D</var> &amp;=&amp;
<var>C - A</var>|x + <var>E</var>|
\end{eqnarray}
</code></p>
</div>
<div data-if="abs(A - C) !== 1">
<p>
Divide both sides by
<code>\red{<var>C - A</var>}</code>.
</p>
<p><code>\qquad
\dfrac{<var>B - D</var>}
{\red{<var>C - A</var>}} =
\dfrac{<var>C - A</var>|x + <var>E</var>|}
{\red{<var>C - A</var>}}
</code></p>
</div>
<div>
<p>Simplify:</p>
<p><code>\qquad
<var>SIMPLIFIED</var> = |x + <var>E</var>|
</code></p>
</div>
<div data-if="!NO_SOLUTION" data-unwrap="">
<div>
<p>
Because the absolute value of an expression
is its distance from zero, it has two
solutions, one negative and one positive:
</p>
<p><code>\qquad
-<var>SIMPLIFIED</var> = x + <var>E</var>
</code></p>
<p>or</p>
<p><code>\qquad
<var>SIMPLIFIED</var> = x + <var>E</var>
</code></p>
</div>
<div>
<p>
Solve for the solution where
<code>x + <var>E</var></code> is negative:
</p>
<p>
<code>\qquad - <var>SIMPLIFIED</var> = x +
<var>E</var></code>
</p>
</div>
<div>
<p data-if="E > 0">
Subtract
<code>\red{<var>abs(E)</var>}</code>
from both
sides:
</p><p data-else="">
Add
<code>\red{<var>abs(E)</var>}</code>
to both
sides:
</p>
<p><code>\qquad\begin{eqnarray}
- <var>SIMPLIFIED</var> &amp;=&amp;
x + <var>E</var> \\ \\
\red{- <var>E</var>} &amp;&amp;
\red{- <var>E</var>} \\ \\
-<var>SIMPLIFIED</var> - <var>E</var>
&amp;=&amp; x
\end{eqnarray}
</code></p>
</div>
<div data-if="SIMPLIFIED_DENOM !== 1">
<p>
Change the
<code>\red{{} - <var>E</var>}</code>
to an equivalent fraction with a
denominator of
<code><var>SIMPLIFIED_DENOM</var></code>.
</p>
<p><code>\qquad
- <var>SIMPLIFIED</var>
\red{<var>E &gt; 0 ? "-" : "+"</var>
<var>fraction(abs(E) * SIMPLIFIED_DENOM,
SIMPLIFIED_DENOM)</var>} = x
</code></p>
</div>
<p><code>\qquad
<var>fractionReduce.apply(null,
NEG_SOLUTION)</var> = x
</code></p>
<div>
<p>
Then calculate the solution where
<code>x + <var>E</var></code> is positive:
</p>
<p><code>\qquad
<var>SIMPLIFIED</var> = x + <var>E</var>
</code></p>
</div>
<div>
<p data-if="E > 0">
Subtract
<code>\red{<var>abs(E)</var>}</code>
from both
sides:
</p><p data-else="">
Add
<code>\red{<var>abs(E)</var>}</code>
to both
sides:
</p>
<p><code>\qquad\begin{eqnarray}
<var>SIMPLIFIED</var> &amp;=&amp;
x + <var>E</var> \\ \\
\red{- <var>E</var>} &amp;&amp;
\red{- <var>E</var>} \\ \\
<var>SIMPLIFIED</var> - <var>E</var>
&amp;=&amp; x
\end{eqnarray}
</code></p>
</div>
<div data-if="SIMPLIFIED_DENOM !== 1">
<p>
Change the
<code>\red{{} - <var>E</var>}</code>
to an equivalent fraction with a
denominator of
<code><var>SIMPLIFIED_DENOM</var></code>.
</p>
<p><code>\qquad
<var>SIMPLIFIED</var>
\red{<var>E &gt; 0 ? "-" : "+"</var>
<var>fraction(abs(E) * SIMPLIFIED_DENOM,
SIMPLIFIED_DENOM)</var>} = x
</code></p>
</div>
<p><code>\qquad
<var>fractionReduce.apply(null,
POS_SOLUTION)</var> = x
</code></p>
</div>
</div>
<p data-if="!NO_SOLUTION">
Thus, the correct answer is
<code>x =
<var>fractionReduce.apply(null, NEG_SOLUTION)</var>
</code>
or
<code>x =
<var>fractionReduce.apply(null, POS_SOLUTION)</var>
</code>.
</p>
<p data-else="">
The absolute value cannot be negative. Therefore, there
is no solution.
</p>
</div>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.