Permalink
Fetching contributors…
Cannot retrieve contributors at this time
114 lines (110 sloc) 6.59 KB
<!DOCTYPE html>
<html data-require="math word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Divisibility 0.5</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="factor">
<div class="vars">
<var id="B">randRange( 2, 9 )</var>
<var id="FACTOR">floor( randRange( B * 2, 100 ) / B )</var>
<var id="A">FACTOR * B</var>
<var id="FACTORIZATION_A">getPrimeFactorization( A )</var>
<var id="FACTORIZATION_B">getPrimeFactorization( B )</var>
<var id="WRONGFACTORS">
(function() {
var wrongs = [];
var i = 2;
while( i &lt; 10 ) {
if ( A % i !== 0 ) {
wrongs.push( i );
}
i++;
}
var shuffled = shuffle( wrongs, 4 );
shuffled.push( B );
return shuffled;
})()
</var>
<var id="WRONGFACTORS_SORTED">sortNumbers( WRONGFACTORS )</var>
</div>
<p class="question">Which of the following numbers is a factor of <var>A</var>?</p>
<p><code>\large{<var>WRONGFACTORS_SORTED.join( "," )</var>}</code></p>
<p class="solution"><code><var>B</var></code></p>
<ul class="choices" data-category="true">
<li data-each="WRONGFACTORS_SORTED as index, wrong"><code><var>wrong</var></code></li>
</ul>
<div class="hints">
<p>By definition, a factor of a number will divide evenly into that number. We can start by dividing <code><var>A</var></code> by each of our answer choices.</p>
<div>
<p data-each="WRONGFACTORS_SORTED as WRONG"><code><var>A</var> \div <var>WRONG</var> = <var>floor( A / WRONG )</var><span data-if="A % WRONG !== 0">\text{ R }<var>( A % WRONG )</var></span></code></p>
</div>
<p>
The only answer choice that divides into <code>\blue{<var>A</var>}</code> with no remainder is <code>\pink{<var>B</var>}</code>.
<code>\quad<var>FACTOR</var> \times \pink{<var>B</var>} = \blue{<var>A</var>}</code>.
</p>
<div>
<p>We can check our answer by looking at the prime factorization of both numbers. Notice that the prime factors of <code><var>B</var></code> are contained within the prime factors of <code><var>A</var></code>.</p>
<p><code><var>A</var> = <var>FACTORIZATION_A.join( "\\times" )</var>\qquad\qquad<var>B</var> = <var>FACTORIZATION_B.join( "\\times" )</var></code>
</p></div>
<p>
Therefore, <code>\pink{<var>B</var>}</code> is a factor of <code>\blue{<var>A</var>}</code>.
</p>
</div>
</div>
<div id="multiple">
<div class="vars">
<var id="B">randRange( 2, 9 )</var>
<var id="FACTOR">floor( randRange( B * 2, 100 ) / B )</var>
<var id="A">FACTOR * B</var>
<var id="FACTORIZATION_A">getPrimeFactorization( A )</var>
<var id="FACTORIZATION_B">getPrimeFactorization( B )</var>
<var id="WRONGMULTIPLES">
(function() {
var wrongs = [];
while( wrongs.length &lt; 4 ) {
var i = randRange( 1, 100 );
if ( i % B !== 0 ) {
wrongs.push( i );
}
}
var shuffled = shuffle( wrongs, 4 );
shuffled.push( A );
return shuffled;
})()
</var>
<var id="WRONGMULTIPLES_SORTED">sortNumbers( WRONGMULTIPLES )</var>
</div>
<p class="question">Which of the following numbers is a multiple of <var>B</var>?</p>
<p><code>\large{<var>WRONGMULTIPLES_SORTED.join( "," )</var>}</code></p>
<p class="solution"><code><var>A</var></code></p>
<ul class="choices" data-category="true">
<li data-each="WRONGMULTIPLES_SORTED as index, wrong"><code><var>wrong</var></code></li>
</ul>
<div class="hints">
<div>
<p>The multiples of <code><var>B</var></code> are <code><var>B</var></code>, <code><var>B*2</var></code>, <code><var>B*3</var></code>, <code><var>B*4</var></code>...</p>
<p>In general, any number that leaves no remainder when divided by <code><var>B</var></code> is considered a multiple of <code><var>B</var></code>.</p>
</div>
<div>
<p>We can start by dividing each of our answer choices by <code><var>B</var></code>.</p>
<p data-each="WRONGMULTIPLES_SORTED as WRONG"><code><var>WRONG</var> \div <var>B</var> = <var>floor( WRONG / B )</var><span data-if="WRONG % B !== 0">\text{ R }<var>( WRONG % B )</var></span></code></p>
</div>
<p>
The only answer choice that leaves no remainder after the division is <code>\blue{<var>A</var>}</code>.
<code>\quad<var>FACTOR</var> \times \pink{<var>B</var>} = \blue{<var>A</var>}</code>.</p>
<div>
<p>We can check our answer by looking at the prime factorization of both numbers. Notice that the prime factors of <code><var>B</var></code> are contained within the prime factors of <code><var>A</var></code>.</p>
<p><code><var>A</var> = <var>FACTORIZATION_A.join( "\\times" )</var>\qquad\qquad<var>B</var> = <var>FACTORIZATION_B.join( "\\times" )</var></code>
</p></div>
<p>Therefore, <code>\blue{<var>A</var>}</code> is a multiple of <code>\pink{<var>B</var>}</code>.</p>
</div>
</div>
</div>
</div>
</body>
</html>