Permalink
Fetching contributors…
Cannot retrieve contributors at this time
129 lines (117 sloc) 7.34 KB
<!DOCTYPE html>
<html data-require="math word-problems stat">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Average word problems</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div>
<div class="vars" data-ensure="SUM % LENGTH === 0">
<var id="LENGTH">randRange(4, 6)</var>
<var id="SCORES">randRange(75, 98, LENGTH)</var>
<var id="SUM">sum(SCORES)</var>
</div>
<div class="question">
<p data-if="isMale(1)">
In his <var>course(1)</var> class, <var>person(1)</var> took <code><var>LENGTH</var></code> <var>plural_form(exam(1), LENGTH)</var>.
His scores were <var>toSentenceTex(SCORES)</var>.
</p><p data-else="">
In her <var>course(1)</var> class, <var>person(1)</var> took <code><var>LENGTH</var></code> <var>plural_form(exam(1), LENGTH)</var>.
Her scores were <var>toSentenceTex(SCORES)</var>.
</p>
<p data-if="isMale(1)">What was his average score on the <var>plural_form(exam(1))</var>?</p>
<p data-else="">What was her average score on the <var>plural_form(exam(1))</var>?</p>
</div>
<div class="solution"><var>SUM / LENGTH</var></div>
<div class="hints">
<p data-if="isMale(1)">The average is the sum of his scores divided by the number of scores.</p>
<p data-else="">The average is the sum of her scores divided by the number of scores.</p>
<p>There are <code><var>LENGTH</var></code> scores and their sum is <code><var>SCORES.join(" + ")</var> = <var>SUM</var></code>.</p>
<p data-if="isMale(1)">His average score is <code><var>SUM</var> \div <var>LENGTH</var> = <var>SUM / LENGTH</var></code>.</p>
<p data-else="">Her average score is <code><var>SUM</var> \div <var>LENGTH</var> = <var>SUM / LENGTH</var></code>.</p>
</div>
</div>
<div>
<div class="vars" data-ensure="ANS &lt;= 100">
<var id="COUNT">randRange(3, 7)</var>
<var id="OLD_AVG">randRange(77, 88)</var>
<var id="NEW_AVG">randRange(OLD_AVG + 2, 99)</var>
<var id="ANS">NEW_AVG + COUNT * (NEW_AVG - OLD_AVG)</var>
</div>
<div class="question">
<p data-if="isMale(1)">
On the first <code><var>COUNT</var></code> <var>plural_form(exam(1), COUNT)</var> of his <var>course(1)</var> class,
<var>person(1)</var> got an average score of <code><var>OLD_AVG</var></code>.
</p><p data-else="">
On the first <code><var>COUNT</var></code> <var>plural_form(exam(1), COUNT)</var> of her <var>course(1)</var> class,
<var>person(1)</var> got an average score of <code><var>OLD_AVG</var></code>.
</p>
<p data-if="isMale(1)">
What does he need on the next <var>exam(1)</var> to have an overall average of <code><var>NEW_AVG</var></code>?
</p><p data-else="">
What does she need on the next <var>exam(1)</var> to have an overall average of <code><var>NEW_AVG</var></code>?
</p>
</div>
<div class="solution"><var>ANS</var></div>
<div class="hints">
<p data-if="isMale(1)">Let his score on the next <var>exam(1)</var> be <code>x</code>.</p>
<p data-else="">Let her score on the next <var>exam(1)</var> be <code>x</code>.</p>
<p data-if="isMale(1)">The sum of all of his scores is then <code><var>COUNT</var> \cdot <var>OLD_AVG</var> + x</code>.</p>
<p data-else="">The sum of all of her scores is then <code><var>COUNT</var> \cdot <var>OLD_AVG</var> + x</code>.</p>
<p>The same sum must also be equal to <code><var>COUNT + 1</var> \cdot <var>NEW_AVG</var></code>.</p>
<p>So, <code><var>COUNT</var> \cdot <var>OLD_AVG</var> + x = <var>COUNT + 1</var> \cdot <var>NEW_AVG</var></code>
<p><code>\begin{eqnarray}
<var>COUNT</var> \cdot <var>OLD_AVG</var> + x &amp;=&amp; <var>COUNT + 1</var> \cdot <var>NEW_AVG</var> \\
<var>COUNT * OLD_AVG</var> + x &amp;=&amp; <var>(COUNT + 1) * NEW_AVG</var> \\
x &amp;=&amp; <var>(COUNT + 1) * NEW_AVG</var> - <var>COUNT * OLD_AVG</var> \\
x &amp;=&amp; <var>ANS</var> \\
\end{eqnarray}
</code></p>
</div>
</div>
<div>
<div class="vars" data-ensure="SUM % (COUNT + REMAINING) === 0">
<var id="COUNT">randRange(3, 6)</var>
<var id="REMAINING">randRange(2, COUNT - 2)</var>
<var id="OLD_AVG">randRange(77, 88)</var>
<var id="SUM">COUNT * OLD_AVG + 100 * REMAINING</var>
<var id="NEW_AVG">SUM / (COUNT + REMAINING)</var>
</div>
<div class="question">
<p data-if="isMale(1)">
<var>person(1)</var> has taken <code><var>COUNT</var></code> <var>plural_form(exam(1), COUNT)</var>
and his average score so far is <code><var>OLD_AVG</var></code>.
</p><p data-else="">
<var>person(1)</var> has taken <code><var>COUNT</var></code> <var>plural_form(exam(1), COUNT)</var>
and her average score so far is <code><var>OLD_AVG</var></code>.
</p>
<p data-if="isMale(1)">
If he gets <code>100</code>, a perfect score, on the remaining <code><var>REMAINING</var></code>
<var>plural_form(exam(1), REMAINING)</var>, what will his new average be?
</p><p data-else="">
If she gets <code>100</code>, a perfect score, on the remaining <code><var>REMAINING</var></code>
<var>plural_form(exam(1), REMAINING)</var>, what will her new average be?
</p>
</div>
<div class="solution"><var>NEW_AVG</var></div>
<div class="hints">
<p data-if="isMale(1)">
If he gets <code>100</code> on the remaining <var>plural_form(exam(1))</var>, the sum of his scores will be
<code><var>COUNT</var> \cdot <var>OLD_AVG</var> + <var>REMAINING</var> \cdot <var>100</var> = <var>SUM</var></code>.
</p><p data-else="">
If she gets <code>100</code> on the remaining <var>plural_form(exam(1))</var>, the sum of her scores will be
<code><var>COUNT</var> \cdot <var>OLD_AVG</var> + <var>REMAINING</var> \cdot <var>100</var> = <var>SUM</var></code>.</p>
<p data-if="isMale(1)">
His overall average will then be <code><var>SUM</var> \div <var>COUNT + REMAINING</var> = <var>NEW_AVG</var></code>.
</p><p data-else="">
Her overall average will then be <code><var>SUM</var> \div <var>COUNT + REMAINING</var> = <var>NEW_AVG</var></code>.
</p>
</div>
</div>
</div>
</div>
</body>
</html>