Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

150 lines (128 sloc) 8.282 kB
<!DOCTYPE html>
<html data-require="math math-format rational-expressions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Solving rational equations 1</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="X">randVar()</var>
<var id="SIGN">rand(2) ? 1 : -1</var>
</div>
<p class="problem">Solve for <code><var>X</var></code>,</p>
<div class="problems">
<div id="integer">
<div class="vars" data-ensure="DENOMINATOR.evaluate(FINALCONST / FINALCOEFF) !== 0">
<var id="NUMERCOEFF">NUMERCONST &lt; 1 ? randRange(1, 5) : randRange(0, 5)</var>
<div data-ensure="SIGN * NUMERCOEFF !== CONSTANT * DENOMCOEFF">
<var id="CONSTANT">randRange(2, 10)</var>
<var id="DENOMCOEFF">randRangeWeighted(1, 5, 1, 0.25)</var>
<var id="DENOMCONST">randRangeWeighted(-10, 10, 0, 0.25)</var>
<var id="NUMERCONST" data-ensure="DENOMCONST !== NUMERCONST">randRange(-10, 10)</var>
</div>
<var id="NUMERATOR">new RationalExpression([[NUMERCOEFF, X], [NUMERCONST]])</var>
<var id="DENOMINATOR">new RationalExpression([[DENOMCOEFF, X], [DENOMCONST]])</var>
<var id="PRODUCT">DENOMINATOR.multiply(CONSTANT)</var>
<var id="FINALCONST">DENOMCONST * CONSTANT - SIGN * NUMERCONST</var>
<var id="FINALCOEFF">SIGN * NUMERCOEFF - DENOMCOEFF * CONSTANT</var>
</div>
<p class="question"><code><span data-if="SIGN === -1">-</span>
\dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>} = <var>CONSTANT</var></code>
</p>
<div class="hints" data-apply="appendContents">
<div data-if="DENOMCONST !== 0">
<p><code>
<span data-if="SIGN === -1">-(<var>NUMERATOR</var>)</span>
<span data-else=""><var>NUMERATOR</var></span>
= <var>CONSTANT</var>(<var>DENOMINATOR</var>)
</code></p>
</div>
<div>
<p data-if="SIGN === -1"><code>-(<var>NUMERATOR</var>) = <var>PRODUCT</var></code></p>
<p><code><var>NUMERATOR.multiply(SIGN)</var> = <var>PRODUCT</var></code></p>
</div>
<div data-if="SIGN * NUMERCOEFF - CONSTANT * DENOMCOEFF > 0">
<p><code><var>new RationalExpression([[FINALCOEFF, X], SIGN * NUMERCONST])</var> = <var>DENOMCONST * CONSTANT</var></code></p>
<div data-if="NUMERCONST !== 0">
<p><code><var>new Term(FINALCOEFF, X)</var> = <var>FINALCONST</var></code></p>
</div>
</div>
<div data-else="">
<p><code><var>SIGN * NUMERCONST</var> = <var>new RationalExpression([[-FINALCOEFF, X], DENOMCONST * CONSTANT])</var></code></p>
<div data-if="DENOMCONST !== 0">
<p><code><var>-FINALCONST</var> = <var>new Term(-FINALCOEFF, X)</var></code></p>
</div>
<p><code><var>new Term(-FINALCOEFF, X)</var> = <var>-FINALCONST</var></code></p>
</div>
<p><code><var>X</var> = <var>fraction(FINALCONST, FINALCOEFF)</var></code></p>
<div data-if="FINALCOEFF !== 1 && getGCD(FINALCONST, FINALCOEFF) !== 1">
<p>Simplify.</p>
<p><code><var>X</var> = <var>fractionReduce(FINALCONST, FINALCOEFF)</var></code></p>
</div>
</div>
</div>
<div id="fraction">
<div class="vars" data-ensure="!NUMERATOR.divide(DENOMINATOR) && abs(DENOMINATOR.evaluate(FINALCONST / FINALCOEFF)) > 0.0001">
<var id="NUMERCOEFF">NUMERCONST &lt; 1 ? randRange(1, 5) : randRange(0, 5)</var>
<div data-ensure="DENOMCOEFF !== SIGN * NUMERCOEFF * CONSTANT">
<var id="CONSTANT">randRange(2, 10)</var>
<var id="DENOMCOEFF">randRangeWeighted(1, 5, 1, 0.25)</var>
<var id="DENOMCONST">randRangeWeighted(-10, 10, 0, 0.25)</var>
<var id="NUMERCONST" data-ensure="DENOMCONST !== NUMERCONST">randRange(-10, 10)</var>
</div>
<var id="NUMERATOR">new RationalExpression([[NUMERCOEFF, X], [NUMERCONST]])</var>
<var id="DENOMINATOR">new RationalExpression([[DENOMCOEFF, X], [DENOMCONST]])</var>
<var id="PRODUCT">NUMERATOR.multiply(CONSTANT * SIGN)</var>
<var id="FINALCONST">DENOMCONST - SIGN * NUMERCONST * CONSTANT</var>
<var id="FINALCOEFF">SIGN * NUMERCOEFF * CONSTANT - DENOMCOEFF</var>
</div>
<p class="question"><code><span data-if="SIGN === -1">-</span>
\dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>} = \dfrac{1}{<var>CONSTANT</var>}
</code></p>
<div class="hints" data-apply="appendContents">
<p><code>
<span data-if="SIGN === -1 && NUMERATOR.terms.length > 1">-(<var>NUMERATOR</var>)</span>
<span data-else=""><var>NUMERATOR.multiply(SIGN)</var></span>
= \dfrac{<var>DENOMINATOR</var>}{<var>CONSTANT</var>}
</code></p>
<div>
<p>Multiply both sides of the equation by <code><var>CONSTANT</var></code>.</p>
<p><code>
<span data-if="NUMERATOR.terms.length > 1"><var>CONSTANT * SIGN</var>(<var>NUMERATOR</var>)</span>
<span data-else=""><var>PRODUCT</var></span>
= <var>DENOMINATOR</var>
</code></p>
</div>
<div data-if="NUMERATOR.terms.length > 1">
<p><code><var>PRODUCT</var> = <var>DENOMINATOR</var></code></p>
</div>
<div data-if="SIGN * CONSTANT * NUMERCOEFF - DENOMCOEFF > 0">
<p data-if="NUMERCOEFF !== 0"><code><var>new RationalExpression([[FINALCOEFF, X], SIGN * NUMERCONST * CONSTANT])</var> = <var>DENOMCONST</var></code></p>
<p data-if="NUMERCONST !== 0"><code><var>new Term(FINALCOEFF, X)</var> = <var>FINALCONST</var></code></p>
</div>
<div data-else="">
<p><code><var>SIGN * NUMERCONST * CONSTANT</var> = <var>new RationalExpression([[-FINALCOEFF, X], DENOMCONST])</var></code></p>
<div data-if="DENOMCONST !== 0">
<p><code><var>-FINALCONST</var> = <var>new Term(-FINALCOEFF, X)</var></code></p>
</div>
<p><code><var>new Term(-FINALCOEFF, X)</var> = <var>-FINALCONST</var></code></p>
</div>
<p data-if="FINALCOEFF !== -1"><code><var>X</var> = <var>fraction(FINALCONST, FINALCOEFF)</var></code></p>
<div data-if="FINALCOEFF !== 1 && getGCD(FINALCONST, FINALCOEFF) !== 1">
<p>Simplify.</p>
<p><code><var>X</var> = <var>fractionReduce(FINALCONST, FINALCOEFF)</var></code></p>
</div>
</div>
</div>
</div>
<div class="solution" data-type="multiple">
<p><code><var>X</var> =</code> <span class="sol"><var>FINALCONST / FINALCOEFF</var></span>
</div>
<div class="hints">
<p>Multiply both sides of the equation by <code><var>DENOMINATOR</var></code>.</p>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.