Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

158 lines (155 sloc) 12.003 kb
<!DOCTYPE html>
<html data-require="math math-format word-problems">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Combinations</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="packing">
<div class="vars" data-ensure="NUM_THINGS &gt; NUM_TAKEN">
<var id="THING">randFromArray([
new Plural(function(num) {
return $.ngettext("shirt", "shirts", num);
}),
new Plural(function(num) {
return $.ngettext("tiger", "tigers", num);
}),
new Plural(function(num) {
return $.ngettext("book", "books", num);
}),
new Plural(function(num) {
return $.ngettext("Fabergé egg", "Fabergé eggs", num);
}),
new Plural(function(num) {
return $.ngettext("sock", "socks", num);
}),
new Plural(function(num) {
return $.ngettext("action figure", "action figures", num);
})
])</var>
<var id="NUM_THINGS">randRange(5,9)</var>
<var id="NUM_TAKEN">randRange(3,5)</var>
<var id="ANSWER">factorial(NUM_THINGS) / (factorial(NUM_THINGS-NUM_TAKEN) * factorial(NUM_TAKEN))</var>
</div>
<p class="problem" data-if="isMale(1)">
<var>person(1)</var> is packing his bags for his vacation. He has
<code><var>NUM_THINGS</var></code> unique <var>plural_form(THING, NUM_THINGS)</var>, but only <code><var>NUM_TAKEN</var></code> fit in his bag.
</p><p class="problem" data-else="">
<var>person(1)</var> is packing her bags for her vacation. She has
<code><var>NUM_THINGS</var></code> unique <var>plural_form(THING, NUM_THINGS)</var>, but only <code><var>NUM_TAKEN</var></code> fit in her bag.
</p>
<p class="question" data-if="isMale(1)">How many different groups of <code><var>NUM_TAKEN</var></code> <var>plural_form(THING, NUM_TAKEN)</var> can he take?</p><p class="question" data-else="">How many different groups of <code><var>NUM_TAKEN</var></code> <var>plural_form(THING, NUM_TAKEN)</var> can she take?</p>
<p class="solution" data-forms="integer"><var>ANSWER</var></p>
<div class="hints">
<p data-if="isMale(1)">
<var>person(1)</var> has <code><var>NUM_TAKEN</var></code> spaces for his <var>plural_form(THING)</var>,
so let's fill them one by one.
At first, <var>person(1)</var> has <code><var>NUM_THINGS</var></code> choices for what to put in the first space.
</p><p data-else="">
<var>person(1)</var> has <code><var>NUM_TAKEN</var></code> spaces for her <var>plural_form(THING)</var>,
so let's fill them one by one.
At first, <var>person(1)</var> has <code><var>NUM_THINGS</var></code> choices for what to put in the first space.
</p>
<p data-if="isMale(1)">
For the second space, he only has <code><var>NUM_THINGS-1</var></code> <var>plural_form(THING, NUM_THINGS-1)</var> left, so there are only
<code><var>NUM_THINGS-1</var></code> choices
of what to put in the second space. So far, it seems like there are <code><var>NUM_THINGS</var> \cdot <var>NUM_THINGS-1</var> =
<var>NUM_THINGS * (NUM_THINGS-1)</var></code> different unique choices <var>person(1)</var> could have made to fill the first two
spaces in his bag. But that's not quite right.
</p><p data-else="">
For the second space, she only has <code><var>NUM_THINGS-1</var></code> <var>plural_form(THING, NUM_THINGS-1)</var> left, so there are only
<code><var>NUM_THINGS-1</var></code> choices
of what to put in the second space. So far, it seems like there are <code><var>NUM_THINGS</var> \cdot <var>NUM_THINGS-1</var> =
<var>NUM_THINGS * (NUM_THINGS-1)</var></code> different unique choices <var>person(1)</var> could have made to fill the first two
spaces in her bag. But that's not quite right.
</p>
<p data-if="isMale(1)">
Why? Because if he picked <var>THING</var> number 3, then
<var>THING</var> number 1, that's the same situation as picking number 1 and then number 3. They both end up in the same bag.
</p><p data-else="">
Why? Because if she picked <var>THING</var> number 3, then
<var>THING</var> number 1, that's the same situation as picking number 1 and then number 3. They both end up in the same bag.
</p>
<p data-if="isMale(1)">
So, if <var>person(1)</var> keeps filling the spaces in his bag, making <code><var>_.map(_.range(NUM_TAKEN), function(l){ return (NUM_THINGS - l);}).join("\\cdot")</var> = \dfrac{<var>NUM_THINGS</var>!}{(<var>NUM_THINGS</var>-<var>NUM_TAKEN</var>)!} = <var> factorial(NUM_THINGS)/factorial(NUM_THINGS-NUM_TAKEN)</var></code> decisions altogether, we've overcounted a bunch of groups.
</p><p data-else="">
So, if <var>person(1)</var> keeps filling the spaces in her bag, making <code><var>_.map(_.range(NUM_TAKEN), function(l){ return (NUM_THINGS - l);}).join("\\cdot")</var> = \dfrac{<var>NUM_THINGS</var>!}{(<var>NUM_THINGS</var>-<var>NUM_TAKEN</var>)!} = <var> factorial(NUM_THINGS)/factorial(NUM_THINGS-NUM_TAKEN)</var></code> decisions altogether, we've overcounted a bunch of groups.
</p>
<p>
How much have we overcounted? Well, for every group of <code><var>NUM_TAKEN</var></code>,
we've counted them as if the order we chose them in
matters, when really it doesn't. So, the number of times we've overcounted each group is the number of ways to order
<code><var>NUM_TAKEN</var></code> things.
</p>
<p>
There are <code><var>NUM_TAKEN</var>! = <var>factorial(NUM_TAKEN)</var></code> ways of ordering <code><var>NUM_TAKEN</var></code>
things, so we've counted each group of <code><var>NUM_TAKEN</var></code> <var>plural_form(THING, NUM_TAKEN)</var>
<code><var>factorial(NUM_TAKEN)</var></code> times.
</p>
<p>
So, we have to divide the number of ways we could have filled the bag in order by number of times we've overcounted our groups.
</p>
<p>
<code> \dfrac{<var>NUM_THINGS</var>!}{(<var>NUM_THINGS</var> - <var>NUM_TAKEN</var>)!} \cdot \dfrac{1}{<var>NUM_TAKEN</var>!}</code> is the number
of groups of <var>plural_form(THING)</var> <var>person(1)</var> can bring.
<br>
Another way to write this is <code> \binom{<var>NUM_THINGS</var>}{<var>NUM_TAKEN</var>} </code>,
or <code><var>NUM_THINGS</var></code> choose <code><var>NUM_TAKEN</var></code>, which is <code><var>ANSWER</var></code>.
</p>
</div>
</div>
<div id="boat">
<div class="vars">
<var id="FRIENDS">randRange(5,6)</var>
<var id="SLOTS">randRange(2,FRIENDS-2)</var>
<var id="ANSWER">factorial(FRIENDS) / (factorial(FRIENDS-SLOTS) * factorial(SLOTS))</var>
</div>
<p class="problem">
You just got a free ticket for a boat ride, and you can bring along <code><var>SLOTS</var></code> friends!
Unfortunately, you have <code><var>FRIENDS</var></code> friends who want to come along.
</p>
<p class="question">How many different groups of friends could you take with you?</p>
<p class="solution" data-forms="integer"><var>ANSWER</var></p>
<div class="hints">
<p>
There are <code><var>SLOTS</var></code> places for your friends on the boat, so let's fill those slots one by one.
For the first slot, we have <code><var>FRIENDS</var></code> different choices we can make (because <code><var>FRIENDS</var></code>
different friends could be in that slot).
</p>
<p>
Once we've filled the first slot, there are <code><var>FRIENDS-1</var></code> friends who could fill the second. So far, if we've
filled the first two slots, and it seems like there are <code><var>FRIENDS</var> \cdot <var>FRIENDS-1</var> = <var>FRIENDS * (
FRIENDS-1)</var> </code> different choices we could have made. But that's not quite true.
</p>
<p>
Why? Because if we picked <var>person(1)</var>, then <var>person(2)</var>, that's the same thing as picking <var>person(2)</var>, then <var>person(1)</var>. They both get to be on the same boat.
</p>
<p>
So, if we continue filling the slots on our boat, making <code><var>_.map(_.range(SLOTS), function(l){ return (FRIENDS - l);}).join("\\cdot")</var> = \dfrac{<var>FRIENDS</var>!}{<var>FRIENDS-SLOTS</var>!} = <var> factorial(FRIENDS)/factorial(FRIENDS-SLOTS)</var></code> decisions altogether, we've overcounted a bunch of groups.
</p>
<p>
How much have we overcounted? Well, for every group of <code><var>SLOTS</var></code>, we've counted them as if the order we chose
them in matters, when really it doesn't. So, the number of times we've overcounted each group is the number of ways to order <code>
<var>SLOTS</var></code> things.
</p>
<p>
There are <code><var>SLOTS</var>! = <var>factorial(SLOTS)</var></code> ways of ordering <code><var>SLOTS</var></code> things,
so we've counted each group of <code><var>SLOTS</var></code> friends <code><var>factorial(SLOTS)</var></code> times.
</p>
<p>
So, we have to divide the number of ways we could have filled the boat in order by number of times we've overcounted our groups:
<br>
<code> \dfrac{<var>FRIENDS</var>!}{<var>FRIENDS-SLOTS</var>!} \cdot \dfrac{1}{<var>SLOTS</var>!}</code> is the number of groups we can bring on the boat trip.
<br>
Another way to write this is <code> \binom{<var>FRIENDS</var>}{<var>SLOTS</var>} </code>, or <code><var>FRIENDS</var></code>
choose <code><var>SLOTS</var></code>, which is <code><var>ANSWER</var></code>.
</p>
</div>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.