Khan/khan-exercises

Subversion checkout URL

You can clone with
or
.
Older
100644 250 lines (237 sloc) 8.967 kB
 d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 1 6469103 Limits 1 improvements, closes #258 spicyj authored Jul 20, 2011 2 d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 3 72418b8 Add meta charset to all HTML pages. jeresig authored Jul 28, 2011 4 d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 5 Limits 1 6 7 190610b Retool framework, move Math and Graph logic out of khan-exercise.js a… jeresig authored May 18, 2011 8 9
10
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 11
adcc771 Implement problem-specific var blocks. Fixes #3. jeresig authored May 19, 2011 12
3601211 Rename nonzero random range function osnr authored May 23, 2011 13 randRangeNonZero(-3, 3) adcc771 Implement problem-specific var blocks. Fixes #3. jeresig authored May 19, 2011 14 floor(sqrt(abs(10 / q_lcoef))) 3601211 Rename nonzero random range function osnr authored May 23, 2011 15 randRangeNonZero(-1 * edge, edge) adcc771 Implement problem-specific var blocks. Fixes #3. jeresig authored May 19, 2011 16 q_lcoef + 'x^2' 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 17 cleanMath('(x + ' + l_cons + ')') adcc771 Implement problem-specific var blocks. Fixes #3. jeresig authored May 19, 2011 18 function(x) { 19 return truncate_to_max(q_lcoef * Math.pow(x, 2), 4); 20 } 21 -1 * l_cons 22 curFunc(a) 23 limtoa 24 limtoa 25
cf02179 Strip trailing whitespace spicyj authored Jun 1, 2011 26 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 27

