Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve hints: Exponents 2; Add subhints!

  • Loading branch information...
commit 85580f5e16aa7a65d392c1cf6d227be952a73441 1 parent d8f1612
@beneater beneater authored
View
17 css/khan-exercise.css
@@ -12,6 +12,23 @@ var { font-style: normal; }
.final_answer{ font-weight:bold; }
+div.subhint {
+ border: 1px solid #aaaaaa;
+ background: #f9f9f9;
+ display: none;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+ margin-left: 20px;
+ margin-right: 20px;
+ padding: 10px;
+}
+
+a.show-subhint {
+ font-size: 12px;
+ font-style: italic;
+}
+
#workarea { margin-left: 30px; }
#hintsarea { margin-left: 50px; }
#answer_area ul { list-style: none; }
View
139 exercises/exponents_2.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html data-require="math math-format exponents">
+<html data-require="math math-format exponents subhints">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Exponents 2</title>
@@ -7,7 +7,7 @@
<script type="text/javascript">
/* Find a rational base and an integer exponent such that the calculation is
- * reasonable. */
+ * reasonable. */
function pickRationalBaseIntegerExponent() {
var base_neg_prob = .5;
var exp_neg_prob = .75;
@@ -38,11 +38,14 @@
};
}
</script>
+ <style>
+ .sub-hint {
+ font-size: 12px;
+ }
+ </style>
</head>
<body>
<div class="exercise">
- <p class="summary">This exercise covers exponential arithmetic with rational bases and integer (primarily negative) exponents. This exercise covers all the material presented in the Level 2 Exponents video.</p>
-
<div class="problems">
<div>
<div class="vars">
@@ -60,6 +63,9 @@
<var id="SOL_N">VALS.sol_n</var>
<var id="SOL_D">VALS.sol_d</var>
+
+ <var id="BASEFS_N">reduce( BASEF_N, BASEF_D )[ 0 ]</var>
+ <var id="BASEFS_D">reduce( BASEF_N, BASEF_D )[ 1 ]</var>
</div>
<p class="question"><code>\Large <var>fracParens( BASE_N, BASE_D )</var>^{<var>EXP_SIGN+EXP</var>}</code></p>
@@ -67,17 +73,132 @@
<div class="hints">
- <div data-unwrap data-if="abs( EXP ) > 1">
+ <div data-if="EXP_NEG" data-unwrap>
+ <div>
+ <p>
+ Any time we have a negative exponent, we can change it to a positive exponent if we flip the numerator and denominator:
+ [<a href="#" class="show-subhint" data-subhint="neg-exponent">Why is that?</a>]
+ </p>
+ <div class="subhint" id="neg-exponent">
+ <p>
+ The exponent tells us how many times to <span class="hint_green">multiply</span> by the base. If the exponent is
+ <span class="hint_blue">negative</span>, then it tells us how many times to <span class="hint_blue">divide</span> by the base.
+ </p>
+ <p>
+ <code><var>fracParens( BASE_N, BASE_D )</var>^{\color{<var>BLUE</var>}{<var>EXP_SIGN+EXP</var>}} \quad = \quad \color{gray}{1}</code>
+ <code data-each="EXP times">\color{<var>BLUE</var>}{\div} <var>fraction( BASE_N, BASE_D, false, true )</var>\enspace</code>
+ </p>
+ <p>
+ Since dividing by a fraction is the same as multiplying by its reciprocal, we can replace the division with
+ <span class="hint_green">multiplication</span>:
+ </p>
+ <p>
+ <code>\hphantom{<var>fracParens( BASE_N, BASE_D )</var>^{<var>EXP_SIGN+EXP</var>}} \quad = \quad \color{gray}{1}</code>
+ <code data-each="EXP times">\color{<var>GREEN</var>}{\times} <var>fraction( BASE_D, BASE_N, false, true )</var>\enspace</code>
+ <code> \quad = \quad <var>fraction( BASE_D, BASE_N, false, true, false, true )</var>^{\color{<var>GREEN</var>}{<var>EXP</var>}} </code>
+ </p>
+ <p>
+ For more, check out the
+ <a class="related-video" href="/video/negative-exponent-intuition" data-youtube-id="Tqpcku0hrPU">negative exponent intuition</a> video.
+ </p>
+ </div>
+ <p><code>
+ <var>fracParens( BASE_N, BASE_D )</var>^{<var>EXP_SIGN+EXP</var>} \quad = \quad <var>fracParens( BASEF_N, BASEF_D )</var>^{<var>EXP</var>}
+ </code></p>
+ </div>
+ </div>
- <p data-if="EXP_NEG"><code>= <var>fracParens( BASEF_N, BASEF_D )</var>^{<var>EXP</var>}</code></p>
+ <div data-if="BASEFS_D === 1" data-unwrap>
+ <div data-if="EXP !== 1" data-unwrap>
+ <p>
+ To find <code><var>fracParens( BASEF_N, BASEF_D )</var>^{\color{<var>BLUE</var>}{<var>EXP</var>}}</code>,
+ multiply <span class="hint_blue"><var>cardinal( EXP )</var></span> <code><var>round( BASEF_N/BASEF_D )</var></code>s together.
+ </p>
+ <div data-unwrap data-each="expandFractionExponent( BASEF_N, BASEF_D, EXP ) as v">
+ <p><code> \quad = \quad <var>v</var></code></p>
+ </div>
+ </div>
+ <div data-else data-unwrap>
+ <p>
+ Any number to the first power is simply that number.
+ </p>
+ </div>
+ </div>
- <div data-unwrap data-each="expandFractionExponent( BASEF_N, BASEF_D, EXP ) as v">
- <p><code>= <var>v</var></code></p>
+ <div data-else data-unwrap>
+ <div>
+ <p>
+ Taking an exponent of a fraction is the same as taking the same exponent of the numerator and denominator:
+ [<a href="#" class="show-subhint" data-subhint="dist-exponent">Why is that?</a>]
+ </p>
+ <div class="subhint" id="dist-exponent">
+ <p>
+ The exponent tells us how many times we're multiplying the fraction by itself. So in this case, we're
+ multiplying <code><var>fraction( BASEF_N, BASEF_D, false, true, true )</var></code> by itself
+ <span class="hint_blue"><var>cardinal( EXP )</var></span> times:
+ </p>
+ <p>
+ <code><var>fracParens( BASEF_N, BASEF_D )</var>^{\color{<var>BLUE</var>}{<var>EXP</var>}} \quad = \quad </code>
+ <code><var>fraction( BASEF_N, BASEF_D, false, true )</var></code>
+ <code data-each="( EXP - 1 ) times">\times <var>fraction( BASEF_N, BASEF_D, false, true )</var>\enspace</code>
+ </p>
+ <p>
+ When we <em>multiply</em> fractions, we just multiply the numerators and denominators separately:
+ </p>
+ <p>
+ <code>\hphantom{<var>fracParens( BASEF_N, BASEF_D )</var>^{<var>EXP</var>}} \quad = \quad
+ \dfrac{<var>jQuery.map( Array(EXP), function() { return reduce( BASEF_N, BASEF_D )[0] }).join("\\times ")</var>}
+ {<var>jQuery.map( Array(EXP), function() { return reduce( BASEF_N, BASEF_D )[1] }).join("\\times ")</var>}
+ </code>
+ </p>
+ <p>
+ If we rewrite the numerator and denominator as exponents, we end up with the original fraction with the
+ numerator and denominator each raised to the original exponent:
+ </p>
+ <p>
+ <code>\hphantom{<var>fracParens( BASEF_N, BASEF_D )</var>^{<var>EXP</var>}} \quad = \quad
+ \dfrac{<var>reduce( BASEF_N, BASEF_D )[0]</var>^{\color{<var>BLUE</var>}{<var>EXP</var>}}}
+ {<var>reduce( BASEF_N, BASEF_D )[1]</var>^{\color{<var>BLUE</var>}{<var>EXP</var>}}}
+ </code>
+ </p>
+ </div>
+ <p><code>
+ \qquad <var>fracParens( BASEF_N, BASEF_D )</var>^{<var>EXP</var>} \quad = \quad
+ \dfrac{<var>BASEFS_N</var>^{<var>EXP</var>}}{<var>BASEFS_D</var>^{<var>EXP</var>}}
+ </p></code>
+ </div>
+ <div data-if="EXP !== 1" data-unwrap>
+ <div>
+ <p>Expand the exponents in the numerator and denominator into multiplication problems:</p>
+ <p><code>
+ \hphantom{\qquad <var>fracParens( BASEF_N, BASEF_D )</var>^{<var>EXP</var>} \quad} = \quad
+ \dfrac{<var>jQuery.map( Array( EXP ), function() { return BASEFS_N; }).join("\\times ")</var>}
+ {<var>jQuery.map( Array( EXP ), function() { return BASEFS_D; }).join("\\times ")</var>}
+ </code></p>
+ </div>
+ <div>
+ <p>
+ Multiply everything together:
+ </p>
+ <p data-each="EXP times as I"><code>
+ \hphantom{\qquad <var>fracParens( BASEF_N, BASEF_D )</var>^{<var>EXP</var>} \quad} = \quad
+ \dfrac{
+ <var>pow( BASEFS_N, I + 1 )</var>
+ <var>jQuery.map( Array( EXP - I - 1 ), function() { return "\\times " + BASEFS_N; }).join("")</var>
+ }{
+ <var>pow( BASEFS_D, I + 1 )</var>
+ <var>jQuery.map( Array( EXP - I - 1 ), function() { return "\\times " + BASEFS_D; }).join("")</var>
+ }
+ </code></p>
+ </div>
</div>
+ <p data-else>
+ Any number to the first power is simply that number.
+ </p>
</div>
- <p data-else><code>= <var>frac( SOL_N, SOL_D )</var></code></p>
+ <p class="final_answer">The final answer is: <code>\quad<var>fractionReduce( SOL_N, SOL_D )</var> </code></p>
</div>
</div>
View
18 utils/subhints.js
@@ -0,0 +1,18 @@
+(function() {
+
+ jQuery( "a.show-subhint" ).live( "click", function( event ) {
+ var subhint = jQuery( "#" + jQuery( this ).data( "subhint" ) );
+ var visibleText = jQuery( this ).data( "visible-text" ) || jQuery( this ).text();
+ var hiddenText = jQuery( this ).data( "hidden-text" ) || "Hide explanation";
+ jQuery( this ).data({ "visible-text": visibleText, "hidden-text": hiddenText });
+
+ if ( subhint.is( ":visible" ) ) {
+ jQuery( this ).text( visibleText );
+ } else {
+ jQuery( this ).text( hiddenText );
+ }
+ jQuery( "#" + jQuery( this ).data( "subhint" ) ).toggle( 200 );
+ return false;
+ });
+
+})();
Please sign in to comment.
Something went wrong with that request. Please try again.