This repository has been archived by the owner on May 11, 2021. It is now read-only.
/
probability_1.html
86 lines (78 loc) · 4.17 KB
/
probability_1.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
<!DOCTYPE html>
<html data-require="math math-format probability word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Probability 1</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="marbles">
<div class="vars">
<var id="CONTAINER">randFromArray(["bag", "jar", "box", "goblet"])</var>
<var id="MARBLE">randFromArray(["marble", "ball", "jelly bean"])</var>
<var id="REDMAR">randRange(3, 11)</var>
<var id="GREENMAR">randRange(3, 11)</var>
<var id="BLUEMAR">randRange(3, 11)</var>
<var id="TOTAL">REDMAR + GREENMAR + BLUEMAR</var>
<var id="NOT">rand(2) === 0</var>
<var id="CHOSEN_COLOR, CHOSEN_NUMBER">randFromArray([["red", REDMAR], ["green", GREENMAR], ["blue", BLUEMAR]])</var>
<var id="NUMBER">NOT ? TOTAL - CHOSEN_NUMBER : CHOSEN_NUMBER</var>
</div>
<div class="question">
<p>A <var>CONTAINER</var> contains <code><var>REDMAR</var></code> red <var>MARBLE</var>s,
<code><var>GREENMAR</var></code> green <var>MARBLE</var>s, and <code><var>BLUEMAR</var></code> blue <var>MARBLE</var>s.</p>
<p>If a <var>MARBLE</var> is randomly chosen, what is the probability
that it is <em data-if="NOT">not</em> <var>CHOSEN_COLOR</var>?</p>
</div>
<div class="solution"><var>NUMBER / TOTAL</var></div>
<div class="hints">
<p>There are <code><var>REDMAR</var> + <var>GREENMAR</var> + <var>BLUEMAR</var> = <var>TOTAL</var></code> <var>MARBLE</var>s in the <var>CONTAINER</var>.</p>
<p>There are <code><var>CHOSEN_NUMBER</var></code> <var>CHOSEN_COLOR</var> <var>MARBLE</var>s.
<span data-if="NOT">That means <code><var>TOTAL</var> - <var>CHOSEN_NUMBER</var> = <var>NUMBER</var></code> are <em>not</em> <var>CHOSEN_COLOR</var>.</span></p>
<p>The probability is <code>\displaystyle <var>fractionSimplification(NUMBER, TOTAL)</var></code>.</p>
</div>
</div>
<div id="die">
<div class="vars">
<var id="RESULT_DESC, RESULT_POSSIBLE">randFromArray([
["a 1", [1]],
["a 2", [2]],
["a 3", [3]],
["a 4", [4]],
["a 5", [5]],
["a 6", [6]],
["at least 2", [2, 3, 4, 5, 6]],
["at least 3", [3, 4, 5, 6]],
["at least 4", [4, 5, 6]],
["more than 2", [3, 4, 5, 6]],
["more than 3", [4, 5, 6]],
["more than 4", [5, 6]],
["less than 4", [1, 2, 3]],
["less than 5", [1, 2, 3, 4]],
["less than 6", [1, 2, 3, 4, 5]],
["even", [2, 4, 6]],
["even", [2, 4, 6]],
["odd", [1, 3, 5]],
["odd", [1, 3, 5]],
["prime", [2, 3, 5]]
])</var>
<var id="RESULT_COUNT">RESULT_POSSIBLE.length</var>
</div>
<div class="question">
<p>A fair six-sided die is rolled. What is the probability that the
result is <var>RESULT_DESC</var>?</p>
</div>
<div class="solution"><var>RESULT_COUNT / 6</var></div>
<div class="hints">
<p>When rolling a die, there are <code>6</code> possibilities: 1, 2, 3, 4, 5, and 6.</p>
<p data-if="RESULT_COUNT === 1">In this case, only <code>1</code> result is favorable: the number <var>RESULT_POSSIBLE[0]</var>.</p>
<p data-else="">In this case, <code><var>RESULT_COUNT</var></code> results are favorable: <var>toSentence(RESULT_POSSIBLE)</var>.</p>
<p>The probability is <code>\displaystyle <var>fractionSimplification(RESULT_COUNT, 6)</var></code>.</p>
</div>
</div>
</div>
</div>
</body>
</html>