This repository has been archived by the owner on May 11, 2021. It is now read-only.
/
adding_subtracting_mixed_numbers_1.html
158 lines (142 loc) · 8.98 KB
/
adding_subtracting_mixed_numbers_1.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html>
<html data-require="math math-format">
<head>
<title>Adding and subtracting mixed numbers 1</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="two-numbers">
<div class="vars">
<var id="PM">randRangeNonZero( -1, 1 )</var>
<var id="SIGN">( PM === 1 ? "+" : "-")</var>
<var id="W1">randRange( 2, 19 )</var>
<var id="W2">( PM === 1 ? randRange( 1, 19 ) : randRange( -W1 + 1, -1 ))</var>
<div data-ensure="getLCM( D1, D2 ) < 61 && D1 !== D2">
<var id="D1">randRange( 3, 20 )</var>
<var id="D2">randRange( 3, 20 )</var>
</div>
<div data-ensure="( PM === 1 ? (N1 / D1) + (N2 / D2) < 1 : (N1 / D1) + PM * (N2 / D2) > 0)">
<var id="N1">randRange( 1, D1 - 1 )</var>
<var id="N2">randRange( 1, D2 - 1 )</var>
</div>
<var id="GCD1">getGCD( N1, D1 )</var>
<var id="SIMP_N1">N1 / GCD1</var>
<var id="SIMP_D1">D1 / GCD1</var>
<var id="GCD2">getGCD( N2, D2 )</var>
<var id="SIMP_N2">N2 / GCD2</var>
<var id="SIMP_D2">D2 / GCD2</var>
<var id="LCM">getLCM( SIMP_D1, SIMP_D2 )</var>
<var id="GCD">getGCD( SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2 , LCM )</var>
</div>
<p class="problem">Express your answer as a mixed number simplified to lowest terms.</p>
<p class="question"><code><var>expr(["+", W1 + fraction( N1, D1 ), W2 + fraction( N2, D2 )])</var> = {?}</code></p>
<div class="solution" data-type="mixed"><var>W1 + W2 + N1 / D1 + PM * N2 / D2</var></div>
<div class="hints">
<div>
<p>Separate the whole numbers from the fractional parts:</p>
<p><code>= \blue{<var>W1</var>} + \blue{<var>fraction( N1, D1 )</var>} <var>SIGN</var> \pink{<var>abs( W2 )</var>} <var>SIGN</var> \pink{<var>fraction( N2, D2 )</var>}</code></p>
</div>
<div>
<p>Bring the whole numbers together and the fractions together:</p>
<p><code>= \blue{<var>W1</var>} <var>SIGN</var> \pink{<var>abs( W2 )</var>} + \blue{<var>fraction( N1, D1 )</var>} <var>SIGN</var> \pink{<var>fraction( N2, D2 )</var>}</code></p>
</div>
<div>
<p><span data-if="PM === 1">Add</span><span data-else="">Subtract</span> the whole numbers:</p>
<p><code>=<var>W1 + W2</var> + \blue{<var>fraction( N1, D1 )</var>} <var>SIGN</var> \pink{<var>fraction( N2, D2 )</var>}</code></p>
</div>
<div data-if="GCD1 !== 1 || GCD2 !== 1">
<p>Simplify each fraction:</p>
<p><code>= <var>W1+W2</var> + \blue{<var>fraction( SIMP_N1, SIMP_D1 )</var>} <var>SIGN</var> \pink{<var>fraction( SIMP_N2, SIMP_D2 )</var>}</code></p>
</div>
<div>
<p>Find a common denominator for the fractions:</p>
<p><code>= <var>expr(["+", W1 + W2, fraction( SIMP_N1 * LCM / SIMP_D1, LCM ),fraction( PM * SIMP_N2 * LCM / SIMP_D2, LCM )])</var></code></p>
</div>
<div>
<p><span data-if="PM === 1">Add</span><span data-else="">Subtract</span> the fractions:</p>
<p><code>= <var>expr(["+", W1 + W2, fraction( SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2, LCM )])</var></code></p>
</div>
<div>
<p>Combine the whole and fractional parts into a mixed number:</p>
<p><code>= <var>W1 + W2 + fraction( SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2, LCM )</var></code></p>
</div>
<div data-if="GCD > 1">
<p>Simplify to lowest terms:</p>
<p><code>= <var>W1 + W2 + fractionReduce( SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2, LCM )</var></code></p>
</div>
</div>
</div>
<div id="two-numbers-w-borrowing">
<div class="vars">
<var id="PM">-1</var>
<var id="SIGN">"-"</var>
<var id="W1">randRange( 2, 19 )</var>
<var id="W2">randRange( -W1 + 1, -1 )</var>
<div data-ensure="getLCM( D1, D2 ) < 61 && D1 !== D2">
<var id="D1">randRange( 3, 20 )</var>
<var id="D2">randRange( 3, 20 )</var>
</div>
<div data-ensure="(N1 / D1) < (N2 / D2)">
<var id="N1">randRange( 1, D1 - 1 )</var>
<var id="N2">randRange( 1, D2 - 1 )</var>
</div>
<var id="GCD1">getGCD( N1, D1 )</var>
<var id="SIMP_N1">N1 / GCD1</var>
<var id="SIMP_D1">D1 / GCD1</var>
<var id="GCD2">getGCD( N2, D2 )</var>
<var id="SIMP_N2">N2 / GCD2</var>
<var id="SIMP_D2">D2 / GCD2</var>
<var id="LCM">getLCM( SIMP_D1, SIMP_D2 )</var>
<var id="GCD">getGCD( SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2 , LCM )</var>
</div>
<p class="problem">Express your answer as a mixed number simplified to lowest terms.</p>
<p class="question"><code><var>expr(["+", W1 + 1 + fraction( N1, D1 ), W2 + fraction( N2, D2 )])</var> = {?}</code></p>
<div class="solution" data-type="mixed"><var>W1 + 1 + W2 + N1 / D1 + PM * N2 / D2</var></div>
<div class="hints">
<div data-if="GCD1 !== 1 || GCD2 !== 1">
<p>Simplify each fraction.</p>
<p><code>= \blue{<var>W1 + 1</var><var>fraction( SIMP_N1, SIMP_D1 )</var>} <var>SIGN</var> \pink{<var>abs( W2 )</var><var>fraction( SIMP_N2, SIMP_D2 )</var>}</code></p>
</div>
<div>
<p>Find a common denominator for the fractions:</p>
<p><code>= \blue{<var>W1 + 1</var><var>fraction( SIMP_N1 * LCM / SIMP_D1, LCM )</var>}<var>SIGN</var>\pink{<var>abs( W2 )</var><var>fraction( SIMP_N2 * LCM / SIMP_D2, LCM )</var>}</code></p>
</div>
<div>
<p>Convert <code>\blue{<var>W1 + 1</var><var>fraction( SIMP_N1 * LCM / SIMP_D1, LCM)</var>}</code> to <code>\blue{<var> W1</var> + <var>fraction( LCM, LCM)</var> + <var>fraction( SIMP_N1 * LCM / SIMP_D1, LCM)</var>}</code>.</p>
</div>
<div>
<p>So the problem becomes: </p>
<p><code>\blue{<var>W1</var><var>fraction( LCM + SIMP_N1 * LCM / SIMP_D1, LCM)</var>}<var>SIGN</var>\pink{<var>abs( W2 )</var><var>fraction( SIMP_N2 * LCM / SIMP_D2, LCM)</var>}</code></p>
</div>
<div>
<p>Separate the whole numbers from the fractional parts:</p>
<p><code>= \blue{<var>W1</var>} + \blue{<var>fraction( LCM + SIMP_N1 * LCM / SIMP_D1, LCM )</var>} <var>SIGN</var> \pink{<var>abs( W2 )</var>} <var>SIGN</var> \pink{<var>fraction( SIMP_N2 * LCM / SIMP_D2, LCM)</var>}</code></p>
</div>
<div>
<p>Bring the whole numbers together and the fractions together:</p>
<p><code>= \blue{<var>W1</var>} <var>SIGN</var> \pink{<var>abs( W2 )</var>} + \blue{<var>fraction( LCM + SIMP_N1 * LCM / SIMP_D1, LCM )</var>} <var>SIGN</var> \pink{<var>fraction( SIMP_N2 * LCM / SIMP_D2, LCM )</var>}</code></p>
</div>
<div>
<p><span data-if="PM === 1">Add</span><span data-else="">Subtract</span> the whole numbers:</p>
<p><code>=<var>W1 + W2 </var> + \blue{<var>fraction( LCM + SIMP_N1 * LCM / SIMP_D1, LCM )</var>} <var>SIGN</var> \pink{<var>fraction( SIMP_N2 * LCM / SIMP_D2, LCM)</var>}</code></p>
</div>
<div>
<p><span data-if="PM === 1">Add</span><span data-else="">Subtract</span> the fractions:</p>
<p><code>= <var>expr(["+", W1 + W2, fraction( (LCM + SIMP_N1 * LCM / SIMP_D1) + (PM * SIMP_N2 * LCM / SIMP_D2), LCM )])</var></code></p>
</div>
<div>
<p>Combine the whole and fractional parts into a mixed number:</p>
<p><code>= <var>W1 + W2 + fraction( (LCM + SIMP_N1 * LCM / SIMP_D1) + PM * SIMP_N2 * LCM / SIMP_D2, LCM )</var></code></p>
</div>
<div data-if="GCD > 1">
<p>Simplify to lowest terms:</p>
<p><code>= <var>W1 + W2 + fractionReduce( (LCM + SIMP_N1 * LCM / SIMP_D1) + PM * SIMP_N2 * LCM / SIMP_D2, LCM )</var></code></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>