# Khan/khan-exercises

Older
100644 189 lines (182 sloc) 7.95 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 jeresig authored May 19, 2011 11
3601211 Rename nonzero random range function osnr authored May 23, 2011 12 randRangeNonZero(-3, 3) adcc771 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 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 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

4627f1f Move graph style stuff to the data-style attribute, so browsers don't… osnr authored May 25, 2011 27
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 28 plot('(' + quadratic + LINE + ')/' + LINE); 9c227ad 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
• 3601211 Rename nonzero random range function osnr authored May 23, 2011 34
• randRangeNonZero(-3, 3)
• 35
• randRangeNonZero(-3, 3)
• 190610b Retool framework, move Math and Graph logic out of khan-exercise.js a… jeresig authored May 18, 2011 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
3601211 Rename nonzero random range function osnr authored May 23, 2011 44 randRangeNonZero(-5, 5) 45 randRangeNonZero(-7, 7) 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 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

4627f1f Move graph style stuff to the data-style attribute, so browsers don't… osnr authored May 25, 2011 58
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 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
• 3601211 Rename nonzero random range function osnr authored May 23, 2011 74
• randRangeNonZero(-3, 3)
• 75
• randRangeNonZero(-3, 3)
• 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 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
3601211 Rename nonzero random range function osnr authored May 23, 2011 83 randRangeNonZero(-3, 3) 84 randRangeNonZero(-4, 4) 85 randRangeNonZero(-7, 7) 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 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) 3601211 Rename nonzero random range function osnr authored May 23, 2011 92 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 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*}

4627f1f Move graph style stuff to the data-style attribute, so browsers don't… osnr authored May 25, 2011 106
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 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)
• 3601211 Rename nonzero random range function osnr authored May 23, 2011 118
• randRangeNonZero(-3, 3)
• 119
• randRangeNonZero(-3, 3)
• 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 120
• Does not exist.
• 121
122
123
124
3601211 Rename nonzero random range function osnr authored May 23, 2011 125 randRangeNonZero(-3, 3) 126 randRangeNonZero(-3, 3) 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 127 floor(sqrt(abs((10 - q_cons) / q_lcoef))) 3601211 Rename nonzero random range function osnr authored May 23, 2011 128 randRangeNonZero(-1 * edge, edge) 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 129 function(x) { 130 return q_lcoef * Math.pow(x, 2) + q_cons; 131 } 132 curFunc(a) 133 limtoa 134 limtoa 135
136 137

4627f1f Move graph style stuff to the data-style attribute, so browsers don't… osnr authored May 25, 2011 138
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 139 plot(q_lcoef + 'x^2 + ' + q_cons); 140
141

limtoa

142
143
• 0
• 144
• curFunc(0)
• 3601211 Rename nonzero random range function osnr authored May 23, 2011 145
• randRangeNonZero(-3, 3)
• 0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 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?

4627f1f Move graph style stuff to the data-style attribute, so browsers don't… osnr authored May 25, 2011 156
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 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. 4627f1f Move graph style stuff to the data-style attribute, so browsers don't… osnr authored May 25, 2011 166
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 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. 4627f1f Move graph style stuff to the data-style attribute, so browsers don't… osnr authored May 25, 2011 177
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 178 line([a < 0 ? 0 : a + a, 0], [a, 0]); 179
4627f1f Move graph style stuff to the data-style attribute, so browsers don't… osnr authored May 25, 2011 180
0ac33f7 Finish implementing the Limits 1 exercise. Add some table formatting … jeresig authored May 19, 2011 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 4627f1f Move graph style stuff to the data-style attribute, so browsers don't… osnr authored May 25, 2011 188
Something went wrong with that request. Please try again.