Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 82 lines (79 sloc) 3.693 kb
b40264c @jeresig Adding in my initial prototype.
jeresig authored
1 <!DOCTYPE html>
df121f7 @jeresig Create a new utility module system with automatic dependency loader. Sim...
jeresig authored
2 <html data-require="math">
b40264c @jeresig Adding in my initial prototype.
jeresig authored
3 <head>
4 <title>Rate Problems 1</title>
7af06f8 @jeresig Move all exercise logic and file loading into JS file. Move exercises in...
jeresig authored
5 <script src="../khan-exercise.js"></script>
b40264c @jeresig Adding in my initial prototype.
jeresig authored
6 </head>
7 <body>
190610b @jeresig Retool framework, move Math and Graph logic out of khan-exercise.js and ...
jeresig authored
8 <div class="exercise">
9 <div class="vars">
10 <var id="SPEED1">11 + rand(9)</var>
11 <var id="SPEED2">41 + rand(9)</var>
12 <var id="AVG">31 + rand(9)</var>
13 <var id="TIME">1 + rand(9)</var>
14 <var id="DIST">AVG * TIME</var>
15 <var id="DIST2">(SPEED1 * SPEED2 * TIME - DIST * SPEED2) / (SPEED1 - SPEED2)</var>
16 <var id="DIST1">DIST - DIST2</var>
17 <ul id="VEHICLE1">
18 <li>bike</li>
19 <li>bus</li>
20 <li>camel</li>
21 <li>elephant</li>
22 </ul>
23 <ul id="VEHICLE2">
24 <li>horse</li>
25 <li>moped</li>
26 <li>scooter</li>
27 <li>train</li>
28 </ul>
29 <var id="V1">VEHICLE1.charAt(0)</var>
30 <var id="V2">VEHICLE2.charAt(0)</var>
31 </div>
b40264c @jeresig Adding in my initial prototype.
jeresig authored
32
190610b @jeresig Retool framework, move Math and Graph logic out of khan-exercise.js and ...
jeresig authored
33 <div class="problems">
34 <div id="original">
35 <div class="problem">
36 <p>Alice traveled by <var>VEHICLE1</var> at an average speed of <var>SPEED1</var> miles per hour.</p>
37 <p>Then, she traveled by <var>VEHICLE2</var> at an average speed of <var>SPEED2</var> miles per hour.</p>
f161590 @pappy74 added KhanUtil.plural
pappy74 authored
38 <p>In total, she traveled <var>DIST</var> miles for <var>TIME</var> hour<var>plural(TIME)</var>.</p>
190610b @jeresig Retool framework, move Math and Graph logic out of khan-exercise.js and ...
jeresig authored
39 </div>
40 <p class="question">How many miles did Alice travel by <var>VEHICLE1</var>? (Round to the nearest mile.)</p>
41 <p class="solution"><var>round(DIST1)</var></p>
42 </div>
43 <div data-type="original">
44 <p class="question">How many miles did Alice travel by <var>VEHICLE2</var>? (Round to the nearest mile.)</p>
45 <p class="solution"><var>round(DIST2)</var></p>
46 </div>
47 <div data-type="original">
48 <p class="question">How many minutes did Alice travel by <var>VEHICLE1</var>? (Round to the nearest minute.)</p>
49 <p class="solution"><var>round(DIST1 / SPEED1 * 60)</var></p>
50 </div>
51 <div data-type="original">
52 <p class="question">How many minutes did Alice travel by <var>VEHICLE2</var>? (Round to the nearest minute.)</p>
53 <p class="solution"><var>round(DIST2 / SPEED2 * 60)</var></p>
b40264c @jeresig Adding in my initial prototype.
jeresig authored
54 </div>
55 </div>
56
190610b @jeresig Retool framework, move Math and Graph logic out of khan-exercise.js and ...
jeresig authored
57 <div class="hints">
58 <p>Remember that <code>d = r * t</code>, or written another way, <code>t = d / r</code></p>
59 <div>
60 <p><code>d_<var>V1</var> =</code> distance that Alice traveled by <var>VEHICLE1</var></p>
61 <p><code>d_<var>V2</var> =</code> distance that Alice traveled by <var>VEHICLE2</var></p>
62 <p>Total distance: <code class="hint_orange">d_<var>V1</var> + d_<var>V2</var> = <var>DIST</var></code></p>
63 </div>
64 <p>Total time: <code class="hint_blue">t_<var>V1</var> + t_<var>V2</var> = <var>TIME</var></code></p>
65 <p><code class="hint_blue">t_<var>V1</var> = (d_<var>V1</var> / <var>SPEED1</var>)</code> and
66 <code class="hint_blue">t_<var>V2</var> = (d_<var>V2</var> / <var>SPEED2</var>)</code></p>
67 <p>Substitute the blue equations for:
68 <code>(d_<var>V1</var> / <var>SPEED1</var>) + (d_<var>V2</var> / <var>SPEED2</var>) = <var>TIME</var></code></p>
69 <p>Multiply the above equation by <var>-1 * SPEED1</var>:
70 <code class="hint_orange">-d_<var>V1</var> - (<var>SPEED1</var> / <var>SPEED2</var>) * d_<var>V2</var> = <var>-SPEED1 * TIME</var></code></p>
71 <p>Add the two orange equations for:
72 <code>(<var>SPEED2 - SPEED1</var> / <var>SPEED2</var>) * d_<var>V2</var> = <var>DIST - (SPEED1 * TIME)</var></code></p>
73 <p>Simplify and round to the nearest integer:
74 <code>d_<var>V2</var> = <var>round(DIST2)</var></code> miles
75 <code>d_<var>V1</var> = <var>round(DIST1)</var></code> miles
76 <code>t_<var>V1</var> = <var>round(DIST1 / SPEED1 * 60)</var></code> minutes
77 <code>t_<var>V2</var> = <var>round(DIST2 / SPEED2 * 60)</var></code> minutes</p>
b40264c @jeresig Adding in my initial prototype.
jeresig authored
78 </div>
79 </div>
80 </body>
f161590 @pappy74 added KhanUtil.plural
pappy74 authored
81 </html>
Something went wrong with that request. Please try again.