Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
83 lines (79 sloc) 3.87 KB
<!DOCTYPE html>
<html data-require="math math-format word-problems stat">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Estimation with decimals</title>
<script src="../khan-exercise.js"></script>
<style>
.estimation span {
width: 100px;
}
.estimation span:first-child {
width: 50px;
}
</style>
</head>
<body>
<div class="exercise">
<div class="problems">
<div>
<div class="vars">
<var id="VALUES">$.map( randRange( 1000, 16000, randRange( 3, 7 ) ), function( n ){ return ( n / 1000 ).toFixed( randRange( 1, 2 ) ); } )</var>
<var id="ANSWER">sum( $.map( VALUES, round ) )</var>
<var id="TYPES">randFromArray( [ [ "jogging", "ran", "mile" ], [ "riding a bicycle ", "traveled", "mile" ], [ "collecting mushrooms", "collected", "pound" ], [ "painting a roof", "painted", "square foot" ], [ "harvesting grain", "harvested", "tonne" ] ] )</var>
<var id="ACC">0</var>
<var id="SIZE">
$.map( VALUES, function( i ){
if ( round( i ) &lt; i ) {
return "smaller than";
}
else{
return "bigger or equal to";
}
} )
</var>
<var id="SUM">
(function() {
var sum = 0;
$.each( VALUES, function( i, val ) {
sum += parseFloat( val );
});
return roundTo( 2, sum );
})()
</var>
</div>
<p><var>person( 1 )</var> has been <var>TYPES[ 0 ]</var> every day for the last <var>VALUES.length</var> days.</p>
<p class="question">Given that <var>person( 1 )</var> <var>TYPES[ 1 ]</var> the following amounts (in <var>plural( TYPES[ 2 ] )</var>) each day, estimate how much <var>he( 1 )</var> <var>TYPES[ 1 ]</var> in total by first rounding each amount to the nearest whole number and then summing all the rounded amounts.</p>
<div class="fake_header estimation">
<span>Day<br /> <span style="color:white">" "</span></span>
<span>Amount <br /><font size="2">(in <var>plural( TYPES[ 2 ] )</var>)</font></span>
</div>
<div class="fake_row estimation" data-each="VALUES as i, val">
<span><var>i+1</var></span>
<span><var>val</var></span>
</div>
<p><br />Note that if you first sum the exact amounts (<var>SUM.toFixed( 2 )</var>) and then round, you'll get <var>round( SUM )</var>. For fun, pay attention to how this number compares with your estimate.</p>
<p class="solution" data-type="multiple">
<span class="sol" data-forms="integer"><var>ANSWER</var></span> <var>plural( TYPES[ 2 ] )</var>
</p>
<div class="hints">
<p>Round all the numbers to the nearest <var>TYPES[ 2 ]</var> and add them up.</p>
<div class="fake_header estimation">
<span>Day</span>
<span>Amount</span>
<span>Rounded</span>
<span>Running total</span>
</div>
<div class="fake_row estimation" data-each="VALUES as i, val">
<span><var>i+1</var></span>
<span><var>val</var></span>
<span><var>round( val )</var></span>
<span><var>ACC += round( val )</var></span>
</div>
<p>Therefore the estimate is <code><var>ANSWER</var></code> <var>plural( TYPES[ 2 ] )</var>.</p>
</div>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.