Permalink
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (78 sloc) 4.17 KB
<!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>