# Khan/khan-exercises

Fetching contributors…
Cannot retrieve contributors at this time
237 lines (210 sloc) 11.1 KB
 Fractions on the number line 3
-3 3 randRangeExclude(-6, 6, [-1, 0, 1]) randRange(2, 18) NUMERATOR / DENOMINATOR LOWER_BOUND * abs(DENOMINATOR) UPPER_BOUND * abs(DENOMINATOR) NUMERATOR % DENOMINATOR (NUMERATOR - M_NUMERATOR) / DENOMINATOR (abs(SOLUTION) > 1 ? M_WHOLE + (SOLUTION < 0 ? fraction(M_NUMERATOR, -DENOMINATOR) : fraction(M_NUMERATOR, DENOMINATOR)) : fraction(NUMERATOR, DENOMINATOR)) M_WHOLE + (SOLUTION > 0 ? 1 : -1) fraction(NUMERATOR, DENOMINATOR) i18n._("orange dot")
0

Move the \orange{\text{ORANGE_DOT}} to \orange{NUMBER} on the number line.

graph.d = abs(DENOMINATOR); init({ range: [[START - 0.5 * graph.d, STOP + 0.5 * graph.d], [-1, 1]], scale: [70 / graph.d, 40] }); line([0, 0], [STOP + 1, 0 ], { arrows: ">" }); line([0, 0], [START - 1, 0 ], { arrows: "->" }); for (var x = LOWER_BOUND; x <= UPPER_BOUND; x++) { line([x * graph.d, -0.2], [x * graph.d, 0.2]); } style({ stroke: GREEN, strokeWidth: 3.5 }); line([START, -0.2], [START, 0.2]); line([STOP, -0.2], [STOP, 0.2]); line([0, -0.2], [0, 0.2]); label([START, -0.53], LOWER_BOUND, "center", { color: GREEN }); label([STOP, -0.53], UPPER_BOUND, "center", { color: GREEN }); label([0, -0.53], "0", "center", { color: GREEN }); addMouseLayer(); graph.movablePoint = addMovablePoint({ constraints: { constrainY: true }, snapX: 1 }); graph.movablePoint.onMove = function(x, y) { return [min(max(START, x), STOP), y]; };
graph.movablePoint.coord[0] / abs(DENOMINATOR)
if (guess === 0) { return ""; } return abs(SOLUTION - guess) < 0.001;
graph.movablePoint.setCoord([guess, 0]);
1

Move the \orange{\text{ORANGE_DOT}} to \orange{NUMBER} on the number line.

graph.d = abs(DENOMINATOR); init({ range: [[-5, 5], [START - 0.5 * graph.d, STOP + 0.5 * graph.d]], scale: [40, 60 / graph.d] }); line([0, 0], [0, STOP + 1], { arrows: ">" }); line([0, 0], [0, START - 1], { arrows: "->" }); for (var y = LOWER_BOUND; y <= UPPER_BOUND; y++) { line([-0.2, y * graph.d], [0.2, y * graph.d]); } style({ stroke: GREEN, strokeWidth: 3.5 }); line([-0.2, START], [0.2, START]); line([0.2, STOP], [0.2, STOP]); line([-0.2, 0], [0.2, 0]); label([-0.2, START], LOWER_BOUND, "left", { color: GREEN }); label([-0.2, STOP], UPPER_BOUND, "left", { color: GREEN }); label([-0.2, 0], "0", "left", { color: GREEN }); addMouseLayer(); graph.movablePoint = addMovablePoint({ constraints: { constrainX: true }, snapY: 1 }); graph.movablePoint.onMove = function(x, y) { return [x, min(max(START, y), STOP)]; };
graph.movablePoint.coord[1] / abs(DENOMINATOR)
if (guess === 0) { return ""; } return abs(SOLUTION - guess) < 0.001;
graph.movablePoint.setCoord([0, guess]);

Because \orange{NUMBER} is positive the orange dot will be to the right of 0.

Because \orange{NUMBER} is positive the orange dot will be above 0.

Because \orange{NUMBER} is negative the orange dot will be to the left of 0.

Because \orange{NUMBER} is negative the orange dot will be below 0.

Let's convert the improper fraction \orange{NUMBER} to a mixed number:

\orange{NUMBER} = \green{M_NUMBER}

\green{M_NUMBER} is between \blue{M_WHOLE} and \blue{NEXT_NUM} on the number line.

\green{M_NUMBER} is less than 1 so lies between \blue{M_WHOLE} and \blue{NEXT_NUM} on the number line.

\green{\dfrac{NUMERATOR}{-DENOMINATOR}} is less than 1 so \green{M_NUMBER} lies between \blue{M_WHOLE} and \blue{NEXT_NUM} on the number line.

style({ stroke: BLUE, strokeWidth: 3.5 }); if (ORIENTATION === 0) { line([M_WHOLE * graph.d, -0.2], [M_WHOLE * graph.d, 0.2]); line([NEXT_NUM * graph.d, -0.2], [NEXT_NUM * graph.d, 0.2]); label([M_WHOLE * graph.d, -0.53], M_WHOLE, "center", { color: BLUE }); label([NEXT_NUM * graph.d, -0.53], NEXT_NUM, "center", { color: BLUE }); } else { line([-0.2, M_WHOLE * graph.d], [0.2, M_WHOLE * graph.d]); line([-0.2, NEXT_NUM * graph.d], [0.2, NEXT_NUM * graph.d]); label([-0.2, M_WHOLE * graph.d], M_WHOLE, "left", { color: BLUE }); label([-0.2, NEXT_NUM * graph.d], NEXT_NUM, "left", { color: BLUE }); } graph.movablePoint.toFront();

\green{M_NUMBER} is \green{fraction(M_NUMERATOR, DENOMINATOR)} to the right of \blue{M_WHOLE} on the number line.

\green{M_NUMBER} is \green{fraction(-M_NUMERATOR, DENOMINATOR)} to the left of \blue{M_WHOLE} on the number line.

style({ stroke: GREEN, fill: GREEN, strokeWidth: 3.5, arrows: "->" }); line([M_WHOLE * graph.d, 0], [SOLUTION * graph.d, 0]); graph.movablePoint.visibleShape.toFront();

\green{M_NUMBER} is \green{fraction(M_NUMERATOR, DENOMINATOR)} above \blue{M_WHOLE} on the number line.

\green{M_NUMBER} is \green{fraction(-M_NUMERATOR, DENOMINATOR)} below \blue{M_WHOLE} on the number line.

style({ stroke: GREEN, fill: GREEN, strokeWidth: 3.5, arrows: "->" }); line([0, M_WHOLE * graph.d], [0, SOLUTION * graph.d]); graph.movablePoint.visibleShape.toFront();
if (ORIENTATION === 0) { label([SOLUTION * graph.d, -0.83], NUMBER, "center", { color: ORANGE }); graph.movablePoint.moveTo(SOLUTION * graph.d, 0); } else { label([0.2, SOLUTION * graph.d], NUMBER, "right", { color: ORANGE }); graph.movablePoint.moveTo(0, SOLUTION * graph.d); }

The orange number shows where \orange{NUMBER} is on the number line.