Fetching contributors…
Cannot retrieve contributors at this time
160 lines (153 sloc) 7.7 KB
<!DOCTYPE html>
<html data-require="math math-format word-problems expressions graphie">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Converting between slope-intercept and standard form</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="standard-to-slope">
<div class="vars">
<var id="A">randRangeNonZero( -5, 5 )</var>
<var id="B">randRangeNonZero( -5, 5 )</var>
<var id="C">randRangeNonZero( -5, 5 )</var>
<var id="SLOPE">-1 * A / B</var>
<var id="Y_INTERCEPT">C / B</var>
</div>
<p class="question">Convert the following equation from standard form to slope intercept form.</p>
<p>In other words, if the equation is rewritten to look like <code>y = mx + b</code>, what are the values of <code>m</code> and <code>b</code>?</p>
<p><code><var>expr([ "*", A, "x"])</var> + <var>expr([ "*", B, "y" ])</var> = <var>C</var></code></p>
<div class="solution" data-type="multiple">
<p><code>m</code> = <span class="sol"><var>SLOPE</var></span></p>
<p><code>b</code> = <span class="sol"><var>Y_INTERCEPT</var></span></p>
</div>
<div class="hints">
<div>
<p>Move the <code>x</code> term to the other side of the equation.</p>
<p><code><var>expr([ "*", B, "y" ])</var> = <var>expr([ "*", -1 * A, "x"])</var> + <var>C</var></code></p>
</div>
<div data-if="B !== 1">
<p>Divide both sides by <code><var>B</var></code>.</p>
<p><code>y = <span data-if="abs( SLOPE ) !== 1"><var>fractionReduce( -1 * A, B)</var></span><span data-if="SLOPE === -1">-</span>x + <var>fractionReduce( C, B )</var></code></p>
</div>
<div>
<p>Inspecting the equation in slope intercept form, we see the following.</p>
<p><code>\begin{align*}m &amp;= <var>fractionReduce( -1 * A, B)</var>\\
b &amp;= <var>fractionReduce( C, B )</var>\end{align*}</code></p>
</div>
<div>
<p>Behold! The magic of math, that both equations could represent the same line!</p>
<div class="graphie" id="grid">
graphInit({
range: 10,
scale: 20,
axisArrows: "&lt;-&gt;",
tickStep: 1,
labelStep: 1
});
style({ stroke: BLUE, fill: BLUE });
plot(function( x ) {
return x * SLOPE + Y_INTERCEPT;
}, [ -10, 10 ]);
</div>
</div>
</div>
</div>
<div id="slope-to-standard">
<div class="vars">
<var id="A">randRange(-5, 5)</var>
<var id="C">randRangeNonZero(-5, 5)</var>
<var id="B" data-ensure="getGCD(A, B) === 1 || getGCD(A, C) === 1">randRange(1, 5)</var>
<var id="SLOPE">-A / B</var>
<var id="Y_INTERCEPT">C / B</var>
</div>
<p class="question">Convert the following equation from slope intercept form to standard form.</p>
<p><code>
y = <span data-if="A !== 0"><var>coefficient(fractionReduce(-A, B))</var>x + </span>
<var>fractionReduce(C, B)</var>
</code></p>
<p>
In other words, what are the values of
<code>A</code>, <code>B</code>, and <code>C</code>
if the equation is rewritten to look like
<code>\blue{A}x + \green{B}y = \pink{C}</code>?
</p>
<p>
<em>Note that <code>A</code>, <code>B</code>, and <code>C</code> should be integers.</em>
</p>
<div class="solution" data-type="set">
<div class="set-sol" data-type="multiple">
<span class="sol"><var>A</var></span>
<span class="sol"><var>B</var></span>
<span class="sol"><var>C</var></span>
</div>
<div class="set-sol" data-type="multiple">
<span class="sol"><var>-A</var></span>
<span class="sol"><var>-B</var></span>
<span class="sol"><var>-C</var></span>
</div>
<div class="input-format">
<div class="entry" data-type="multiple">
<p><code>A</code> = <span class="sol"></span></p>
<p><code>B</code> = <span class="sol"></span></p>
<p><code>C</code> = <span class="sol"></span></p>
</div>
</div>
</div>
<div class="hints">
<div data-if="SLOPE !== 0">
<p>Move the <code>x</code> term to the same side as the <code>y</code> term.</p>
<p><code><var>coefficient(fractionReduce(A, B))</var>x + y = <var>fractionReduce(C, B)</var></code></p>
</div>
<div data-if="B !== 1">
<p>To get integers, multiply all the terms by <code><var>B</var></code>.</p>
<p><code>
<span data-if="A !== 0"><var>coefficient(A)</var>x + </span>
<var>B</var>y = <var>C</var>
</code></p>
</div>
<div data-if="SLOPE === 0 && B === 1">
<p>Since the slope is <code>0</code> and there is no <code>x</code> term, the equation is already in slope intercept form.</p>
<p><code>y = <var>Y_INTERCEPT</var></code></p>
</div>
<div>
<p>
So we have <code>\blue{<var>A</var>}</code>
<span data-if="isSingular(abs(A))"> lot of </span>
<span data-else=""> lots of </span>
<code>x</code>, <code>\green{<var>B</var>}</code>
<span data-if="isSingular(abs(B))"> lot of </span>
<span data-else=""> lots of </span>
<code>y</code>, and a <code>\pink{<var>C</var>}</code>.
</p>
<p><code>\blue{<var>A</var>}x + \green{<var>B</var>}y = \pink{<var>C</var>}</code></p>
</div>
<p><code>\begin{align*}
\blue{A} &amp;= \blue{<var>A</var>}\\
\green{B} &amp;= \green{<var>B</var>}\\
\pink{C} &amp;= \pink{<var>C</var>}\end{align*}
</code></p>
<div>
<p>Behold! The magic of math, that both equations could represent the same line!</p>
<div class="graphie" id="grid">
graphInit({
range: 10,
scale: 20,
axisArrows: "&lt;-&gt;",
tickStep: 1,
labelStep: 1
});
style({ stroke: BLUE, fill: BLUE });
plot(function( x ) {
return x * SLOPE + Y_INTERCEPT;
}, [ -10, 10 ]);
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>