Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 115 lines (85 sloc) 4.23 kb
770b5f1 @pkuperman Add exercise-- Subtracting Fractions (row 21)
pkuperman authored
1 <!DOCTYPE html>
5bdaa31 @jruberg reorganizing of subtracting fractions to better handle reducing fract…
jruberg authored
2 <html data-require="math math-format">
770b5f1 @pkuperman Add exercise-- Subtracting Fractions (row 21)
pkuperman authored
3 <head>
519856f @spicyj title Capitalization
spicyj authored
4 <title>Subtracting fractions</title>
770b5f1 @pkuperman Add exercise-- Subtracting Fractions (row 21)
pkuperman authored
5 <script src="../khan-exercise.js"></script>
5bdaa31 @jruberg reorganizing of subtracting fractions to better handle reducing fract…
jruberg authored
6 <script type="text/javascript">
7 function multiplier( n ) {
8 return n === 1 ? "" : "\\cdot\\dfrac{" + n + "}{" + n + "}";
9 }
10 </script>
770b5f1 @pkuperman Add exercise-- Subtracting Fractions (row 21)
pkuperman authored
11 </head>
12
13 <body>
14 <div class="exercise">
15 <div class="problems">
16
ff84c0f @pkuperman Subtracting Fractions remove id
pkuperman authored
17 <div>
770b5f1 @pkuperman Add exercise-- Subtracting Fractions (row 21)
pkuperman authored
18 <div class="vars">
19
5bdaa31 @jruberg reorganizing of subtracting fractions to better handle reducing fract…
jruberg authored
20 <!-- make sure we won't be dealing with huge common denominators or fractions that start off with common denominators -->
21 <div data-ensure="getLCM( D1, D2 ) < 60">
22
23 <!-- temporary denominators -->
24 <var id="_D1">randRange( 3, 20 )</var>
25 <var id="_D2">randRange( 3, 20 )</var>
26
27 <!-- temporary numerators; want to make sure that the result is pos -->
28 <div data-ensure="RESULT > 0">
29 <var id="_N1">randRange( 1, _D1 - 1 )</var>
30 <var id="_N2">randRange( 1, _D2 - 1 )</var>
31 <var id="RESULT">( _N1 / _D1 ) - ( _N2 / _D2 )</var>
32 </div>
33
34 <var id="GCD1">getGCD( _N1, _D1 )</var>
35 <var id="GCD2">getGCD( _N2, _D2 )</var>
36
37 <!-- permanent numerators and denominators -->
38 <var id="N1">round( _N1 / GCD1 )</var>
39 <var id="D1">round( _D1 / GCD1 )</var>
40 <var id="N2">round( _N2 / GCD2 )</var>
41 <var id="D2">round( _D2 / GCD2 )</var>
42
770b5f1 @pkuperman Add exercise-- Subtracting Fractions (row 21)
pkuperman authored
43 </div>
44
5bdaa31 @jruberg reorganizing of subtracting fractions to better handle reducing fract…
jruberg authored
45 <!-- LCM and multipliers to get fractions to common denoms -->
46 <var id="LCM">getLCM( D1, D2 )</var>
47 <var id="M1">round( LCM / D1 )</var>
48 <var id="M2">round( LCM / D2 )</var>
49
50 <!-- result simplification -->
51 <var id="GCD">getGCD( N1*M1 - N2*M2, M1*D1 )</var>
52 <var id="N">round( ( N1*M1 - N2*M2 ) / GCD )</var>
53 <var id="D">round( ( M1*D1 ) / GCD )</var>
d8293b1 @pkuperman Subtracting Fractions fixes
pkuperman authored
54
770b5f1 @pkuperman Add exercise-- Subtracting Fractions (row 21)
pkuperman authored
55 </div>
56
5bdaa31 @jruberg reorganizing of subtracting fractions to better handle reducing fract…
jruberg authored
57 <p class="question">Write the following as a fraction. Simplify your answer to lowest terms.</p>
58
59 <p class="problem"><code><var>fraction( _N1, _D1 )</var> - <var>fraction( _N2, _D2 )</var> = {?}</code></p>
60
61 <div class="solution" data-type="rational"><var>RESULT</var></div>
770b5f1 @pkuperman Add exercise-- Subtracting Fractions (row 21)
pkuperman authored
62
63 <div class="hints">
5bdaa31 @jruberg reorganizing of subtracting fractions to better handle reducing fract…
jruberg authored
64
65 <div data-if="GCD1 > 1" data-unwrap>
66 <p>The first fraction simplifies.</p>
67 <p><code>= <var>fraction( N1, D1 )</var> - <var>fraction( _N2, _D2 )</var></code></p>
68 </div>
69
70 <div data-if="GCD2 > 1" data-unwrap>
71 <p>The second fraction simplifies.</p>
72 <p><code>= <var>fraction( N1, D1 )</var> - <var>fraction( N2, D2 )</var></code></p>
73 </div>
74
75 <div data-if="M1 === 1" data-unwrap>
76
77 <p>We need to find a common denominator. The first denominotar is <code><var>M2</var></code> times the second denominator, so we can multiply the second fraction by <code><var>M2</var></code>.</p>
78
79 </div><div data-else-if="M2 === 1" data-unwrap>
80
81 <p>We need to find a common denominator. The second denominator is <code><var>M1</var></code> times the first denominator, so we can multiply the first fraction by <code><var>M1</var></code>.</p>
82
83 </div><div data-else data-unwrap>
84
85 <p>We need to find a common denominator. The least common multiple of <code><var>D1</var></code> and <code><var>D2</var></code> is the smallest possible denominator.</p>
86 <p><code>\mbox{LCM}( <var>D1</var>, <var>D2</var> ) = <var>LCM</var></code></p>
87 <p>To get both fractions to a denominator of <code><var>LCM</var></code>, we need to multiply the first fraction by <code><var>M1</var></code> and we need to multiply the second fraction by <code><var>M2</var></code>.</p>
88
89 </div>
90
770b5f1 @pkuperman Add exercise-- Subtracting Fractions (row 21)
pkuperman authored
91 <div>
5bdaa31 @jruberg reorganizing of subtracting fractions to better handle reducing fract…
jruberg authored
92 <p>So now we have:</p>
93 <p><code>= \left(<var>fraction( N1, D1 ) + multiplier( M1 )</var>\right) - \left(<var>fraction( N2, D2 ) + multiplier( M2 )</var>\right)</code></p>
94 </div>
95
96 <p><code>= <var>fraction( M1*N1, M1*D1 )</var> - <var>fraction( M2*N2, M2*D2 )</var></code></p>
97
98 <div>
99 <p>Now that we have a common denominator, we can subtract:</p>
100 <p><code>= \dfrac{ <var>M1*N1</var> - <var>M2*N2</var> }{ <var>M1*D1</var> }</code></p>
101 </div>
102
103 <p><code>= <var>fraction( M1*N1 - M2*N2, M1*D1 )</var></code></p>
104
105 <div data-if="GCD > 1">
106 <p>This simplifies, so we now have:</p>
107 <p><code>= <var>fraction( N, D )</var></code></p>
770b5f1 @pkuperman Add exercise-- Subtracting Fractions (row 21)
pkuperman authored
108 </div>
109 </div>
110 </div>
111 </div>
112 </div>
113 </body>
114 </html>
Something went wrong with that request. Please try again.