randRangeNonZero(-3, 3) randRangeNonZero(-3, 3) randRangeNonZero(-3, 3) function(a) { return (a === 1) ? "" : (a === -1) ? "-" : a; } [SIGNIFY(A), SIGNIFY(B), SIGNIFY(C)] randFromArray([ [function(x) { return B * x + C; }, BSHOW + " x + " + C], [function(x) { return B / 2 * x * x + A * x + C; }, ((B === 2) ? "" : (B === -2) ? "-" : (B / 2)) + " x^2 + " + ASHOW + " x + " + C], [function(x) { return B * sin(C * x / Math.PI) + A; }, BSHOW + " \\sin\\left(" + CSHOW + " x / \\pi\\right) + " + A], [function(x) { return B * pow(Math.E, C * x / 3) + A; }, BSHOW + "e^{" + ((abs(C) === 3) ? SIGNIFY(C/3) + "x" : CSHOW + " x / 3") + "} + " + A] ]) (function() { var xs = chooseXValues(FUNC, 1); if (xs.length >= 5) { return sortNumbers(shuffle(xs, 5)); } else { xs = chooseXValues(FUNC, 2); return sortNumbers(shuffle(xs, 5)); } })()
0.5

Graphed below is a function of `x`. Create a table of values for the function, estimating their values to the nearest `CORRECTOFFSET`. Enter at least `5` different points.

graphInit({ range: 10, scale: 20, tickStep: 1, labelStep: 1, unityLabels: false, labelFormat: function(s) { return "\\small{" + s + "}"; }, axisArrows: "<->" }); label([0, 10], "y", "above"); label([10, 0], "x", "right"); plot(FUNC, [-10, 10], { stroke: BLUE });

`x` | `y`

(function(){ var guess = []; $(".ttable tr").each(function() { var input = []; $(this).children().each(function() { input.push($(this).children().val()); }); guess.push(input); }); return guess; })()
var attempted = 0; var correct = 0; var xs = []; var i = 0; var validatePoint = Khan.answerTypes.predicate.createValidatorFunctional(function(x, maxError) { var validateY = Khan.answerTypes.predicate.createValidatorFunctional(function(y, maxError) { if (abs(FUNC(x) - y) < maxError) { correct += 1; xs.push(x); return true; } }, {forms: 'decimal', inexact: true, maxError: maxError}); var result = validateY(guess[i][1]); return result.correct; }, {forms: 'decimal', inexact: true, maxError: CORRECTOFFSET}); for (i = 0; i < 8; ++i) { if ($.trim(guess[i][0]) !== "" && $.trim(guess[i][1]) !== "") { attempted += 1; validatePoint(guess[i][0]); } } if (attempted < 5) { return $._("You must enter 5 or more points"); } xs = KhanUtil.sortNumbers(xs); var different = 1; for (var i = 0; i < correct - 1; ++i) { if (xs[i + 1] - xs[i] >= 0.5) { different += 1; } } return different === attempted;

You can look at a function in many different ways, including by its equation, its graph, and by a table. Here, we have the graph of a function, and we want to identify some input-output pairs to write in a table.

To represent the function as a table, take any five points on the graph, and list them in the table.

For example, we can look at the point with an `x`-value of `EXAMPLES[0]`.

The `y`-value at this point is `round(2 * FUNC(EXAMPLES[0])) / 2`, which we find from the graph.

line([EXAMPLES[0], -11], [EXAMPLES[0], 11], { strokeWidth: 1, stroke: ORANGE }); circle([EXAMPLES[0], FUNC(EXAMPLES[0])], 0.2, { stroke: ORANGE, fill: ORANGE });

To record this in our table, put `EXAMPLES[0]` in the `x` column, and `round(2 * FUNC(EXAMPLES[0])) / 2` in the `y` column.

We can do this with `4` other `x`-values, such as `EXAMPLES[1]`, `EXAMPLES[2]`, `EXAMPLES[3]`, and `EXAMPLES[4]`.

We can find the `y`-values at these points by finding them on the graph as well.

for (var i = 1; i < 5; ++i) { line([EXAMPLES[i], -11], [EXAMPLES[i], 11], { strokeWidth: 1, stroke: ORANGE }); circle([EXAMPLES[i], FUNC(EXAMPLES[i])], 0.2, { stroke: ORANGE, fill: ORANGE }); }

From this, five points on the graph are:

`(x, round(FUNC(x) * 2) / 2)`

Graph the function that is defined by the table below.

