This repository has been archived by the owner on May 11, 2021. It is now read-only.
/
cube_roots_2.html
97 lines (77 loc) · 4.4 KB
/
cube_roots_2.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
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html data-require="math graphie">
<head>
<title>Cube roots 2</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="cube">
<div class="vars">
<var id="cx">0</var>
<var id="y">1</var>
<var id="CUBE">randRange(2, 10)</var>
<var id="NOT_CUBE">randFromArray([2, 3, 4, 5, 10])</var>
<var id="CUBE_FACTORS">getPrimeFactorization(CUBE)</var>
<var id="MULTIPLES">$.map(CUBE_FACTORS, function(x) {return "(" + x + "\\times " + x + "\\times " + x + ")"; })</var>
<var id="ROOTS">$.map(CUBE_FACTORS, function(x) {return "\\sqrt{" + x + "\\times " + x + "\\times " + x + "}"; })</var>
<var id="NOT_CUBE_FACTORS">getPrimeFactorization(NOT_CUBE)</var>
<var id="Q">NOT_CUBE * CUBE * CUBE * CUBE</var>
<var id="PRIMES">getPrimeFactorization(Q)</var>
<var id="FACTORIZATION">PRIMES.slice(1, PRIMES.length - 1)</var>
<var id="curr">Q</var>
</div>
<p class="question"><code>\Large{\sqrt[3]{<var>Q</var>} = \text{?}}</code></p>
<p class="solution" data-type="cuberoot"><var>Q</var></p>
<div class="hints">
<p><code>\sqrt[3]{<var>Q</var>}</code> is the number that, when multiplied by itself three times, equals <code><var>Q</var></code>.</p>
<p>First break down <code><var>Q</var></code> into its prime factorization and look for factors that appear three times.</p>
<p>Let's draw a factor tree.</p>
<div class="graphie" id="factor-tree">
init({
range: [[-1, FACTORIZATION.length + 3], [-2 * (FACTORIZATION.length + 1), 1]],
scale: [30, 30]
});
label([cx + 1, y], curr);
path([[cx + 1, y - 0.5], [cx, y - 1.5]]);
path([[cx + 1, y - 0.5], [cx + 2, y - 1.5]]);
y -= 2;
cx += 1;
curr = curr / PRIMES[0];
label([cx - 1, y], PRIMES[0]);
circle([cx - 1, y], 0.5);
label([cx + 1, y], curr);
</div>
<div>
<div class="graphie" data-each="FACTORIZATION as factor" data-update="factor-tree">
path([[cx + 1, y - 0.5], [cx, y - 1.5]]);
path([[cx + 1, y - 0.5], [cx + 2, y - 1.5]]);
y -= 2;
cx += 1;
curr = curr / factor;
label([cx - 1, y], factor);
circle([cx - 1, y], 0.5);
label([cx + 1, y], curr);
</div>
<div class="graphie" data-update="factor-tree">
circle([cx + 1, y], 0.5);
</div>
</div>
<p>So the prime factorization of <code><var>Q</var></code> is <code><var>PRIMES.join( "\\times " )</var></code>.</p>
<div>
<p>Notice that we can rearrange the factors like so:</p>
<p><code><var>Q</var> = <var>PRIMES.join(" \\times ")</var> =
<var>MULTIPLES.join(" \\times ")</var> \times <var>NOT_CUBE_FACTORS.join("\\times ")</var></code></p>
</div>
<p>So <code>\sqrt[3]{<var>Q</var>} =
<var>ROOTS.join(" \\times ")</var> \times \sqrt[3]{<var>NOT_CUBE_FACTORS.join("\\times ")</var>}</code></p>
<p data-if="CUBE_FACTORS.length + NOT_CUBE_FACTORS.length > 2"><code>\sqrt[3]{<var>Q</var>} =
<var>CUBE_FACTORS.join("\\times ")</var> \times \sqrt[3]{<var>NOT_CUBE_FACTORS.join("\\times ")</var>}</code></p>
<p><code>\sqrt[3]{<var>Q</var>} = <var>CUBE</var> \sqrt[3]{<var>NOT_CUBE</var>}</code></p>
</div>
</div>
</div>
</div>
</body>
</html>