Skip to content

Commit

Permalink
Skip extra hints if not needed; make sure fractions aren't equal
Browse files Browse the repository at this point in the history
  • Loading branch information
beneater committed Jan 14, 2012
1 parent 267aa15 commit 9ce709a
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions exercises/comparing_improper_fractions_and_mixed_numbers.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html data-require="math math-format graphie graphie-helpers word-problems">
<html data-require="math math-format word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Comparing improper fractions and mixed numbers</title>
Expand All @@ -10,7 +10,7 @@
<div class="exercise">
<div class="problems">
<div id="same-whole">
<div class="vars" data-ensure="M_DENOM !== I_DENOM && WHOLE + M_NUM / M_DENOM !== I_NUM / I_DENOM">
<div class="vars" data-ensure="M_DENOM !== I_DENOM && abs( ( WHOLE + M_NUM / M_DENOM ) - ( I_NUM / I_DENOM ) ) > 0.001">
<var id="WHOLE">randRange( 1, 5 )</var>
<var id="WHOLE_2">WHOLE</var>

Expand All @@ -26,7 +26,7 @@
<var id="M_REDUCED_DENOM">M_DENOM_2 / getGCD( M_NUM_2, M_DENOM_2 )</var>

<var id="I_NUM">WHOLE_2 * M_REDUCED_DENOM + M_REDUCED_NUM</var>
<var id="I_DENOM">M_REDUCED_DENOM</var-->
<var id="I_DENOM">M_REDUCED_DENOM</var>

<var id="LCM">getLCM( M_DENOM_REDUCED, I_DENOM )</var>
<var id="F1">LCM / M_DENOM_REDUCED</var>
Expand Down Expand Up @@ -62,21 +62,23 @@
</ul>
<div class="hints">
<p>First, let's convert the mixed number to an improper fraction with the same denominator.</p>
<p>To get the numerator of the improper fraction, multiply the denominator (<strong><var>M_DENOM_REDUCED</var></strong>) by the whole number (<strong><var>WHOLE</var></strong>) and add the numerator (<strong><var>M_NUM_REDUCED</var></strong>).<p class="hint_purple"><strong><code><var>M_DENOM_REDUCED</var> * <var>WHOLE</var>+<var>M_NUM_REDUCED</var> = <var>M_AS_I</var></code></strong></p>
<p>To get the numerator of the improper fraction, multiply the denominator (<strong><var>M_DENOM_REDUCED</var></strong>) by the whole number (<strong><var>WHOLE</var></strong>) and add the numerator (<strong><var>M_NUM_REDUCED</var></strong>).<p class="hint_purple"><strong><code><var>M_DENOM_REDUCED</var> \cdot <var>WHOLE</var>+<var>M_NUM_REDUCED</var> = <var>M_AS_I</var></code></strong></p>
<p>We can write the mixed number as an improper fraction with numerator <strong><var>M_AS_I</var></strong> and denominator <strong><var>M_DENOM_REDUCED</var></strong>.</p>
<p>Now we need to compare <code><var>fraction ( M_AS_I, M_DENOM_REDUCED, false, true )</var></code> to <code><var>fraction ( I_NUM, I_DENOM, false, true )</var></code>.</p>
<p>It is easier to compare these two fractions when they have the same denominator.</p>
<p>Their smallest common denominator is the LCM of <var>M_DENOM_REDUCED</var> and <var>I_DENOM</var>.</p>
<p><code>\lcm(<var>M_DENOM_REDUCED</var>, <var>I_DENOM</var>) = <var>LCM</var></code></p>
<div>
<p>The first fraction <var>BECOMES_1</var> <code>\dfrac{<var>M_AS_I * F1</var>}{<var>LCM</var>}</code>.</p>
<p>The second fraction <var>BECOMES_2</var> <code>\dfrac{<var>I_NUM * F2</var>}{<var>LCM</var>}</code>.</p>
<div data-if="M_DENOM_REDUCED !== I_DENOM" data-unwrap>
<p>It is easier to compare these two fractions when they have the same denominator.</p>
<p>Their smallest common denominator is the LCM of <var>M_DENOM_REDUCED</var> and <var>I_DENOM</var>.</p>
<p><code>\lcm(<var>M_DENOM_REDUCED</var>, <var>I_DENOM</var>) = <var>LCM</var></code></p>
<div>
<p>The first fraction <var>BECOMES_1</var> <code>\dfrac{<var>M_AS_I * F1</var>}{<var>LCM</var>}</code>.</p>
<p>The second fraction <var>BECOMES_2</var> <code>\dfrac{<var>I_NUM * F2</var>}{<var>LCM</var>}</code>.</p>
</div>
</div>
<p>We see that <code>\dfrac{<var>M_AS_I * F1</var>}{<var>LCM</var>} <var>SOLUTION</var> \dfrac{<var>I_NUM * F2</var>}{<var>LCM</var>}</code>.</p>
</div>
</div>
<div id="different-whole">
<div class="vars" data-ensure="M_DENOM !== I_DENOM">
<div class="vars" data-ensure="M_DENOM !== I_DENOM && abs( ( WHOLE + M_NUM / M_DENOM ) - ( I_NUM / I_DENOM ) ) > 0.001">
<var id="WHOLE">randRange( 1, 5 )</var>
<var id="WHOLE_2">randRange( 1, 5 )</var>

