Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 70 lines (65 sloc) 2.855 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
<!DOCTYPE html>
<html data-require="math math-format">
<head>
<meta charset="UTF-8" />
<title>Linear inequalities</title>
<script src="../khan-exercise.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 ) > 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;", "&le;", "&ge;" ])</var>
<var id="FREL">{ "&lt;": "&gt;", "&gt;": "&lt;", "&le;": "&ge;", "&ge;": "&le;" }[ 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-type="list" data-choices="['', '&lt;', '&gt;', '&le;', '&ge;']">
<var>A - C > 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><var>B > 0 ? "Subtract" : "Add"</var> <code><var>abs(B)</var></code> <var>B > 0 ? "from" : "to"</var> 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>
Something went wrong with that request. Please try again.