Permalink
Browse files

Add a statement to assume x != 0 for simplifying rational expressions

fix #42324

Test plan: load each exercise locally and make sure it displays properly

Auditors: peter, cbhl
  • Loading branch information...
beneater committed Mar 14, 2013
1 parent 36051ed commit 44691243d32b442f0c384c060acedec827db3053
@@ -81,11 +81,12 @@
<var id="SOLUTION">getSolution(COEFFICIENT1, COEFFICIENT2, DEGREE1, DEGREE2, X)</var>
</div>
- <p class="problem">Simplify the expression.</p>
- <p class="question">
+ <p class="question">Simplify the following expression:</p>
+ <p>
<code><var>Y</var> = \dfrac{<var>NUMERATORCOEFFICIENT</var><var>POWER1</var>}
{<var>DENOMINATORCOEFFICIENT</var><var>POWER2</var>}</code>
</p>
+ <p>You can assume <code><var>X</var> \neq 0</code>.</p>
<div class="solution" data-type="set">
<div class="set-sol" data-type="multiple">
@@ -75,7 +75,7 @@
<div data-ensure="COEFFICIENT1 !== 0 || COEFFICIENT2 !== 0">
<var id="COEFFICIENT2">randRangeWeighted(-10, 10, 0, 0.15)</var>
</div>
-
+
<var id="CONSTANT2">(function() {
if (getGCD(COEFFICIENT1, CONSTANT1) !== 1 && getGCD(COEFFICIENT2, CONSTANT1) !== 1) {
// Ensure there are no common factors
@@ -104,8 +104,9 @@
<var id="NEGATIVEDENOMINATOR">getExpressionRegex(-COEFFICIENT2, X, -CONSTANT2)</var>
</div>
- <p class="problem">Simplify the following expression:</p>
- <p class="question"><code><var>Y</var> = \dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>}</code></p>
+ <p class="question">Simplify the following expression:</p>
+ <p><code><var>Y</var> = \dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>}</code></p>
+ <p>You can assume <code><var>X</var> \neq 0</code>.</p>
<div class="solution" data-type="set">
<div class="set-sol" data-type="multiple">
@@ -183,4 +184,4 @@
</div>
</div>
</body>
-</html>
+</html>
@@ -75,8 +75,9 @@
</div>
</div>
- <p class="problem">Simplify the following expression:</p>
- <p class="question"><code><var>Y</var> = \dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>}</code></p>
+ <p class="question">Simplify the following expression:</p>
+ <p><code><var>Y</var> = \dfrac{<var>NUMERATOR</var>}{<var>DENOMINATOR</var>}</code></p>
+ <p>You can assume <code><var>X</var> \neq 0</code>.</p>
<div class="solution" data-type="set">
<div class="set-sol" data-type="multiple">
@@ -142,4 +143,4 @@
</div>
</div>
</body>
-</html>
+</html>

3 comments on commit 4469124

@petercollingridge

This comment has been minimized.

Show comment
Hide comment
@petercollingridge

petercollingridge Mar 14, 2013

Member

Thanks for that. For some of the exercises you divide by (x - 3) so there are some other exceptions, but if you say what they are that will make the answer more obvious.

Thanks for that. For some of the exercises you divide by (x - 3) so there are some other exceptions, but if you say what they are that will make the answer more obvious.

@beneater

This comment has been minimized.

Show comment
Hide comment
@beneater

beneater Mar 14, 2013

Member

Oh hrm.. I didn't think of that. If you wanna take a stab at a better fix, feel free.

Member

beneater replied Mar 14, 2013

Oh hrm.. I didn't think of that. If you wanna take a stab at a better fix, feel free.

@petercollingridge

This comment has been minimized.

Show comment
Hide comment
@petercollingridge

petercollingridge Mar 14, 2013

Member

I guess the ideal solution would be to ask them to include the domain of the new expression, which would be possible, but would require a bit of work.

I guess the ideal solution would be to ask them to include the domain of the new expression, which would be possible, but would require a bit of work.

Please sign in to comment.