Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (46 sloc) 2.286 kB
<!DOCTYPE html>
<html data-require="math math-format">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Subtracting fractions</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div>
<div class="vars" data-ensure="N1/D1 > N2/D2">
<div data-ensure="D1 !== D2">
<var id="D1">randFromArray(smallDenominators)</var>
<var id="D2">randFromArray(smallDenominators)</var>
</div>
<var id="N1">randRangeExclude(1, 9, [D1])</var>
<var id="N2">randRangeExclude(1, 9, [D2])</var>
<var id="LCM">getLCM(D1, D2)</var>
<var id="F1">LCM / D1</var>
<var id="F2">LCM / D2</var>
<var id="GCD">getGCD(F1 * N1 - F2 * N2, LCM)</var>
</div>
<p class="question"><code><var>fraction(N1, D1)</var> - <var>fraction(N2, D2)</var> = {?}</code></p>
<p class="solution" data-type="rational"><var>N1 / D1 - N2 / D2</var></p>
<div class="hints">
<p><code>
\qquad = \blue{\dfrac{<var>N1</var> \times <var>F1</var>}{<var>D1</var> \times <var>F1</var>}} -
\green{\dfrac{<var>N2</var> \times <var>F2</var>}{<var>D2</var> \times <var>F2</var>}}
</code></p>
<p><code>
\qquad = \blue{\dfrac{<var>N1 * F1</var>}{<var>LCM</var>}} -
\green{\dfrac{<var>N2 * F2</var>}{<var>LCM</var>}}
</code></p>
<p><code>
\qquad = \dfrac{\blue{<var>N1 * F1</var>} -
\green{<var>N2 * F2</var>}}{<var>LCM</var>}
</code></p>
<p><code>\qquad = <var>fraction(F1 * N1 - F2 * N2, LCM)</var></code></p>
<p data-if="GCD !== 1"><code>\qquad = <var>fractionReduce(F1 * N1 - F2 * N2, LCM)</var></code></p>
</div>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.