Expand Down Expand Up @@ -128,15 +130,17 @@
</ul>
<div class="hints">
<p>First, let's convert the mixed number to an improper fraction with the same denominator.</p>
<p>To get the numerator of the improper fraction, multiply the denominator (<strong><var>M_DENOM_REDUCED</var></strong>) by the whole number (<strong><var>WHOLE</var></strong>) and add the numerator (<strong><var>M_NUM_REDUCED</var></strong>).<p class="hint_purple"><strong><code><var>M_DENOM_REDUCED</var>*<var>WHOLE</var>+<var>M_NUM_REDUCED</var> = <var>M_AS_I</var></code></strong></p>
<p>To get the numerator of the improper fraction, multiply the denominator (<strong><var>M_DENOM_REDUCED</var></strong>) by the whole number (<strong><var>WHOLE</var></strong>) and add the numerator (<strong><var>M_NUM_REDUCED</var></strong>).<p class="hint_purple"><strong><code><var>M_DENOM_REDUCED</var>\cdot<var>WHOLE</var>+<var>M_NUM_REDUCED</var> = <var>M_AS_I</var></code></strong></p>
<p>We can write the mixed number as an improper fraction with numerator <strong><var>M_AS_I</var></strong> and denominator <strong><var>M_DENOM_REDUCED</var></strong>.</p>
<p>Now we need to compare <code><var>fraction ( M_AS_I, M_DENOM_REDUCED, false, true )</var></code> to <code><var>fraction ( I_NUM, I_DENOM, false, true )</var></code></p>
<p>It is easier to compare these two fractions when they have the same denominator.</p>
<p>Their smallest common denominator is the LCM of <var>M_DENOM_REDUCED</var> and <var>I_DENOM</var>.</p>
<p><code>\lcm(<var>M_DENOM_REDUCED</var>, <var>I_DENOM</var>) = <var>LCM</var></code></p>
<div>
<p>The first fraction <var>BECOMES_1</var> <code>\dfrac{<var>M_AS_I * F1</var>}{<var>LCM</var>}</code>.</p>
<p>The second fraction <var>BECOMES_2</var> <code>\dfrac{<var>I_NUM * F2</var>}{<var>LCM</var>}</code>.</p>
<div data-if="M_DENOM_REDUCED !== I_DENOM" data-unwrap>
<p>It is easier to compare these two fractions when they have the same denominator.</p>
<p>Their smallest common denominator is the LCM of <var>M_DENOM_REDUCED</var> and <var>I_DENOM</var>.</p>
<p><code>\lcm(<var>M_DENOM_REDUCED</var>, <var>I_DENOM</var>) = <var>LCM</var></code></p>
<div>
<p>The first fraction <var>BECOMES_1</var> <code>\dfrac{<var>M_AS_I * F1</var>}{<var>LCM</var>}</code>.</p>
<p>The second fraction <var>BECOMES_2</var> <code>\dfrac{<var>I_NUM * F2</var>}{<var>LCM</var>}</code>.</p>
</div>
</div>
<p>We see that <code>\dfrac{<var>M_AS_I * F1</var>}{<var>LCM</var>} <var>SOLUTION</var> \dfrac{<var>I_NUM * F2</var>}{<var>LCM</var>}</code>.</p>
</div>
Expand Down

0 comments on commit 9ce709a

Please sign in to comment.