# Khan/khan-exercises

Older
100644 158 lines (150 sloc) 5.87 KB
 c2abb10 Add exercise: Exploring mean and median beneater authored Nov 7, 2011 1 2 3 65eec09 Content-Type meta tag for libxml2 compatibility spicyj authored Jan 4, 2012 4 fc8628d Add exercise: Exploring standard deviation 1 beneater authored Jan 9, 2012 5 Exploring mean and median c2abb10 Add exercise: Exploring mean and median beneater authored Nov 8, 2011 6 7 8 9
10
11 -7 12 -1 * LOWER_BOUND 13 20 random() < 0.8 ? 10 : 5 21 22 roundTo( 1, randRangeNonZero( (LOWER_BOUND + 1) * 2, (UPPER_BOUND - 1) * 2 ) / 2 ) 23 24 25 ((POINTS / 2) * (MEDIAN + 0.5) + MEDIAN - 0.5 + (POINTS / 2 - 1) * LOWER_BOUND) / POINTS 26 27 28 ((POINTS / 2) * (MEDIAN - 0.5) + MEDIAN + 0.5 + (POINTS / 2 - 1) * UPPER_BOUND) / POINTS 29 30 roundTo( 1, randRangeNonZero( MIN_MEAN * 10, MAX_MEAN * 10 ) / 10 ) 31
32
33
34
35

Arrange the POINTS orange points on the number line so the 36 arithmetic mean is MEAN 37 and the median is MEDIAN. 38 The distance between adjacent tick marks is 1.

39
91
fc8628d Add exercise: Exploring standard deviation 1 beneater authored Jan 10, 2012 92
93
96
jQuery.map( graph.points, function( el ) { return el.coord[0]; } )
97
98 if ( roundTo( 1, mean( guess ) ) === MEAN && roundTo( 1, median( guess ) ) === MEDIAN ) { 99 return true; 100 } else if ( graph.moved ) { 101 return false; 102 } else { 103 return ""; 104 } 105
106
107 jQuery.each( guess, function( i, x ) { 108 onMovePoint( graph.points[i], x, 0 ); 109 }); 110 updateMeanAndMedian(); 111
112
any arrangement of the orange dots so that the mean and median are correct
c2abb10 Add exercise: Exploring mean and median beneater authored Nov 8, 2011 113
114 115
116

eb60e07 Grammar nit beneater authored Jan 3, 2012 117 The median is the middle number. In other words there are always as many points to the c2abb10 Add exercise: Exploring mean and median beneater authored Nov 8, 2011 118 right of the median as to the left. 119

120

121 Try dragging the points so that half of them are to the left of 122 MEDIAN 123 and half of them are to the right of 124 MEDIAN. 125 126 The two points in the middle should be the same distance from 127 MEDIAN. 128 129 130 The middle point should be at 131 MEDIAN. 132
133 136

137

138 As long as there are as many points to the left and to the right of the 139 median, the median will stay the same. But the arithmetic mean is calculated 140 using the value of every point. Try moving the points on either side of the 141 median closer and further from the median to see how the mean is affected. 142

143

144 There are a number of different ways to arrange the points so the mean is 145 MEAN 146 and the median is 147 MEDIAN. 148 151

152
153
154
155
156 157
Something went wrong with that request. Please try again.