Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (46 sloc) 2.23 KB
<!DOCTYPE html>
<html data-require="math math-format">
<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>
<div class="exercise">
<div class="problems">
<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>
<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>
<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">
\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>}}
\qquad = \blue{\dfrac{<var>N1 * F1</var>}{<var>LCM</var>}} -
\green{\dfrac{<var>N2 * F2</var>}{<var>LCM</var>}}
\qquad = \dfrac{\blue{<var>N1 * F1</var>} -
\green{<var>N2 * F2</var>}}{<var>LCM</var>}
<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>
Jump to Line
Something went wrong with that request. Please try again.