# Khan/khan-exercises

### Subversion checkout URL

You can clone with
or
.
Older
100644 188 lines (182 sloc) 8.063 kB
 d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 1 2 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
12 nonZeroRandomInt(-3, 3) 13 floor(sqrt(abs(10 / q_lcoef))) 14 nonZeroRandomInt(-1 * edge, edge) 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
25 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 26

190610b Retool framework, move Math and Graph logic out of khan-exercise.js a… jeresig authored May 18, 2011 27
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 28 plot('(' + quadratic + LINE + ')/' + LINE); 9c227ad Refine the definition of graphs, implement a basic API. Fixes #5. jeresig authored May 18, 2011 29 ASdot([a, limtoa], 4, "black", "white"); 30
190610b Retool framework, move Math and Graph logic out of khan-exercise.js a… jeresig authored May 18, 2011 31

limtoa

32
33
• 0
• 34
• nonZeroRandomInt(-3, 3)
• 35
• nonZeroRandomInt(-3, 3)
• 36
• q_lcoef
• 37
• l_cons
• 38
• curFunc(0)
• 39
• Does not exist.
• 40
d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 41
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 42
43
44 nonZeroRandomInt(-5, 5) 45 nonZeroRandomInt(-7, 7) 46 function(x) { 47 return x + abs_cons > 0 ? 48 abs_coef : 49 abs_coef * -1; 50 } 51 abs_cons * -1 52 curFunc(a) 53 abs_coef * -1 54 abs_coef 55
56 57

58
59 line([-11, abs_coef * -1], [-1 * abs_cons, abs_coef * -1]); 60 line([-1 * abs_cons, abs_coef], [11, abs_coef]); 61 62 ASdot([-1 * abs_cons, -1 * abs_coef], 4, "black", "white"); 63 ASdot([-1 * abs_cons, abs_coef], 4, "black", "white"); 64
65

Does not exist.

66
67
• 0
• 68
• a
• 69
• abs_cons
• 70
• abs_coef
• 71
• abs_coef * -1
• 72
• abs_coef * abs_coef
• 73
• abs_coef * abs_coef * -1
• 74
• nonZeroRandomInt(-3, 3)
• 75
• nonZeroRandomInt(-3, 3)
• 76
77
78

The limit as we approach from the left doesn't match the limit as we approach from the right, so \lim_{x\toa} doesn't exist.

79
80
81
82
83 nonZeroRandomInt(-3, 3) 84 nonZeroRandomInt(-4, 4) 85 nonZeroRandomInt(-7, 7) 86 cleanMath(l_coef + 'x + ' + l_cons) 87 function(x) { 88 return l_coef * x + l_cons; 89 } 90 ceil((-10 - l_cons)/l_coef) 91 floor((10 - l_cons)/l_coef) 92 l_coef > 0 ? nonZeroRandomInt(a0, a1) : nonZeroRandomInt(a1, a0) 93 curFunc(a) 94 limtoa 95 limtoa 96
97 98

\begin{align*} 99 \lim_{x\toa} f(x) & \\ 100 \text{where} \quad f(x) & = \left \{ 101 \begin{array}{1 1} 102 d_line &\quad \text{if} \quad x \neq a\\ 103 d_cons &\quad \text{if} \quad x = a\\ 104 \end{array} \right. 105 \end{align*}

106
107 plot(d_line); 108 ASdot([a, limtoa], 4, "black", "white"); 109 ASdot([a, d_cons], 4, "blue", "blue"); 110
111

limtoa

112
113
• 0
• 114
• a
• 115
• d_cons
• 116
• l_coef
• 117
• fraction(l_cons * -1, l_coef)
• 118
• nonZeroRandomInt(-3, 3)
• 119
• nonZeroRandomInt(-3, 3)
• 120
• Does not exist.
• 121
122
123
124
125 nonZeroRandomInt(-3, 3) 126 nonZeroRandomInt(-3, 3) 127 floor(sqrt(abs((10 - q_cons) / q_lcoef))) 128 nonZeroRandomInt(-1 * edge, edge) 129 function(x) { 130 return q_lcoef * Math.pow(x, 2) + q_cons; 131 } 132 curFunc(a) 133 limtoa 134 limtoa 135
136 137

138
139 plot(q_lcoef + 'x^2 + ' + q_cons); 140
141

limtoa

142
143
• 0
• 144
• curFunc(0)
• 145
• nonZeroRandomInt(-3, 3)
• 146
• q_cons
• 147
• q_cons * -1
• 148
• Does not exist.
• 149
150
d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 151
190610b Retool framework, move Math and Graph logic out of khan-exercise.js a… jeresig authored May 18, 2011 152 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 153
154
155

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

156
157 line([a > 0 ? 0 : a + a, 0], [a, 0]); 158
159
160
161 162
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)
163 164 165 It looks like f(x) is approaching l_limtoa from the left. 166
167 line([a, 0], [a, l_limtoa]); 168
169 170
171

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

172 173
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)
174 175 176 It looks like f(x) is approaching r_limtoa from the right. 177
178 line([a < 0 ? 0 : a + a, 0], [a, 0]); 179
180
181 line([a, 0], [a, r_limtoa]); 182
183 184

So \lim_{x\toa} = limtoa

185 d4e52bd I got something to draw! A chart is showing up now, rendering content… jeresig authored May 17, 2011 186 187 188
Something went wrong with that request. Please try again.