Permalink
Fetching contributors…
Cannot retrieve contributors at this time
70 lines (65 sloc) 3.5 KB
<!DOCTYPE html>
<html data-require="math math-format">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Multi-step linear inequalities</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="A">randRange( 2, 10 )</var>
<var id="B">randRangeNonZero( -10, 10 )</var>
<var id="C" data-ensure="abs( C - A ) &gt; 1">randRange( 2, 10 )</var>
<var id="D" data-ensure="D !== B">randRangeNonZero( 2, 10 )</var>
<var id="SOLUTION">fractionReduce( D - B, A - C )</var>
<var id="REL">randFromArray([ "&lt;", "&gt;", "≤", "≥" ])</var>
<var id="FREL">{ "&lt;": "&gt;", "&gt;": "&lt;", "≤": "≥", "≥": "≤" }[ REL ]</var>
</div>
<div class="problems">
<div>
<p class="question">Solve for <code>x</code>:</p>
<div><code><var>A</var>x + <var>B</var> <var>REL</var> <var>C</var>x + <var>D</var></code></div>
<p class="solution" data-type="multiple">
<code>x</code>
<span class="sol" data-choices="['', '&lt;', '&gt;', '≤', '≥']" data-type="list">
<var>A - C &gt; 0 ? REL : FREL</var>
</span>
<span class="sol"><var>( D - B ) / ( A - C )</var></span></p>
</div>
</div>
<div class="hints">
<div>
<p>Subtract <code><var>C</var>x</code> from both sides:</p>
<p><code>(<var>A</var>x + <var>B</var>) - <var>C</var>x <var>REL</var> (<var>C</var>x + <var>D</var>) - <var>C</var>x</code></p>
<p><code><var>A - C</var>x + <var>B</var> <var>REL</var> <var>D</var></code></p>
</div>
<div>
<p data-if="B > 0">Subtract <code><var>abs(B)</var></code> from both sides:</p><p data-else="">Add <code><var>abs(B)</var></code> to both sides:</p>
<p><code>(<var>A - C</var>x + <var>B</var>) + <var>-B</var> <var>REL</var> <var>D</var> + <var>-B</var></code></p>
<p><code><var>A - C</var>x <var>REL</var> <var>D - B</var></code></p>
</div>
<div data-if="A - C > 0">
<div>
<p>Divide both sides by <code><var>A - C</var></code>. Because <code><var>A - C</var></code> is positive, the inequality sign <code><var>REL</var></code> should not be flipped.</p>
<p><code>\dfrac{<var>A - C</var>x}{<var>A - C</var>} <var>REL</var> \dfrac{<var>D - B</var>}{<var>A - C</var>}</code></p>
</div>
<div>
<p>Simplify.</p>
<p><code>x <var>REL</var> <var>SOLUTION</var></code></p>
</div>
</div>
<div data-else="">
<div>
<p>Divide both sides by <code><var>A - C</var></code>. Because <code><var>A - C</var></code> is negative, the inequality sign <code><var>REL</var></code> must be flipped to <code><var>FREL</var></code>.</p>
<p><code>\dfrac{<var>A - C</var>x}{<var>A - C</var>} <var>FREL</var> \dfrac{<var>D - B</var>}{<var>A - C</var>}</code></p>
</div>
<div>
<p>Simplify.</p>
<p><code>x <var>FREL</var> <var>SOLUTION</var></code></p>
</div>
</div>
</div>
</div>
</body>
</html>