# Khan/khan-exercises

Older
100644 189 lines (183 sloc) 9.36 KB
 54165fc Added comparing_absolute_values.html jpulgarin authored Aug 16, 2011 1 cde9e9f Re-run the exercises through the updated cleaner. jeresig authored Apr 24, 2013 2 3 0f0c630 Clean up the exercise files using the new cleaning utility. (II) cbhl authored Apr 16, 2013 4 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 5 Comparing absolute values ac1415e Use requirejs for module loading spicyj authored Mar 5, 2014 6 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 7 54165fc Added comparing_absolute_values.html jpulgarin authored Aug 17, 2011 32 33 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 34 35 88517a5 Add decimal and fraction questions to comparing absolute values petercollingridge authored Jul 3, 2015 36 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 37
2025730 Use nicer pipes and tidy up the hints a bit petercollingridge authored Jan 23, 2014 38 randFromArray([[1, 1], [1, 0], [0, 1]]) 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 39 randRange(-10, 10) 2025730 Use nicer pipes and tidy up the hints a bit petercollingridge authored Jan 23, 2014 40 (NUM_1 < 0) ? randRange(0, 10) : randRange(-10, -1) 88517a5 Add decimal and fraction questions to comparing absolute values petercollingridge authored Jul 3, 2015 41 ABS_1 ? "\\lvert" + NUM_1 + "\\rvert" : NUM_1 42 ABS_2 ? "\\lvert" + NUM_2 + "\\rvert" : NUM_2 2025730 Use nicer pipes and tidy up the hints a bit petercollingridge authored Jan 23, 2014 43 ABS_1 ? abs(NUM_1) : NUM_1 44 ABS_2 ? abs(NUM_2) : NUM_2 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 45 (function() { 46 if ( NUM_1_VALUE === NUM_2_VALUE ) { 47 return "="; 48 } 49 return NUM_1_VALUE < NUM_2_VALUE ? "<" : ">"; 50 })() 51
54165fc Added comparing_absolute_values.html jpulgarin authored Aug 17, 2011 52 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 53 54 Fill in the blank. 88517a5 Add decimal and fraction questions to comparing absolute values petercollingridge authored Jul 3, 2015 55 NUM_1_ABS ____ NUM_2_ABS 56 57 SOLUTION 58 59 • < • 60 • > • 61 • = • 62 63 64 65 66 randFromArray([[1, 1], [1, 0], [0, 1]]) 67 randRange(-99, 99) / 10 68 (NUM_1 < 0) ? randRange(0, 99) / 10 : randRange(-99, -1) / 10 69 ABS_1 ? "\\lvert" + NUM_1 + "\\rvert" : NUM_1 70 ABS_2 ? "\\lvert" + NUM_2 + "\\rvert" : NUM_2 71 ABS_1 ? abs(NUM_1) : NUM_1 72 ABS_2 ? abs(NUM_2) : NUM_2 73 (function() { 74 if ( NUM_1_VALUE === NUM_2_VALUE ) { 75 return "="; 76 } 77 return NUM_1_VALUE < NUM_2_VALUE ? "<" : ">"; 78 })() 79 80 81 82 Fill in the blank. 83 NUM_1_ABS ____ NUM_2_ABS 84 85 SOLUTION 86 87 • < • 88 • > • 89 • = • 90 91 92 93 94 95 randRangeNonZero(-9, 9) 96 (NUM_1 < 0) ? randRange(1, 9) : randRange(-9, -1) 97 98 randFromArray([[1, 1], [1, 0], [0, 1]]) 99 randFromArray(smallDenominators) 100 NUMER_1 / DENOM 101 NUMER_2 / DENOM 102 fractionReduce(NUMER_1, DENOM) 103 fractionReduce(NUMER_2, DENOM) 104 ABS_1 ? "\\left\\lvert" + NUM_1_STRING + "\\right\\rvert" : NUM_1_STRING 105 ABS_2 ? "\\left\\lvert" + NUM_2_STRING + "\\right\\rvert" : NUM_2_STRING 106 ABS_1 ? abs(NUMER_1) : NUMER_1 107 ABS_2 ? abs(NUMER_2) : NUMER_2 108 fractionReduce(NUM_1_VALUE, DENOM) 109 fractionReduce(NUM_2_VALUE, DENOM) 110 (function() { 111 if (NUM_1_VALUE === NUM_2_VALUE) { 112 return "="; 113 } 114 return NUM_1_VALUE < NUM_2_VALUE ? "<" : ">"; 115 })() 116 117 118 119 Fill in the blank. 120 NUM_1_ABS ____ NUM_2_ABS 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 121
122

SOLUTION

0f0c630 Clean up the exercise files using the new cleaning utility. (II) cbhl authored Apr 16, 2013 123
4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 124 • < • 125 • > • 126 • = • 127 88517a5 Add decimal and fraction questions to comparing absolute values petercollingridge authored Jul 3, 2015 128 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 129
2025730 Use nicer pipes and tidy up the hints a bit petercollingridge authored Jan 23, 2014 130
131

88517a5 Add decimal and fraction questions to comparing absolute values petercollingridge authored Jul 3, 2015 132 The absolute value of a number is its distance from zero. 133 The distance from 0 to NUM_1_STRING 134 is NUM_1_VALUE_STRING so: 2025730 Use nicer pipes and tidy up the hints a bit petercollingridge authored Jan 23, 2014 135

88517a5 Add decimal and fraction questions to comparing absolute values petercollingridge authored Jul 3, 2015 136

2025730 Use nicer pipes and tidy up the hints a bit petercollingridge authored Jan 23, 2014 137
138 drawNumberLine(NUM_1); 139
4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 140 2025730 Use nicer pipes and tidy up the hints a bit petercollingridge authored Jan 23, 2014 141 142 88517a5 Add decimal and fraction questions to comparing absolute values petercollingridge authored Jul 3, 2015 143 The absolute value of a number is its distance from zero. 144 The distance from 0 to NUM_2_STRING 145 is NUM_2_VALUE_STRING so: 2025730 Use nicer pipes and tidy up the hints a bit petercollingridge authored Jan 23, 2014 146 88517a5 Add decimal and fraction questions to comparing absolute values petercollingridge authored Jul 3, 2015 147 \qquadNUM_2_ABS = NUM_1_VALUE_STRING 2025730 Use nicer pipes and tidy up the hints a bit petercollingridge authored Jan 23, 2014 148 149 drawNumberLine(NUM_2); 150 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 151
88517a5 Add decimal and fraction questions to comparing absolute values petercollingridge authored Jul 3, 2015 152

153 Is NUM_1_VALUE_STRING less than, greater than, 154 or equal to NUM_2_VALUE_STRING? 155

156

NUM_1_VALUE_STRING SOLUTION NUM_2_VALUE_STRING

157

So, NUM_1_ABS SOLUTION NUM_2_ABS.

158
159
160
161
162
163

164 The absolute value of a number is its distance from zero. 165 The distance from 0 to NUM_1 is NUM_1_VALUE so: 166

167

168
169 drawNumberLine(NUM_1); 170
171
172
173

174 The absolute value of a number is its distance from zero. 175 The distance from 0 to NUM_2 is NUM_2_VALUE so: 176

177

179 drawNumberLine(NUM_2); 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 180 181 88517a5 Add decimal and fraction questions to comparing absolute values petercollingridge authored Jul 3, 2015 182 Is NUM_1_VALUE less than, greater than, or equal to NUM_2_VALUE? 183 NUM_1_VALUE SOLUTION NUM_2_VALUE 184 So, NUM_1_ABS SOLUTION NUM_2_ABS. 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 185