This repository has been archived by the owner on May 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 863
/
simplifying_fractions.html
80 lines (71 loc) · 2.91 KB
/
simplifying_fractions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html data-require="math word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Simplifying fractions</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars" data-ensure="! (getGCD ( NUM, DENOM ) === NUM || getGCD ( NUM, DENOM) === DENOM)">
<var id="FACTOR">randRange( 3, 15 )</var>
<var id="NUM">randRange(2, 10) * FACTOR</var>
<var id="DENOM">randRange(2, 10) * FACTOR</var>
<var id="GCD">getGCD( NUM, DENOM )</var>
<var id="GCD_FACTORS">getPrimeFactorization( GCD )</var>
<var id="HINT">
(function(){
var factorValue = 1;
var factorDisplay = "";
var hint = "\\dfrac{" + NUM + "}{" + DENOM + "}";
jQuery.each( GCD_FACTORS, function( index, value) {
factorValue *= value;
var dot = index === 0 ? "" : "\\cdot ";
factorDisplay += dot + value;
hint += "= \\dfrac{" + factorDisplay + "\\cdot" + NUM / factorValue + "}{" + factorDisplay + "\\cdot" + DENOM / factorValue + "}";
});
hint += "= \\dfrac{" + NUM / GCD + "}{" + DENOM / GCD + "}";
return hint;
})()
</var>
</div>
<div class="problems">
<div>
<p class="problem">Simplify to lowest terms.</p>
<p class="question"><code>\dfrac{<var>NUM</var>}{<var>DENOM</var>}</code></p>
<p class="solution" data-type="rational"><var>NUM / DENOM</var></p>
</div>
</div>
<div class="hints">
<p data-if="GCD_FACTORS.length !== 1">There are several ways to tackle this problem.</p>
<p>What is the greatest common factor (GCD) of <var>NUM</var> and <var>DENOM</var>?</p>
<p><code><var>NUM</var> = <var>getPrimeFactorization( NUM ).join( "\\cdot" )</var></code><br />
<code><var>DENOM</var> = <var>getPrimeFactorization( DENOM ).join( "\\cdot" )</var></code></p>
<p><code>\mbox{GCD}(<var>NUM</var>, <var>DENOM</var>)<span data-if="!isPrime(GCD)"> = <var>GCD_FACTORS.join( "\\cdot" )</var></span> = <var>GCD</var></code></p>
<p>
<code>\dfrac{<var>NUM</var>}{<var>DENOM</var>}
= \dfrac{<var>NUM / GCD</var> \cdot <var>GCD</var>}{ <var>DENOM / GCD</var>\cdot <var>GCD</var>}</code>
</p>
<p>
<code>\hphantom{\dfrac{<var>NUM</var>}{<var>DENOM</var>}}
= \dfrac{<var>NUM / GCD</var>}{<var>DENOM / GCD</var>} \cdot \dfrac{<var>GCD</var>}{<var>GCD</var>}</code>
</p>
<p>
<code>\hphantom{\dfrac{<var>NUM</var>}{<var>DENOM</var>}}
= \dfrac{<var>NUM / GCD</var>}{<var>DENOM / GCD</var>} \cdot 1</code>
</p>
<p>
<code>\hphantom{\dfrac{<var>NUM</var>}{<var>DENOM</var>}}
= \dfrac{<var>NUM / GCD</var>}{<var>DENOM / GCD</var>}</code>
</p>
<div data-if="GCD_FACTORS.length !== 1" data-unwrap>
<p>You can also solve this problem by repeatedly breaking the numerator and denominator into common factors.</p>
<div>
<p>For example:</p>
<p><code><var>HINT</var></code></p>
</div>
</div>
</div>
</div>
</body>
</html>