Permalink
Fetching contributors…
Cannot retrieve contributors at this time
181 lines (160 sloc) 8.99 KB
<!DOCTYPE html>
<html data-require="math math-format">
<head>
<title>Adding and subtracting mixed numbers 1</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="two-numbers">
<div class="vars">
<var id="PM">randRangeNonZero(-1, 1)</var>
<var id="SIGN">PM === 1 ? "+" : "-"</var>
<var id="W1">randRange(2, 19)</var>
<var id="W2">PM === 1 ? randRange(1, 19) : randRange(-W1 + 1, -1)</var>
<div data-ensure="getLCM(D1, D2) &lt; 61">
<var id="D1">randRange(3, 20)</var>
<var id="D2">randRangeExclude(3, 20, [D1])</var>
</div>
<div data-ensure="( PM === 1 ? (N1 / D1) + (N2 / D2) &lt; 1 : (N1 / D1) + PM * (N2 / D2) &gt; 0)">
<var id="N1">randRange(1, D1 - 1)</var>
<var id="N2">randRange(1, D2 - 1)</var>
</div>
<var id="GCD1">getGCD(N1, D1)</var>
<var id="SIMP_N1">N1 / GCD1</var>
<var id="SIMP_D1">D1 / GCD1</var>
<var id="GCD2">getGCD(N2, D2)</var>
<var id="SIMP_N2">N2 / GCD2</var>
<var id="SIMP_D2">D2 / GCD2</var>
<var id="LCM">getLCM(SIMP_D1, SIMP_D2)</var>
<var id="GCD">getGCD(SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2 , LCM)</var>
</div>
<p class="problem">Express your answer as a <em>mixed number simplified to lowest terms</em>.</p>
<p class="question"><code>
<var>W1</var><var>fraction(N1, D1)</var> <var>SIGN</var> <var>abs(W2)</var><var>fraction(N2, D2)</var> = {?}
</code></p>
<div class="solution" data-type="mixed"><var>W1 + W2 + N1 / D1 + PM * N2 / D2</var></div>
<div class="hints">
<div data-if="GCD1 !== 1 || GCD2 !== 1">
<p><code>\qquad =
\blue{<var>W1</var><var>fraction(SIMP_N1, SIMP_D1)</var>} <var>SIGN</var>
\pink{<var>abs(W2)</var><var>fraction(SIMP_N2, SIMP_D2)</var>}
</code></p>
</div>
<p data-if="SIGN === '-'"><code>\qquad =
\blue{<var>W1</var>} + \blue{<var>fraction(SIMP_N1, SIMP_D1)</var>} <var>SIGN</var>
\left(\pink{<var>abs(W2)</var>} + \pink{<var>fraction(SIMP_N2, SIMP_D2)</var>}\right)
</code></p>
<p><code>\qquad =
\blue{<var>W1</var>} + \blue{<var>fraction(SIMP_N1, SIMP_D1)</var>} <var>SIGN</var>
\pink{<var>abs(W2)</var>} <var>SIGN</var> \pink{<var>fraction(SIMP_N2, SIMP_D2)</var>}
</code></p>
<div>
<p><code>\qquad =
\blue{<var>W1</var>} <var>SIGN</var> \pink{<var>abs(W2)</var>} +
\blue{<var>fraction(SIMP_N1, SIMP_D1)</var>} <var>SIGN</var>
\pink{<var>fraction(SIMP_N2, SIMP_D2)</var>}
</code></p>
<p><code>\qquad =
<var>W1 + W2</var> + \blue{<var>fraction(SIMP_N1, SIMP_D1)</var>} <var>SIGN</var>
\pink{<var>fraction(SIMP_N2, SIMP_D2)</var>}
</code></p>
</div>
<div data-if="LCM !== 1">
<p><code>\qquad =
<var>W1 + W2</var> + \blue{<var>fraction(SIMP_N1 * LCM / SIMP_D1, LCM)</var>} <var>SIGN</var>
\pink{<var>fraction(SIMP_N2 * LCM / SIMP_D2, LCM)</var>}
</code></p>
</div>
<div>
<p><code>\qquad = <var>W1 + W2</var> + <var>fraction(SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2, LCM)</var></code></p>
<p><code>\qquad = <var>W1 + W2 + fraction(SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2, LCM)</var></code></p>
<p data-if="GCD > 1"><code>\qquad =
<var>W1 + W2 + fractionReduce(SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2, LCM)</var>
</code></p>
</div>
</div>
</div>
<div id="two-numbers-w-borrowing">
<div class="vars">
<var id="PM">-1</var>
<var id="SIGN">"-"</var>
<var id="W1">randRange(2, 19)</var>
<var id="W2">randRange(-W1 + 1, -1)</var>
<div data-ensure="getLCM( D1, D2 ) &lt; 61">
<var id="D1">randRange(3, 20)</var>
<var id="D2">randRangeExclude(3, 20, [D1])</var>
</div>
<div data-ensure="(N1 / D1) &lt; (N2 / D2)">
<var id="N1">randRange(1, D1 - 1)</var>
<var id="N2">randRange(1, D2 - 1)</var>
</div>
<var id="GCD1">getGCD(N1, D1)</var>
<var id="SIMP_N1">N1 / GCD1</var>
<var id="SIMP_D1">D1 / GCD1</var>
<var id="GCD2">getGCD(N2, D2)</var>
<var id="SIMP_N2">N2 / GCD2</var>
<var id="SIMP_D2">D2 / GCD2</var>
<var id="LCM">getLCM(SIMP_D1, SIMP_D2)</var>
<var id="GCD">getGCD(SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2 , LCM)</var>
</div>
<p class="problem">Express your answer as a <em>mixed number simplified to lowest terms</em>.</p>
<p class="question"><code><var>W1 + 1</var><var>fraction(N1, D1)</var> + <var>W2</var><var>fraction(N2, D2)</var> = {?}</code></p>
<div class="solution" data-type="mixed"><var>W1 + 1 + W2 + N1 / D1 + PM * N2 / D2</var></div>
<div class="hints">
<div data-if="GCD1 !== 1 || GCD2 !== 1">
<p><code>\qquad =
\blue{<var>W1 + 1</var><var>fraction(SIMP_N1, SIMP_D1)</var>} <var>SIGN</var>
\pink{<var>abs(W2)</var><var>fraction(SIMP_N2, SIMP_D2)</var>}
</code></p>
</div>
<div data-if="LCM !== 1">
<p><code>\qquad =
\blue{<var>W1 + 1</var><var>fraction(SIMP_N1 * LCM / SIMP_D1, LCM)</var>} <var>SIGN</var>
\pink{<var>abs(W2)</var><var>fraction(SIMP_N2 * LCM / SIMP_D2, LCM)</var>}
</code></p>
</div>
<p><code>\qquad =
\blue{<var>W1</var> + <var>fraction(LCM, LCM)</var> + <var>fraction(SIMP_N1 * LCM / SIMP_D1, LCM)</var>} <var>SIGN</var>
\pink{<var>abs(W2)</var><var>fraction(SIMP_N2 * LCM / SIMP_D2, LCM)</var>}
</code></p>
<p><code>\qquad =
\blue{<var>W1</var><var>fraction(LCM + SIMP_N1 * LCM / SIMP_D1, LCM)</var>} <var>SIGN</var>
\pink{<var>abs(W2)</var><var>fraction(SIMP_N2 * LCM / SIMP_D2, LCM)</var>}
</code></p>
<p><code>\qquad =
\blue{<var>W1</var>} + \blue{<var>fraction(LCM + SIMP_N1 * LCM / SIMP_D1, LCM)</var>} <var>SIGN</var>
\left(\pink{<var>abs(W2)</var>} + \pink{<var>fraction(SIMP_N2 * LCM / SIMP_D2, LCM)</var>}\right)
</code></p>
<p><code>\qquad =
\blue{<var>W1</var>} + \blue{<var>fraction(LCM + SIMP_N1 * LCM / SIMP_D1, LCM)</var>} <var>SIGN</var>
\pink{<var>abs(W2)</var>} <var>SIGN</var> \pink{<var>fraction(SIMP_N2 * LCM / SIMP_D2, LCM)</var>}
</code></p>
<div>
<p><code>\qquad =
\blue{<var>W1</var>} <var>SIGN</var> \pink{<var>abs(W2)</var>} +
\blue{<var>fraction(LCM + SIMP_N1 * LCM / SIMP_D1, LCM)</var>}<var>SIGN</var> \pink{<var>fraction(SIMP_N2 * LCM / SIMP_D2, LCM)</var>}
</code></p>
<p><code>\qquad =
<var>W1 + W2 </var> + \blue{<var>fraction(LCM + SIMP_N1 * LCM / SIMP_D1, LCM)</var>} <var>SIGN</var>
\pink{<var>fraction(SIMP_N2 * LCM / SIMP_D2, LCM)</var>}
</code></p>
</div>
<div>
<p><code>\qquad =
<var>W1 + W2</var> + <var>fraction((LCM + SIMP_N1 * LCM / SIMP_D1) + (PM * SIMP_N2 * LCM / SIMP_D2), LCM)</var>
</code></p>
<p><code>\qquad =
<var>W1 + W2</var><var>fraction((LCM + SIMP_N1 * LCM / SIMP_D1) + PM * SIMP_N2 * LCM / SIMP_D2, LCM)</var>
</code></p>
<p data-if="GCD > 1"><code>=
<var>W1 + W2 + fractionReduce((LCM + SIMP_N1 * LCM / SIMP_D1) + PM * SIMP_N2 * LCM / SIMP_D2, LCM)</var>
</code></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>