28
29 graphInit({ 30 range: 10, 31 scale: 20, 32 tickStep: 1, e6cf910 Add some axis labels (close #459) spicyj authored Jul 27, 2011 33 labelStep: 1, 34 unityLabels: false, 35 labelFormat: function( s ) { return "\\small{" + s + "}"; }, 761c7b2 The *other* One True Way prevails (by decree of Sal) spicyj authored Jul 27, 2011 36 axisArrows: "<->" 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 37 }); 38 39 style({ 40 stroke: "#6495ed" 41 }, function() { 42 plot( function(x) { 43 return q_lcoef * x * x; 44 }, [-10, 10] ); 45 46 circle( [a, limtoa], 4 / 20, { fill: "white" } ) 47 }); 9c227ad Refine the definition of graphs, implement a basic API. Fixes #5. jeresig authored May 18, 2011 48
190610b Retool framework, move Math and Graph logic out of khan-exercise.js a… jeresig authored May 18, 2011 49

limtoa

50
51
• 0
• 3601211 Rename nonzero random range function osnr authored May 23, 2011 52
• randRangeNonZero(-3, 3)
• 53
• randRangeNonZero(-3, 3)
• 190610b Retool framework, move Math and Graph logic out of khan-exercise.js a… jeresig authored May 18, 2011 54
• q_lcoef
• 55
• l_cons
• 56
• curFunc(0)
• 57
• Does not exist.
• 58
d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 59
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 60
61
3601211 Rename nonzero random range function osnr authored May 23, 2011 62 randRangeNonZero(-5, 5) 63 randRangeNonZero(-7, 7) 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 64 function(x) { 65 return x + abs_cons > 0 ? 66 abs_coef : 67 abs_coef * -1; 68 } 69 abs_cons * -1 70 curFunc(a) 71 abs_coef * -1 72 abs_coef 73
cf02179 Strip trailing whitespace spicyj authored Jun 2, 2011 74 d639176 small display changes for limits_1 spicyj authored Jul 14, 2011 75

\displaystyle \lim_{x\toa} \dfrac{abs_coef|x + abs_cons|}{x + abs_cons} = {?}

3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 76
77 graphInit({ 78 range: 10, 79 scale: 20, 80 tickStep: 1, e6cf910 Add some axis labels (close #459) spicyj authored Jul 27, 2011 81 labelStep: 1, 82 unityLabels: false, 83 labelFormat: function( s ) { return "\\small{" + s + "}"; }, 761c7b2 The *other* One True Way prevails (by decree of Sal) spicyj authored Jul 27, 2011 84 axisArrows: "<->" 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 85 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 86 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 87 style({ 88 stroke: "#6495ed" 89 }, function() { 90 line( [-11, abs_coef * -1], [-abs_cons, abs_coef * -1] ); 91 line( [-abs_cons, abs_coef], [11, abs_coef] ); 92 93 circle( [-abs_cons, -abs_coef], 4 / 20, { fill: "white" } ) 94 circle( [-abs_cons, abs_coef], 4 / 20, { fill: "white" } ) 95 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 96
97

Does not exist.

98
99
• 0
• 100
• a
• 101
• abs_cons
• 102
• abs_coef
• 103
• abs_coef * -1
• 104
• abs_coef * abs_coef
• 105
• abs_coef * abs_coef * -1
• 3601211 Rename nonzero random range function osnr authored May 23, 2011 106
• randRangeNonZero(-3, 3)
• 107
• randRangeNonZero(-3, 3)
• 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 108
f4cce3f fix exercises to use new templating jochu authored Jun 1, 2011 109
3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 110

The limit as we approach from the left doesn't match the limit as we approach from the right, so f(x) has no limit as x \to a.

0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 111
112
113
6469103 Limits 1 improvements, closes #258 spicyj authored Jul 20, 2011 114
3601211 Rename nonzero random range function osnr authored May 23, 2011 115 randRangeNonZero(-3, 3) 116 randRangeNonZero(-4, 4) 117 randRangeNonZero(-7, 7) 6469103 Limits 1 improvements, closes #258 spicyj authored Jul 20, 2011 118 expr(["+", ["*", l_coef, "x"], l_cons]) 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 119 function(x) { 120 return l_coef * x + l_cons; 121 } 122 ceil((-10 - l_cons)/l_coef) 123 floor((10 - l_cons)/l_coef) 6469103 Limits 1 improvements, closes #258 spicyj authored Jul 20, 2011 124 l_coef > 0 ? randRangeNonZero(a0, a1) : randRangeNonZero(a1, a0) 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 125 curFunc(a) 126 limtoa 127 limtoa 128
cf02179 Strip trailing whitespace spicyj authored Jun 2, 2011 129 d639176 small display changes for limits_1 spicyj authored Jul 14, 2011 130

If f(x) = \begin{cases} 131 d_cons & \text{if $x = a$} \\ 132 d_line & \text{otherwise} 133 \end{cases}, find \displaystyle \lim_{x \to a} f(x).

3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 134
135 graphInit({ 136 range: 10, 137 scale: 20, 138 tickStep: 1, e6cf910 Add some axis labels (close #459) spicyj authored Jul 27, 2011 139 labelStep: 1, 140 unityLabels: false, 141 labelFormat: function( s ) { return "\\small{" + s + "}"; }, 761c7b2 The *other* One True Way prevails (by decree of Sal) spicyj authored Jul 27, 2011 142 axisArrows: "<->" 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 143 }); 144 145 style({ 146 stroke: "#6495ed" 147 }, function() { 148 plot( function(x) { 149 return l_coef * x + l_cons; 150 }, [-10, 10] ); 151 152 circle( [a, limtoa], 4 / 20, { fill: "white" } ) 153 circle( [a, d_cons], 4 / 20, { fill: "#6495ed", stroke: "none" } ) 154 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 155
156

limtoa

157
158
• 0
• 159
• a
• 160
• d_cons
• 161
• l_coef
• 7149ebc replaced previous invocations of fraction with fractionReduce now tha… jruberg authored Jun 10, 2011 162
• fractionReduce(l_cons * -1, l_coef)
• 3601211 Rename nonzero random range function osnr authored May 23, 2011 163
• randRangeNonZero(-3, 3)
• 164
• randRangeNonZero(-3, 3)
• 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 165
• Does not exist.
• 166
167
168
6469103 Limits 1 improvements, closes #258 spicyj authored Jul 20, 2011 169
3601211 Rename nonzero random range function osnr authored May 23, 2011 170 randRangeNonZero(-3, 3) 171 randRangeNonZero(-3, 3) 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 172 floor(sqrt(abs((10 - q_cons) / q_lcoef))) 3601211 Rename nonzero random range function osnr authored May 23, 2011 173 randRangeNonZero(-1 * edge, edge) 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 174 function(x) { 175 return q_lcoef * Math.pow(x, 2) + q_cons; 176 } 177 curFunc(a) 178 limtoa 179 limtoa 180
181 6469103 Limits 1 improvements, closes #258 spicyj authored Jul 20, 2011 182

\displaystyle \lim_{x\toa} expr(["+", ["*", q_lcoef, ["^", "x", 2]], q_cons]) = {?}

3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 183
184 graphInit({ 185 range: 10, 186 scale: 20, 187 tickStep: 1, e6cf910 Add some axis labels (close #459) spicyj authored Jul 27, 2011 188 labelStep: 1, 189 unityLabels: false, 190 labelFormat: function( s ) { return "\\small{" + s + "}"; }, 761c7b2 The *other* One True Way prevails (by decree of Sal) spicyj authored Jul 27, 2011 191 axisArrows: "<->" 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 192 }); 193 194 style({ 195 stroke: "#6495ed" 196 }, function() { 197 plot( function(x) { 198 return q_lcoef * x * x + q_cons; 199 }, [-10, 10] ); 200 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 201
202

limtoa

203
204
• 0
• 205
• curFunc(0)
• 3601211 Rename nonzero random range function osnr authored May 23, 2011 206
• randRangeNonZero(-3, 3)
• 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 207
• q_cons
• 208
• q_cons * -1
• 209
• Does not exist.
• 210
211
d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 212
cf02179 Strip trailing whitespace spicyj authored Jun 2, 2011 213 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 214
215
216

What happens as we approach x = a from the left?

3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 217
218 line( [a - 2, 0], [a, 0], { 219 stroke: "#ff00af", 220 arrows: "->" 221 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 222
223
224
225 226
xa - 0.1a - 0.01a - 0.001
f(x)curFunc(a - 0.1).toFixed(4)curFunc(a - 0.01).toFixed(4)curFunc(a - 0.001).toFixed(4)
227 228 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 229 It looks like f(x) is approaching l_limtoa from the left. 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 230 231
232

When we approach x = a from the right, we get:

233 234
xa + 0.1a + 0.01a + 0.001
f(x)curFunc(a + 0.1).toFixed(4)curFunc(a + 0.01).toFixed(4)curFunc(a + 0.001).toFixed(4)
235 236 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 237 It looks like f(x) is approaching r_limtoa from the right. 238
239 line( [a + 2, 0], [a, 0], { 240 stroke: "#ff00af", 241 arrows: "->" 242 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 243
244 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 245

So the limit is limtoa.

0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 246 d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 247 248 4627f1f Move graph style stuff to the data-style attribute, so browsers don't… osnr authored May 25, 2011 249
Something went wrong with that request. Please try again.