Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

126 lines (117 sloc) 7.793 kb
<!DOCTYPE html>
<html data-require="math math-format expressions graphie interactive">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Graphs of inequalities</title>
<script src="../khan-exercise.js"></script>
<style>
#answer_area input[type=text] {
width: 30px;
}
</style>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="graphtoeq">
<div class="vars">
<var id="SLOPE_FRAC">reduce( randRangeNonZero( -5, 5 ), randRange( 1, 5 ) )</var>
<var id="YINT">randRangeNonZero( max( -10, -10 - SLOPE_FRAC[0] ), min( 10, 10 - SLOPE_FRAC[0] ) )</var>
<var id="SLOPE">SLOPE_FRAC[0] / SLOPE_FRAC[1]</var>
<var id="PRETTY_SLOPE">SLOPE === 1 ? "" : ( SLOPE === -1 ? "-" : fraction( SLOPE_FRAC[0], SLOPE_FRAC[1], true, true ) )</var>
<var id="MULT">randRangeNonZero( -3, 3 )</var>
<var id="A">SLOPE_FRAC[0] * -MULT</var>
<var id="B">SLOPE_FRAC[1] * MULT</var>
<var id="C">SLOPE_FRAC[1] * YINT * MULT</var>
<var id="STD_FORM">randFromArray([ true, false ])</var>
<var id="COMP">randFromArray([ "&lt;", "&gt;", "&le;", "&ge;" ])</var>
<var id="STD_FORM_COMP">B &lt; 0 ? { "&lt;": "&gt;", "&gt;": "&lt;", "&le;": "&ge;", "&ge;": "&le;" }[ COMP ] : COMP</var>
<var id="LESS_THAN">COMP === "&lt;" || COMP === "&le;"</var>
<var id="INCLUSIVE">COMP === "&ge;" || COMP === "&le;"</var>
<var id="X1">SLOPE_FRAC[1]</var>
<var id="Y1">YINT + SLOPE_FRAC[0]</var>
<var id="X2">-SLOPE_FRAC[1]</var>
<var id="Y2">YINT - SLOPE_FRAC[0]</var>
<var id="ORI_IN">(YINT &lt; 0 &amp;&amp; !LESS_THAN) || (YINT &gt; 0 &amp;&amp; LESS_THAN)</var>
</div>
<p class="question">What is the inequality represented by this graph?</p>
<div class="problem">
<div class="graphie" id="grid">
graphInit({
range: 11,
scale: 20,
axisArrows: "&lt;-&gt;",
tickStep: 1,
labelStep: 1,
gridOpacity: 0.05,
axisOpacity: 0.2,
tickOpacity: 0.4,
labelOpacity: 0.5
});
label( [ 0, -11 ], "y", "below" );
label( [ 11, 0 ], "x", "right" );
var dash = INCLUSIVE ? "" : "- ";
style({ stroke: BLUE, strokeWidth: 2, strokeDasharray: dash }, function() {
line( [ -11, -11 * SLOPE + YINT ], [ 11, 11 * SLOPE + YINT ] ).toBack();
});
graph.shadeEdge = (LESS_THAN ? 11 &lt; YINT : 11 &gt; YINT) ? 11: -11;
style({ fill: BLUE, stroke: null, opacity: KhanUtil.FILL_OPACITY }, function() {
graph.shading = path([ [ 11, graph.shadeEdge ], [ 11, 11 * SLOPE + YINT ], [ -11, -11 * SLOPE + YINT ], [ -11, graph.shadeEdge ] ]);
});
</div>
</div>
<div class="solution" data-type="multiple">
<p class="short"><code>y</code><span class="sol" data-type="list" data-choices="['', '&lt;', '&le;', '&gt;', '&ge;']"><var>COMP</var></span>
<span class="sol" data-fallback="1"><var>SLOPE</var></span><code>\space x + </code>
<span class="sol"><var>YINT</var></span></p>
</div>
<div class="hints">
<p>
To find the equation of a linear inequality you should first find the equation of the line that forms the boundary of the solution set.
This line is shown on the graph above.
</p>
<p>
One way to find the equation of this line is to choose two points on the line and find the slope and y-intercept from there.
Two points on this line are <code>(<var>X1</var>,<var>Y1</var>)</code> and <code>(<var>X2</var>,<var>Y2</var>)</code>.
</p>
<div>
<p>Substitute both points into the equation for the slope of a line.</p>
<p><code>m = \dfrac{<var>Y2</var> - <var>negParens(Y1)</var>}{<var>X2</var> - <var>negParens(X1)</var>} = <var>fractionReduce( Y2 - Y1, X2 - X1 )</var></code></p>
</div>
<p>To find <code>b</code>, we can substitute in either of the two points into the equation with solved slope.</p>
<div>
<p>Using the first point <code>(<var>X1</var>, <var>Y1</var>)</code>, substitute <code>y = <var>Y1</var></code> and <code>x = <var>X1</var></code>:</p>
<p><code><var>Y1</var> = (<var>fractionReduce( Y2 - Y1, X2 - X1 )</var>)(<var>X1</var>) + b</code></p>
<p><code>b = <var>Y1</var> - <var>fractionReduce( X1 * ( Y2 - Y1 ), X2 - X1 )</var> = <var>fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )</var></code></p>
</div>
<p>
The equation of the line is <code>y = <var>( SLOPE === -1 ? "-" : ( SLOPE === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + <var>fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )</var></code><span data-if="abs( SLOPE ) === 1"> (the value of <code>m</code> is <code><var>SLOPE</var></code>)</span>.
</p>
<p>
Now that we have the equation for the boundary line, we need to decide which inequality sign to use.
</p>
<p>
If we pick a point on the line, let's say <code>(<var>X1</var>,<var>Y1</var>)</code>, we can see that points <var>LESS_THAN ? "below" : "above"</var> that point are all shaded in. These are the points where <code>x = <var>X1</var> </code> but <code>y</code> is
<var> LESS_THAN ? "less than" : "greater than" </var> <var> Y1 </var>. So we should use a <var>LESS_THAN ? "&lt; or &le;" : "&gt; or &ge;" </var> sign.
</p>
<div>
Another way to see this is to try plugging in a point. The easiest point to plug in is <code>(0,0)</code>:
<p><code>y \; ? \; <var>( SLOPE === -1 ? "-" : ( SLOPE === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 )))</var> x + <var>fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )</var></code></p>
<p><code>0 \; ? \; <var>( SLOPE === -1 ? "-1*" : ( SLOPE === 1 ? "" : fractionReduce( Y2 - Y1, X2 - X1 ) + "*"))</var> 0 + <var>fractionReduce( Y1 * (X2 - X1) - X1 * ( Y2 - Y1 ), X2 - X1 )</var></code></p>
Since <code>(0,0)</code> is <var> ORI_IN ? "" : "not"</var> in the shaded area, this expression must be <var> ORI_IN ? "true" : "false"</var> So, the ? must be either <var>LESS_THAN ? "&lt; or &le;" : "&gt; or &ge;" </var>.
</br>
</div>
<p>
The line of the graph is <var>INCLUSIVE ? "solid" : "dashed"</var>, so the points on the boundary are <var>INCLUSIVE ? "" : "not"</var>
in the set of solutions for this inequality.
</p>
<p>
So, we choose the <var>COMP</var> sign, and the final inequality is
<code>y <var>COMP</var> <var>PRETTY_SLOPE</var> x + <var>YINT</var></code>.
</p>
</div>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.