Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

106 lines (80 sloc) 3.999 kB
<!DOCTYPE html>
<!-- TODO: underbrace to show what of the multiplication has been contracted. -->
<html data-require="math math-format exponents">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Exponents 1</title>
<script src="../khan-exercise.js"></script>
<script type="text/javascript">
/* Find an integer base and a positive integer exponent such that the
* calculation is reasonable. */
function pickIntegerBasePositiveExponent() {
var base, exp;
var exp_zero_prob = .2;
var exp_unit_prob = .1;
var base_negunit_prob = .2;
var base_unit_prob = .05;
var base_zero_prob = .05;
var r = KhanUtil.random();
if ( r < exp_zero_prob + exp_unit_prob ) {
base = KhanUtil.randRangeNonZero( -500, 500 );
if ( r < exp_zero_prob) {
exp = 0;
} else {
exp = 1;
}
} else {
r = KhanUtil.random();
if ( r < base_negunit_prob ) {
base = -1;
} else if ( r < base_negunit_prob + base_unit_prob ) {
base = 1;
} else if ( r < base_negunit_prob + base_unit_prob + base_zero_prob ) {
base = 0;
} else {
base = KhanUtil.randRangeExclude( -10, 10, [ 0, 1, -1 ] );
}
exp = KhanUtil.randRange( 2, KhanUtil.maxReasonableExp( base ) );
}
return {
base: base,
exp: exp
};
}
</script>
</head>
<body>
<div class="exercise">
<p class="summary">This exercise covers exponential arithmetic with, in general, integer bases raised to nonnegative integer exponents. Handles three specific cases: integers raised to positive integers (this is the most common case); nonzero integers raised to 0; and -1, 0, and 1 raised to arbitrarily large positive integers. This exercise covers all the material presented in the Level 1 Exponents video.</p>
<div class="problems">
<div>
<div class="vars">
<var id="VALS">pickIntegerBasePositiveExponent()</var>
<var id="BASE">VALS.base</var>
<var id="EXP">VALS.exp</var>
<var id="NEG_ONE_HINT">BASE > 0 ? "" : ( isEven( EXP ) ? "even" : "odd" )</var>
</div>
<p class="question"><code>\Large <var>negParens( BASE )</var>^{<var>EXP</var>}</code></p>
<p class="solution" data-forms="integer"><var>round( pow( BASE, EXP ) )</var></p>
<div class="hints">
<div data-unwrap data-if="EXP === 0">
<p>Anything to the 0th power equals... ?</p>
<p>Anything to the 0th power equals <span class="hint_blue">1</span>.</p>
</div>
<div data-unwrap data-else-if="EXP === 1">
<p>Anything to the 1st power equals... ?</p>
<p><code>x^{1}=x</code>, no matter what <code>x</code> is.</p>
</div>
<div data-unwrap data-else-if="BASE === 0 || BASE === 1 || BASE === -1">
<p><var>Cardinal( BASE )</var> to any <var>NEG_ONE_HINT</var> power equals... ?</p>
<p><var>Cardinal( BASE )</var> to any <var>NEG_ONE_HINT</var> power equals <span class="hint_blue"><var>cardinal( round( pow( BASE, EXP ) ) )</var></span>.</p>
</div>
<div data-unwrap data-else>
<p data-each="expandExponent( BASE, EXP ) as v"><code>= <var>v</var></code></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.