forked from Khan/khan-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exponents_4.html
89 lines (70 loc) · 5.4 KB
/
exponents_4.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html data-require="math math-format exponents">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Exponents 4</title>
<!-- Note: This exercise does not correspond to anything that is currently live. Instead, it covers material that Sal talks about in his Exponents 3 video, which is currently not tested. -->
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<p class="summary">This exercise covers exponential arithmemtic with (mainly negative, when possible) rational bases and (mainly nonunit numerator) rational exponents. This exercise covers the last chunk of material from the Level 3 Exponents video.</p>
<div class="problems">
<div>
<div class="vars">
<var id="VALS">twoBasesOneRoot()</var>
<var id="EXP_NEG">random() < 0.75</var>
<var id="EXP_D_ORIG">VALS.root</var>
<var id="BASE_NEG">isOdd( EXP_D ) && ( random() < 0.75 )</var>
<var id="BASE_N">VALS.base_1</var>
<var id="BASE_D">VALS.base_2</var>
<!-- base flipped if the exponent is negative. -->
<var id="BASEF_N">EXP_NEG ? BASE_D : BASE_N</var>
<var id="BASEF_D">EXP_NEG ? BASE_N : BASE_D</var>
<!-- the base will only be negative when the root would also be negative. -->
<var id="ROOT_NEG">BASE_NEG</var>
<var id="ROOT_N_ORIG">round( pow( EXP_NEG ? BASE_D : BASE_N, 1 / EXP_D_ORIG ) )</var>
<var id="ROOT_D_ORIG">round( pow( EXP_NEG ? BASE_N : BASE_D, 1 / EXP_D_ORIG ) )</var>
<var id="EXP_N_ORIG">function() {
var max_exp = min( maxReasonableExp( ROOT_N_ORIG ), maxReasonableExp( ROOT_D_ORIG ) );
var exp_n;
while ( exp_n === undefined || exp_n % EXP_D_ORIG === 0 ) {
exp_n = randRange( 2, max_exp );
}
return exp_n;
}()</var>
<!-- we need to check and update the root if the exponent reduces, since we'll only be displaying the reduced exponent. -->
<var id="GCD">getGCD( EXP_N_ORIG, EXP_D_ORIG )</var>
<var id="EXP_N">EXP_N_ORIG / GCD</var>
<var id="EXP_D">EXP_D_ORIG / GCD</var>
<var id="ROOT_N">round( pow( EXP_NEG ? BASE_D : BASE_N, 1 / EXP_D ) )</var>
<var id="ROOT_D">round( pow( EXP_NEG ? BASE_N : BASE_D, 1 / EXP_D ) )</var>
<var id="SOL_NEG">ROOT_NEG && isOdd( EXP_N )</var>
<var id="SOL_N">round( pow( ROOT_N, EXP_N ) )</var>
<var id="SOL_D">round( pow( ROOT_D, EXP_N ) )</var>
</div>
<p class="question"><code>\Large <var>fracParens( BASE_N, BASE_D )</var>^{<var>fracSmall( ( EXP_NEG ? -1 : 1 ) * EXP_N, EXP_D )</var>}</code></p>
<p class="solution"><var>SOL_N / SOL_D</var></p>
<div class="hints">
<!-- Extra first step, for a question like (4/9)^(-3/2), display "=(9/4)^(3/2)" -->
<p data-if="EXP_NEG"><code>= <var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( EXP_N, EXP_D )</var>}</code></p>
<!-- For a question like (4/9)^(3/2)... -->
<!-- "=((4/9)^(1/2))^3" -->
<p data-if="EXP_N > 1"><code>= \left(<var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( 1, EXP_D )</var>}\right)^{<var>EXP_N</var>}</code></p>
<!-- "To simplify (4/9)^(1/2), figure out whta goes in the blank: ?^2 = 4/9" -->
<p>To simplify <code><var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( 1, EXP_D )</var>}</code>, figure out what goes in the blank:<br /> <code>\left(? \right)^{<var>abs( EXP_D )</var>}=<var>frac( BASEF_N, BASEF_D )</var></code></p>
<!-- Replace the ? with 2/3 -->
<p>To simplify <code><var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( 1, EXP_D )</var>}</code>, figure out what goes in the blank:<br /> <code>\left(\color{blue}{<var>frac( ROOT_N, ROOT_D )</var>}\right)^{<var>abs( EXP_D )</var>}=<var>frac( BASEF_N, BASEF_D )</var></code></p>
<!-- "So (4/9)^(1/2)." -->
<p>so <code>\quad<var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( 1, EXP_D )</var>}=<var>frac( ROOT_N, ROOT_D )</var></code></p>
<!-- "So (4/9)^(3/2)=((4/9)^(1/2))^3=(2/3)^3" -->
<p data-if="EXP_N > 1">So <code><var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( EXP_N, EXP_D )</var>}=\left(<var>fracParens( BASEF_N, BASEF_D )</var>^{<var>fracSmall( 1, EXP_D )</var>}\right)^{<var>EXP_N</var>}=<var>fracParens( ROOT_N, ROOT_D )</var>^{<var>EXP_N</var>}</code></p>
<p data-if="EXP_N > 1 && reduces( ROOT_N, ROOT_D )"><code>= <var>fraction( ROOT_N, ROOT_D, true, true, false, true )</var>^{<var>EXP_N</var>}</code></p>
<!-- "=(2/3)(2/3)(2/3)" -->
<p data-if="EXP_N > 1" data-each="expandFractionExponent( ROOT_N, ROOT_D, EXP_N ) as v"><code>= <var>v</var></code></p>
</div>
</div>
</div>
</div>
</body>
</html>