Permalink
Fetching contributors…
Cannot retrieve contributors at this time
126 lines (112 sloc) 5.24 KB
<!DOCTYPE html>
<html data-require="math math-format graphie">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Evaluating expressions in 2 variables</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="AN, BN">shuffle(randFromArray(
[["x", "y"], ["a", "b"], ["c", "d"]]))</var>
<var id="A">randRange( 1, 10 )</var>
<var id="B">randRange( 1, 10 )</var>
<var id="A_COEFF">randRange(3, 10)</var>
<var id="B_COEFF">randRange(3, 10)</var>
<var id="CONSTANT">randRangeNonZero(-1, 1) * randRange(3, 10)</var>
</div>
<div class="problems">
<div id="a-plus-b">
<div class="vars">
<var id="SOLUTION">(A * A_COEFF) + (B * B_COEFF) + CONSTANT</var>
</div>
<p class="question">
Evaluate the following expression when
<span class="var1"><code><var>AN</var> = <var>A</var></code></span> and
<span class="var2"><code><var>BN</var> = <var>B</var></code></span>.
</p>
<p class="problem">
<code><var>A_COEFF</var></code><span class="var1"><code><var>AN</var></code></span><code>{} + <var>B_COEFF</var></code><span class="var2"><code><var>BN</var></code></span><code>{} + <var>CONSTANT</var></code>
</p>
<p class="solution"><var>SOLUTION</var></p>
<div class="hints">
<div>
<div class="graphie">
$(".var1").addClass("hint_pink");
$(".var2").addClass("hint_blue");
</div>
<p>
Substitute <code class="hint_pink"><var>A</var></code>
for <code>\pink{<var>AN</var>}</code> and
<code class="hint_blue"><var>B</var></code> for
<code>\blue{<var>BN</var>}</code>.
</p>
<p>
<code>
\qquad=\quad<var>A_COEFF</var>\pink{(<var>A</var>)}
+ <var>B_COEFF</var>\blue{(<var>B</var>)} +
<var>CONSTANT</var>
</code>
</p>
</div>
<p>
<code>
\qquad=\quad<var>A_COEFF * A</var> +
<var>B_COEFF * B</var> + <var>CONSTANT</var>
</code>
</p>
<p><code>\qquad=\quad<var>SOLUTION</var></code></p>
</div>
</div>
<div id="a-squared-plus-b" data-type="a-plus-b">
<div class="vars">
<var id="SOLUTION">(A * A * A_COEFF) + (B * B_COEFF) + CONSTANT</var>
</div>
<p class="problem">
<code><var>A_COEFF</var></code><span class="var1"><code><var>AN</var></code></span><code>{}^2 + <var>B_COEFF</var></code><span class="var2"><code><var>BN</var></code></span><code>{} + <var>CONSTANT</var></code>
</p>
<div class="hints">
<div>
<div class="graphie">
$(".var1").addClass("hint_pink");
$(".var2").addClass("hint_blue");
</div>
<p>
Substitute <code class="hint_pink"><var>A</var></code>
for <code>\pink{<var>AN</var>}</code> and
<code class="hint_blue"><var>B</var></code> for
<code>\blue{<var>BN</var>}</code>.
</p>
<p>
<code>
\qquad=\quad<var>A_COEFF</var>\pink{(<var>A</var>)}^2
+ <var>B_COEFF</var>\blue{(<var>B</var>)} +
<var>CONSTANT</var>
</code>
</p>
</div>
<div>
<p>
Remember order of operations. Evaluate the exponent
before you multiply.
</p>
<p><code>
\qquad=\quad<var>A_COEFF</var>(<var>A * A</var>)
+ <var>B_COEFF</var>\blue{(<var>B</var>)} +
<var>CONSTANT</var>
</code></p>
</div>
<p>
<code>
\qquad=\quad<var>A_COEFF * A * A</var> +
<var>B_COEFF * B</var> + <var>CONSTANT</var>
</code>
</p>
<p><code>\qquad=\quad<var>SOLUTION</var></code></p>
</div>
</div>
</div>
</div>
</body>
</html>