Permalink
Fetching contributors…
Cannot retrieve contributors at this time
123 lines (122 sloc) 10.1 KB
<!DOCTYPE html>
<html data-require="math math-format expressions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Systems of equations with substitution</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
</div>
<div class="problems">
<div id="substitution-y">
<div class="vars" data-ensure="abs( A1 * X + B1 * Y ) &lt; 13 &amp;&amp; abs( A2 * X + B2 * Y ) &lt; 13 &amp;&amp; abs( A2 * X + B2 * Y ) !== 0 &amp;&amp; ( A1 * B2 ) !== ( A2 * B1 )">
<var id="X">randRangeNonZero( -10, 10 )</var>
<var id="Y" data-ensure="getGCD( abs( X ), abs( Y ) ) === 1">randRangeNonZero( -10, 10 )</var>
<var id="A1">randRange( 1, 6 ) * randRangeNonZero( -1, 1 )</var>
<var id="B1">randRange( 1, 6 ) * randRangeNonZero( -1, 1 )</var>
<var id="C1">A1 * X + B1 * Y</var>
<var id="B2">1</var>
<var id="A2">randRange( 1, 6 ) * randRangeNonZero( -1, 1 )</var>
<var id="C2">A2 * X + B2 * Y</var>
<var id="SIGN_1">B1 * C2 &gt; 0 ? "-" : "+"</var>
<var id="SIGN_2">A1 * X &gt; 0 ? "-" : "+"</var>
</div>
<p class="problem">Solve for <code>x</code> and <code>y</code> using substitution.</p>
<div class="question">
<p><code>\color{<var>BLUE</var>}{<var>expr(["+", ["*", A1, "x"], ["*", B1, "y"]])</var> = <var>C1</var>}</code><br>
<code>\color{<var>GREEN</var>}{y = <var>expr(["+", ["*", -A2, "x"], C2])</var>}</code></p>
</div>
<div class="solution" data-type="multiple">
<p><code>x</code> = <span class="sol short50"><var>X</var></span></p>
<p><code>y</code> = <span class="sol short50"><var>Y</var></span></p>
</div>
<div class="hints">
<div>
<p>Since <code>y</code> has already been solved for, substitute <code class="hint_green"><var>expr(["+", ["*", -A2, "x"], C2])</var></code> for <code>y</code> in the first equation.</p>
<p><code>\color{<var>BLUE</var>}{<var>expr(["*", A1, "x"])</var> + <span data-if="abs( B1 ) !== 1"><var>B1</var></span><span data-if="B1 === -1">-</span>}\color{<var>GREEN</var>}{(<var>expr(["+", ["*", -A2, "x"], C2])</var>)}\color{<var>BLUE</var>}{= <var>C1</var>}</code></p>
</div>
<div>
<p>Simplify and solve for <code>x</code>.</p>
</div>
<div>
<p><code><var>expr(["+", ["*", A1, "x"], ["*", B1 * -A2, "x"]])</var> + <var>B1 * C2</var> = <var>C1</var></code></p>
<p><code><var>expr(["+", ["*", A1 + B1 * -A2, "x"], B1 * C2])</var> = <var>C1</var></code></p>
<p><code><var>expr(["+", ["*", A1 + B1 * -A2, "x"], B1 * C2])</var>\color{<var>BLUE</var>}{<var>SIGN_1</var><var>abs( B1 * C2 )</var>} = <var>C1</var>\color{<var>BLUE</var>}{<var>SIGN_1</var><var>abs( B1 * C2 )</var>}</code></p>
<p data-if="( A1 + B1 * -A2 ) !== 1"><code><var>expr(["*", A1 + B1 * -A2, "x"])</var> = <var>C1 - B1 * C2</var></code></p>
<p data-if="( A1 + B1 * -A2 ) !== 1"><code>\dfrac{<var>expr(["*", A1 + B1 * -A2, "x"])</var>}{\color{<var>BLUE</var>}{<var>A1 + B1 * -A2</var>}} = \dfrac{<var>C1 - B1 * C2</var>}{\color{<var>BLUE</var>}{<var>A1 + B1 * -A2</var>}}</code></p>
<p><code>\color{red}{x = <var>X</var>}</code></p>
</div>
<div>
<p>Now that you know <code>\color{red}{x = <var>X</var>}</code>, plug it back into <code>\thinspace \color{<var>GREEN</var>}{y = <var>expr(["+", ["*", -A2, "x"], C2])</var>}\thinspace</code> to find <code>y</code>.</p>
</div>
<div>
<p><code>\color{<var>GREEN</var>}{y = <span data-if="abs( A2 ) !== 1"><var>-A2</var></span><span data-if="A2 === 1">-</span>}\color{red}{(<var>X</var>)}\color{<var>GREEN</var>}{ + <var>C2</var>}</code></p>
<p data-if="A2 !== -1"><code>y = <var>-A2 * X</var> + <var>C2</var></code></p>
<p><code class="hint_orange">y = <var>Y</var></code></p>
</div>
<div>
<p>You can also plug <code>\color{red}{x = <var>X</var>}</code> into <code>\thinspace \color{<var>BLUE</var>}{<var>expr(["+", ["*", A1, "x"], ["*", B1, "y"]])</var> = <var>C1</var>}\thinspace</code> and get the same answer for <code>y</code>:</p>
<p><code>\color{<var>BLUE</var>}{<span data-if="abs( A1 ) !== 1"><var>A1</var></span><span data-if="A1 === -1">-</span>}\color{red}{(<var>X</var>)}\color{<var>BLUE</var>}{ + <var>expr(["*", B1, "y"])</var> = <var>C1</var>}</code></p>
<p><code>\color{<var>ORANGE</var>}{y = <var>Y</var>}</code></p>
</div>
</div>
</div>
<div id="substitution-x">
<div class="vars" data-ensure="abs( A1 * X + B1 * Y ) &lt; 13 &amp;&amp; abs( A2 * X + B2 * Y ) &lt; 13 &amp;&amp; abs( A2 * X + B2 * Y ) !== 0 &amp;&amp; ( A1 * B2 ) !== ( A2 * B1 )">
<var id="X">randRangeNonZero( -10, 10 )</var>
<var id="Y" data-ensure="getGCD( abs( X ), abs( Y ) ) === 1">randRangeNonZero( -10, 10 )</var>
<var id="A1">randRange( 1, 6 ) * randRangeNonZero( -1, 1 )</var>
<var id="B1">randRange( 1, 6 ) * randRangeNonZero( -1, 1 )</var>
<var id="C1">A1 * X + B1 * Y</var>
<var id="A2">1</var>
<var id="B2">randRange( 1, 6 ) * randRangeNonZero( -1, 1 )</var>
<var id="C2">A2 * X + B2 * Y</var>
<var id="SIGN_1">A1 * C2 &gt; 0 ? "-" : "+"</var>
<var id="SIGN_2">B1 * Y &gt; 0 ? "-" : "+"</var>
</div>
<p class="problem">Solve for <code>x</code> and <code>y</code> using substitution.</p>
<div class="question">
<p><code>\color{<var>BLUE</var>}{<var>expr(["+", ["*", A1, "x"], ["*", B1, "y"]])</var> = <var>C1</var>}</code><br>
<code>\color{<var>GREEN</var>}{x = <var>expr(["+", ["*", -B2, "y"], C2])</var>}</code></p>
</div>
<div class="solution" data-type="multiple">
<p><code>x</code> = <span class="sol short50"><var>X</var></span></p>
<p><code>y</code> = <span class="sol short50"><var>Y</var></span></p>
</div>
<div class="hints">
<div>
<p>Since <code>x</code> has already been solved for, substitute <code class="hint_green"><var>expr(["+", ["*", -B2, "y"], C2])</var></code> for <code>x</code> in the first equation.</p>
<p><code>\color{<var>BLUE</var>}{<span data-if="abs( A1 ) !== 1"><var>A1</var></span><span data-if="A1 === -1">-</span>}\color{<var>GREEN</var>}{(<var>expr(["+", ["*", -B2, "y"], C2])</var>)}\color{<var>BLUE</var>}{+ <var>expr(["*", B1, "y"])</var> = <var>C1</var>}</code></p>
</div>
<div>
<p>Simplify and solve for <code>y</code>.</p>
</div>
<div>
<p><code><var>expr(["+", ["*", A1 * -B2, "y"], A1 * C2])</var> + <var>expr(["*", B1, "y"])</var> = <var>C1</var></code></p>
<p><code><var>expr(["+", ["*", A1 * -B2 + B1, "y"], A1 * C2])</var> = <var>C1</var></code></p>
<p><code><var>expr(["+", ["*", A1 * -B2 + B1, "y"], A1 * C2])</var>\color{<var>BLUE</var>}{<var>SIGN_1</var><var>abs( A1 * C2 )</var>} = <var>C1</var>\color{<var>BLUE</var>}{<var>SIGN_1</var><var>abs( A1 * C2 )</var>}</code></p>
<p data-if="( A1 * -B2 + B1 ) !== 1"><code><var>expr(["*", A1 * -B2 + B1, "y"])</var> = <var>C1 - A1 * C2</var></code></p>
<p data-if="( A1 * -B2 + B1 ) !== 1"><code>\dfrac{<var>expr(["*", A1 * -B2 + B1, "y"])</var>}{\color{<var>BLUE</var>}{<var>A1 * -B2 + B1</var>}} = \dfrac{<var>C1 - A1 * C2</var>}{\color{<var>BLUE</var>}{<var>A1 * -B2 + B1</var>}}</code></p>
<p><code>\color{<var>ORANGE</var>}{y = <var>Y</var>}</code></p>
</div>
<div>
<p>Now that you know <code>\color{<var>ORANGE</var>}{y = <var>Y</var>}</code>, plug it back into <code>\thinspace \color{<var>GREEN</var>}{x = <var>expr(["+", ["*", -B2, "y"], C2])</var>}\thinspace</code> to find <code>x</code>.</p>
</div>
<div>
<p><code>\color{<var>GREEN</var>}{x = <span data-if="abs( B2 ) !== 1"><var>-B2</var></span><span data-if="B2 === 1">-</span>}\color{<var>ORANGE</var>}{(<var>Y</var>)}\color{<var>GREEN</var>}{ + <var>C2</var>}</code></p>
<p data-if="B2 !== -1"><code>x = <var>-B2 * Y</var> + <var>C2</var></code></p>
<p><code>\color{red}{x = <var>X</var>}</code></p>
</div>
<div>
<p>You can also plug <code>\color{<var>ORANGE</var>}{y = <var>Y</var>}</code> into <code>\thinspace \color{<var>BLUE</var>}{<var>expr(["+", ["*", A1, "x"], ["*", B1, "y"]])</var> = <var>C1</var>}\thinspace</code> and get the same answer for <code>x</code>:</p>
<p><code>\color{<var>BLUE</var>}{<var>expr(["*", A1, "x"])</var> + <span data-if="abs( B1 ) !== 1"><var>B1</var></span><span data-if="B1 === -1">-</span>}\color{<var>ORANGE</var>}{(<var>Y</var>)}\color{<var>BLUE</var>}{= <var>C1</var>}</code></p>
<p><code>\color{red}{x = <var>X</var>}</code></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>