`x` | `y`
`x+"\\hphantom{.0}"` | `(function() { var y = FUNC(x); var str = localeToFixed(roundToNearest(0.5, y), 1); if (Math.abs(KhanUtil.roundToNearest(1.0, y) - y) < 0.25) { str = str.replace(/(.{2})$/, "\\hphantom{$1}"); } return str; })()`

graphInit({ range: 10, scale: 20, tickStep: 1, labelStep: 1, unityLabels: false, labelFormat: function(s) { return "\\small{" + s + "}"; }, axisArrows: "<->" }); label([0, 10], "y", "above"); label([10, 0], "x", "right"); addMouseLayer(); graph.points = []; var drawn = false; graph.graphFunc = function() { if (!drawn) { drawn = true; var func = plot(FUNC, [-10, 10], { stroke: ORANGE, opacity: 0.0 }); func.animate({ opacity: 1.0 }, 800); } _.invoke(graph.points, "toFront"); }; graph.checkAnswer = function() { var used = [false, false, false, false, false]; _.each(EXAMPLES, function(x) { var y = roundToNearest(0.5, FUNC(x)); var done = false; _.each(graph.points, function(pt, i) { if (!done) { var coord = pt.coord; if (coord[0] === x && coord[1] === y) { used[i] = true; done = true; } } }); }); return _.all(used, _.identity); }; graph.moved = false; graph.checkPoints = function() { if (graph.checkAnswer()) { graph.graphFunc(); } graph.moved = true; return true; }; for (var i = 0; i < 5; ++i) { graph.points.push(addMovablePoint({ coord: [2 * i - 4, 0], snapX: 0.5, snapY: 0.5, onMoveEnd: graph.checkPoints })); }
[ graph.moved, graph.checkAnswer(), _.pluck(graph.points, "coord") ]
if (!guess[0]) { return ""; } else { return guess[1]; }
_.each(graph.points, function(pt, i) { pt.setCoord(guess[2][i]); });

You can look at a function in many different ways, including by its equation, its graph, and by a table. Here the input-output pairs are given in a table, and we can draw the graph of the function by plotting the corresponding points.

To represent the function as a graph, take all the points listed in the table, and plot them on the coordinate plane.

For example, let's look at the point `(EXAMPLES[0], roundToNearest(0.5, FUNC(EXAMPLES[0])))` .

We need to move one of the points to this position to represent plotting it on the graph.

var endpt = [EXAMPLES[0], roundToNearest(0.5, FUNC(EXAMPLES[0]))]; line([-4, 0], endpt, { arrows: "->" }); graph.points[0].moveTo(endpt[0], endpt[1]); graph.points[0].toFront();

Now, plot the remaining four points by placing the remaining points on the pink crosses.

for (var i = 1; i < 5; ++i) { var x = EXAMPLES[i]; var y = roundToNearest(0.5, FUNC(x)); line([x - 0.5, y - 0.5], [x + 0.5, y + 0.5], { stroke: PINK }); line([x + 0.5, y - 0.5], [x - 0.5, y + 0.5], { stroke: PINK }); _.invoke(graph.points, "toFront"); }
randFromArray([ [function(x) { return B * x + C; }, BSHOW + " x + " + C], [function(x) { return B / 2 * x * x + A * x + C; }, ((B === 2) ? "" : (B === -2) ? "-" : (B / 2)) + " x^2 + " + ASHOW + " x + " + C] ]) (function() { var xs = chooseXValues(FUNC, 1); if (xs.length >= 5) { return sortNumbers(shuffle(xs, 5)); } else { xs = chooseXValues(FUNC, 2); return sortNumbers(shuffle(xs, 5)); } })() 0.01

Create a table with at least five different points in it created from the function. Enter the values in the table as decimals.

`y = FUNCSHOW`

You can look at a function in many different ways, including by its equation, its graph, and by a table. Here, we have an equation, and in order to see more clearly how the function acts at few points, we are going to record information about it in a table.

To represent it as a table, pick some `x` values to plug into the equation, and record that `x` and the result of plugging it into the equation in the table.

For example, try plugging in `EXAMPLES[0]` to the equation.

When `x = EXAMPLES[0]`, `y = roundToNearest(0.1, FUNC(EXAMPLES[0]))`. Record this in the table by putting `EXAMPLES[0]` in the `x` column, and `roundToNearest(0.1, FUNC(EXAMPLES[0]))` in the corresponding `y` column.

Now, choose four more `x` values to plug into the equation. Let's try the numbers `EXAMPLES[1]`, `EXAMPLES[2]`, `EXAMPLES[3]`, and `EXAMPLES[4]`.

By plugging these values into the equation, we get:

`x = x, y = roundToNearest(0.1, FUNC(x))`