Skip to content

# Khan/khan-exercises

Newer
Older
100644 250 lines (237 sloc) 12 KB
 d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 1 6469103 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 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 4 5 Limits 1 6 d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 7 190610b Retool framework, move Math and Graph logic out of khan-exercise.js a… jeresig authored May 18, 2011 8 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 9
10
11
12
13 randRangeNonZero(-3, 3) 14 floor(sqrt(abs(10 / q_lcoef))) 15 randRangeNonZero(-1 * edge, edge) 16 q_lcoef + 'x^2' 17 cleanMath('(x + ' + l_cons + ')') 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 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 27 \displaystyle\lim_{x\toa} \dfrac{quadraticLINE}{LINE} = {?} 28 29 graphInit({ 30 range: 10, 31 scale: 20, 32 tickStep: 1, 33 labelStep: 1, 34 unityLabels: false, 35 labelFormat: function( s ) { return "\\small{" + s + "}"; }, 36 axisArrows: "<->" 37 }); 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 38 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 39 style({ 40 stroke: "#6495ed" 41 }, function() { 42 plot( function(x) { 43 return q_lcoef * x * x; 44 }, [-10, 10] ); 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 45 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 46 circle( [a, limtoa], 4 / 20, { fill: "white" } ) 47 }); 48 49 limtoa 50 51 • 0 • 52 • randRangeNonZero(-3, 3) • 53 • randRangeNonZero(-3, 3) • 54 • q_lcoef • 55 • l_cons • 56 • curFunc(0) • 57 • Does not exist. • 58 59 60 61 62 randRangeNonZero(-5, 5) 63 randRangeNonZero(-7, 7) 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 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 75

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

76
77 graphInit({ 78 range: 10, 79 scale: 20, 80 tickStep: 1, 81 labelStep: 1, 82 unityLabels: false, 83 labelFormat: function( s ) { return "\\small{" + s + "}"; }, 84 axisArrows: "<->" 85 }); 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 86 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 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] ); 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 92 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 93 circle( [-abs_cons, -abs_coef], 4 / 20, { fill: "white" } ) 94 circle( [-abs_cons, abs_coef], 4 / 20, { fill: "white" } ) 95 }); 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
• 106
• randRangeNonZero(-3, 3)
• 107
• randRangeNonZero(-3, 3)
• 108
109
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.

111
112
113
114
115 randRangeNonZero(-3, 3) 116 randRangeNonZero(-4, 4) 117 randRangeNonZero(-7, 7) 118 expr(["+", ["*", l_coef, "x"], l_cons]) 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) 124 l_coef > 0 ? randRangeNonZero(a0, a1) : randRangeNonZero(a1, a0) 125 curFunc(a) 126 limtoa 127 limtoa 128
cf02179 Strip trailing whitespace spicyj authored Jun 2, 2011 129 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 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). 134 135 graphInit({ 136 range: 10, 137 scale: 20, 138 tickStep: 1, 139 labelStep: 1, 140 unityLabels: false, 141 labelFormat: function( s ) { return "\\small{" + s + "}"; }, 142 axisArrows: "<->" 143 }); 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 144 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 145 style({ 146 stroke: "#6495ed" 147 }, function() { 148 plot( function(x) { 149 return l_coef * x + l_cons; 150 }, [-10, 10] ); 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 151 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 152 circle( [a, limtoa], 4 / 20, { fill: "white" } ) 153 circle( [a, d_cons], 4 / 20, { fill: "#6495ed", stroke: "none" } ) 154 }); 155 156 limtoa 157 158 • 0 • 159 • a • 160 • d_cons • 161 • l_coef • 162 • fractionReduce(l_cons * -1, l_coef) • 163 • randRangeNonZero(-3, 3) • 164 • randRangeNonZero(-3, 3) • 165 • Does not exist. • 166 167 168 169 170 randRangeNonZero(-3, 3) 171 randRangeNonZero(-3, 3) 172 floor(sqrt(abs((10 - q_cons) / q_lcoef))) 173 randRangeNonZero(-1 * edge, edge) 174 function(x) { 175 return q_lcoef * Math.pow(x, 2) + q_cons; 176 } 177 curFunc(a) 178 limtoa 179 limtoa 180 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 181 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 182

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

183
184 graphInit({ 185 range: 10, 186 scale: 20, 187 tickStep: 1, 188 labelStep: 1, 189 unityLabels: false, 190 labelFormat: function( s ) { return "\\small{" + s + "}"; }, 191 axisArrows: "<->" 192 }); 3cd4d79 graphie for limits_1 spicyj authored Jul 14, 2011 193 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 194 style({ 195 stroke: "#6495ed" 196 }, function() { 197 plot( function(x) { 198 return q_lcoef * x * x + q_cons; 199 }, [-10, 10] ); 200 }); 201 202 limtoa 203 204 • 0 • 205 • curFunc(0) • 206 • randRangeNonZero(-3, 3) • 207 • q_cons • 208 • q_cons * -1 • 209 • Does not exist. • 210 211 212 cf02179 Strip trailing whitespace spicyj authored Jun 2, 2011 213 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 214
215
216

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

217
218 line( [a - 2, 0], [a, 0], { 219 stroke: "#ff00af", 220 arrows: "->" 221 }); 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 229 It looks like f(x) is approaching l_limtoa from the left. 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 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 }); 243
244 245

So the limit is limtoa.

246 247 d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 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.