# Khan/khan-exercises

### Subversion checkout URL

You can clone with HTTPS or Subversion.

Older
100644 237 lines (224 sloc) 8.485 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 4 Limits 1 5 6 190610b Retool framework, move Math and Graph logic out of khan-exercise.js a… jeresig authored May 18, 2011 7 8
9
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 10
adcc771 Implement problem-specific var blocks. Fixes #3. jeresig authored May 19, 2011 11
3601211 Rename nonzero random range function osnr authored May 23, 2011 12 randRangeNonZero(-3, 3) adcc771 Implement problem-specific var blocks. Fixes #3. jeresig authored May 19, 2011 13 floor(sqrt(abs(10 / q_lcoef))) 3601211 Rename nonzero random range function osnr authored May 23, 2011 14 randRangeNonZero(-1 * edge, edge) adcc771 Implement problem-specific var blocks. Fixes #3. jeresig authored May 19, 2011 15 q_lcoef + 'x^2' 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 16 cleanMath('(x + ' + l_cons + ')') adcc771 Implement problem-specific var blocks. Fixes #3. jeresig authored May 19, 2011 17 function(x) { 18 return truncate_to_max(q_lcoef * Math.pow(x, 2), 4); 19 } 20 -1 * l_cons 21 curFunc(a) 22 limtoa 23 limtoa 24
cf02179 Strip trailing whitespace spicyj authored Jun 1, 2011 25 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 26

\displaystyle\lim_{x\toa} \dfrac{quadraticLINE}{LINE} = {?}

27
28 graphInit({ 29 range: 10, 30 scale: 20, 31 tickStep: 1, 32 axisArrows: "->" 33 }); 34 35 style({ 36 stroke: "#6495ed" 37 }, function() { 38 plot( function(x) { 39 return q_lcoef * x * x; 40 }, [-10, 10] ); 41 42 circle( [a, limtoa], 4 / 20, { fill: "white" } ) 43 }); 9c227ad Refine the definition of graphs, implement a basic API. Fixes #5. jeresig authored May 18, 2011 44
190610b Retool framework, move Math and Graph logic out of khan-exercise.js a… jeresig authored May 18, 2011 45

limtoa

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

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

3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 72
73 graphInit({ 74 range: 10, 75 scale: 20, 76 tickStep: 1, 77 axisArrows: "->" 78 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 79 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 80 style({ 81 stroke: "#6495ed" 82 }, function() { 83 line( [-11, abs_coef * -1], [-abs_cons, abs_coef * -1] ); 84 line( [-abs_cons, abs_coef], [11, abs_coef] ); 85 86 circle( [-abs_cons, -abs_coef], 4 / 20, { fill: "white" } ) 87 circle( [-abs_cons, abs_coef], 4 / 20, { fill: "white" } ) 88 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 89
90

Does not exist.

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

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 104
105
106
6469103 Limits 1 improvements, closes #258 spicyj authored Jul 20, 2011 107
3601211 Rename nonzero random range function osnr authored May 23, 2011 108 randRangeNonZero(-3, 3) 109 randRangeNonZero(-4, 4) 110 randRangeNonZero(-7, 7) 6469103 Limits 1 improvements, closes #258 spicyj authored Jul 20, 2011 111 expr(["+", ["*", l_coef, "x"], l_cons]) 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 112 function(x) { 113 return l_coef * x + l_cons; 114 } 115 ceil((-10 - l_cons)/l_coef) 116 floor((10 - l_cons)/l_coef) 6469103 Limits 1 improvements, closes #258 spicyj authored Jul 20, 2011 117 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 118 curFunc(a) 119 limtoa 120 limtoa 121
cf02179 Strip trailing whitespace spicyj authored Jun 2, 2011 122 d639176 small display changes for limits_1 spicyj authored Jul 14, 2011 123

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

3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 127
128 graphInit({ 129 range: 10, 130 scale: 20, 131 tickStep: 1, 132 axisArrows: "->" 133 }); 134 135 style({ 136 stroke: "#6495ed" 137 }, function() { 138 plot( function(x) { 139 return l_coef * x + l_cons; 140 }, [-10, 10] ); 141 142 circle( [a, limtoa], 4 / 20, { fill: "white" } ) 143 circle( [a, d_cons], 4 / 20, { fill: "#6495ed", stroke: "none" } ) 144 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 145
146

limtoa

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

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

3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 173
174 graphInit({ 175 range: 10, 176 scale: 20, 177 tickStep: 1, 178 axisArrows: "->" 179 }); 180 181 style({ 182 stroke: "#6495ed" 183 }, function() { 184 plot( function(x) { 185 return q_lcoef * x * x + q_cons; 186 }, [-10, 10] ); 187 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 188
189

limtoa

190
191
• 0
• 192
• curFunc(0)
• 3601211 Rename nonzero random range function osnr authored May 23, 2011 193
• randRangeNonZero(-3, 3)
• 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 194
• q_cons
• 195
• q_cons * -1
• 196
• Does not exist.
• 197
198
d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 199
cf02179 Strip trailing whitespace spicyj authored Jun 2, 2011 200 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 201
202
203

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

3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 204
205 line( [a - 2, 0], [a, 0], { 206 stroke: "#ff00af", 207 arrows: "->" 208 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 209
210
211
212 213
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)
214 215 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 216 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 217 218
219

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

220 221
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)
222 223 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 224 It looks like f(x) is approaching r_limtoa from the right. 225
226 line( [a + 2, 0], [a, 0], { 227 stroke: "#ff00af", 228 arrows: "->" 229 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 230
231 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 232

So the limit is limtoa.

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