Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 143 lines (130 sloc) 6.64 kB
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
1 <!DOCTYPE html>
2 <html data-require="math math-format expressions rational-expressions">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Adding and subtracting with like denominators 2</title>
6 <script src="../khan-exercise.js"></script>
7 <style type="text/css">
8 #solutionarea td {
9 text-align: center;
10 vertical-align: middle;
11 padding-left: 4px;
12 padding-right: 4px;
13 }
14 #solutionarea .soln-top {
15 padding-bottom: 1px;
16 }
17 #solutionarea .soln-bot {
18 padding-top: 1px;
19 border-top: 1px solid black;
20 }
21 </style>
22 </head>
23 <body>
24 <div class="exercise">
25 <div class="vars">
26 <var id="SIGN, S">randFromArray([["+", 1], ["-", -1]])</var>
27 <var id="X">randVar()</var>
28 <div data-ensure="X !== Y">
29 <var id="Y">randVar()</var>
30 </div>
31 <div data-ensure="getGCD(NUMERATOR1, DENOMINATOR1) === 1">
32 <var id="NUMERATOR1">randRangeWeighted(1, 10, 1, 0.4)</var>
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
33 <var id="DENOMINATOR1">randRange(2, 10)</var>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
34 </div>
35 <div data-ensure="DENOMINATOR1 !== DENOMINATOR2">
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
36 <var id="DENOMINATOR2">randRange(2, 10)</var>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
37 </div>
38 <div data-ensure="getGCD(NUMERATOR2, DENOMINATOR2) === 1">
39 <var id="NUMERATOR2">randRangeWeighted(1, 10, 1, 0.4)</var>
40 </div>
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
41 <var id="DENOMINATORCOEFF">getLCM(DENOMINATOR1, DENOMINATOR2)</var>
42 <var id="F1">DENOMINATORCOEFF / DENOMINATOR1</var>
43 <var id="F2">DENOMINATORCOEFF / DENOMINATOR2</var>
44 <var id="NUMERATORCOEFF">NUMERATOR1 * F1 + S * (NUMERATOR2 * F2)</var>
45 <var id="FACTOR">getGCD(NUMERATORCOEFF, DENOMINATORCOEFF)</var>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
46 </div>
47
48 <div class="problems">
49 <div id="variable-top">
50 <div class="vars">
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
51 <var id="N1">expr(["*", NUMERATOR1, X])</var>
52 <var id="N2">expr(["*", NUMERATOR2, X])</var>
53 <var id="D1">DENOMINATOR1</var>
54 <var id="D2">DENOMINATOR2</var>
55 <var id="NF1">expr(["*", NUMERATOR1 * F1, X])</var>
56 <var id="NF2">expr(["*", NUMERATOR2 * F2, X])</var>
57
58 <var id="NUMERATOR">expr(["*", NUMERATORCOEFF, X])</var>
59 <var id="DENOMINATOR">DENOMINATORCOEFF</var>
60
61 <var id="SIMPLENUMERATOR">expr(["*", NUMERATORCOEFF / FACTOR, X])</var>
62 <var id="SIMPLEDENOMINATOR">DENOMINATOR / FACTOR</var>
63
64 <var id="NUMERSOL">getExpressionRegex(NUMERATORCOEFF / FACTOR, X, 0)</var>
65 <var id="DENOMSOL">SIMPLEDENOMINATOR</var>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
66 </div>
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
67 </div>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
68
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
69 <div id="variable-bottom">
70 <div class="vars">
71 <var id="N1">NUMERATOR1</var>
72 <var id="N2">NUMERATOR2</var>
73 <var id="D1">expr(["*", DENOMINATOR1, X])</var>
74 <var id="D2">expr(["*", DENOMINATOR2, X])</var>
75 <var id="NF1">NUMERATOR1 * F1</var>
76 <var id="NF2">NUMERATOR2 * F2</var>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
77
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
78 <var id="NUMERATOR">NUMERATORCOEFF</var>
79 <var id="DENOMINATOR">expr(["*", DENOMINATORCOEFF, X])</var>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
80
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
81 <var id="SIMPLENUMERATOR">NUMERATORCOEFF / FACTOR</var>
82 <var id="SIMPLEDENOMINATOR">expr(["*", DENOMINATORCOEFF / FACTOR, X])</var>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
83
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
84 <var id="NUMERSOL">getExpressionRegex(NUMERATORCOEFF / FACTOR, X, 0)</var>
85 <var id="DENOMSOL">COMMONDENOM / FACTOR</var>
86 </div>
87 </div>
88
89 </div>
90
91 <p class="problem">Simplify the following expression:</p>
92 <p class="question">
93 <code><var>Y</var> = \dfrac{<var>N1</var>}{<var>D1</var>}
94 <var>SIGN</var> \dfrac{<var>N2</var>}{<var>D2</var>}</code>
95 </p>
96
97 <div class="solution" data-type="set">
98 <div class="set-sol" data-type="multiple">
99 <span class="sol" data-type="regex"><var>NUMERSOL</var></span>
100 <span class="sol" data-type="number"><var>DENOMSOL</var></span>
101 </div>
102 <div class="input-format">
103 <div class="entry" data-type="multiple">
104 <table>
105 <tr>
106 <td rowspan="2" class="soln-name">
107 <code><var>Y</var> = </code>
108 </td>
109 <td class="soln-top">
110 <span class="sol short50">a</span>
111 </td>
112 </tr>
113 <tr>
114 <td class="soln-bot">
115 <span class="sol short50" data-fallback="1">a</span>
116 </td>
117 </tr>
118 </table>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
119 </div>
120 </div>
121 </div>
122
123 <div class="hints">
124 <p>In order to <span data-if="SIGN === '+'">add</span><span data-else>subtract</span> expressions,
125 they must have a common denominator.</p>
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
126 <p>The smallest common denominator is the least common multiple of <code><var>D1</var></code> and <code><var>D2</var></code>.</p>
127 <p><code>\lcm(<var>D1</var>, <var>D2</var>) = <var>DENOMINATOR</var></code></p>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
128 <p><code>
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
129 <var>Y</var> = \dfrac{<var>F1</var>}{<var>F1</var>} \cdot \dfrac{<var>N1</var>}{<var>D1</var>}
130 <var>SIGN</var> \dfrac{<var>F2</var>}{<var>F2</var>} \cdot \dfrac{<var>N2</var>}{<var>D2</var>}
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
131 </code></p>
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
132 <p><code><var>Y</var> = \dfrac{<var>NF1</var>}{<var>DENOMINATOR</var>}<var>SIGN</var> \dfrac{<var>NF2</var>}{<var>DENOMINATOR</var>}</code></p>
133 <p><code><var>Y</var> = \dfrac{<var>NF1</var> <var>SIGN</var><var>NF2</var>}{<var>DENOMINATOR</var>}</code></p>
134 <p><code><var>Y</var> = \dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>}</code></p>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
135 <div data-if="FACTOR !== 1">
4eb4924 @petercollingridge Add exercise with variable in the denominator
petercollingridge authored
136 <div>Simplify the expression by dividing the numerator and denominator by <var>FACTOR</var>:</div>
137 <div><code><var>Y</var> = \dfrac{<var>SIMPLENUMERATOR</var>}{<var>SIMPLEDENOMINATOR</var>}</code></div>
3ed16a8 @petercollingridge Add exercise with varibles in numerator
petercollingridge authored
138 </div>
139 </div>
140 </div>
141 </body>
142 </html>
Something went wrong with that request. Please try again.