<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Math &#8211; Combinations &#8211; BetterExplained</title>
	<atom:link href="https://betterexplained.com/articles/series/math-combinations/feed/" rel="self" type="application/rss+xml" />
	<link>https://betterexplained.com</link>
	<description>Math lessons that click</description>
	<lastBuildDate>Thu, 17 Sep 2026 23:28:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Why do we multiply combinations?</title>
		<link>https://betterexplained.com/articles/why-do-we-multiply-combinations/</link>
					<comments>https://betterexplained.com/articles/why-do-we-multiply-combinations/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Tue, 15 Aug 2017 18:03:49 +0000</pubDate>
				<category><![CDATA[Math]]></category>
				<category><![CDATA[Combination]]></category>
		<guid isPermaLink="false">https://betterexplained.com/?p=10358</guid>

					<description><![CDATA[When working on a combination problem, we usually multiply. But sometimes addition shows up -- how do we know which is which? Here's a few mental models I use to keep them straight. Mental Model: Different Dimensions Let's take a simple situation: You have 4 shirts and 8 pants, how many outfits can you make? [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>When working on a combination problem, we usually multiply. But sometimes addition shows up -- how do we know which is which?</p>

<p>Here's a few mental models I use to keep them straight.</p>

<h2>Mental Model: Different Dimensions</h2>

<p>Let's take a simple situation: You have 4 shirts and 8 pants, how many outfits can you make?</p>

<p>In essence, you are picking a spot on this grid:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2017/08/shirt-and-pants-grid.png" alt="grid of possibilities" class="webpexpress-processed"></p>

<p>Shirts and Pants exist in separate dimensions, whose area represents distinct solutions. We can pick any spot <em>in the grid</em> and we have 4 x 8 = 32 options.</p>

<p>Now, suppose we had 4 shirts and 8 pants and had to pick a single item to sell. Here, they lie along the same "clothing item" dimension:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2017/08/shirts-pants-same-dimension.png" alt="single line of possibilities" class="webpexpress-processed"></p>

<p>We can randomly pick any point <em>along the line</em> and have 4 + 8 = 12 options.</p>

<p>Think "different dimensions vs. same dimension" or "grid vs. line".</p>

<h2>Mental Model: AND vs OR</h2>

<p>Another interpretation is AND (multiplication) vs. OR (addition).</p>

<p>Let's say we must pick one of 4 shirts AND one of 8 pants. We need both to stay out of trouble. The scenario is:</p>

<p><code>pick among 4 shirts AND among 8 pants = 4 * 8 = 32 choices</code></p>

<p>What if McDonald's softens their regulations and allows a shirt OR pants? (But not both -- yikes.) Then, we have:</p>

<p><code>pick among 4 shirts OR among 8 pants = 4 + 8 = 12 choices</code></p>

<p>Writing out the scenario is often easier to think through, especially with numerous dimensions (shirts, pants, hats, shoes).</p>

<p>As you internalize the analogies, you'll quickly recognize whether multiplication or addition is needed.</p>

<h2>Example: Combination &amp; Permutation Formula</h2>

<p>Let's go meta for a minute. The <a href="https://betterexplained.com/articles/easy-permutations-and-combinations/">permutation formula</a> is:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/08f8689a0bdd491e0acc9bbd27fe4714.png' width='146' height='43' alt='\displaystyle{ P(n,k) = \frac{n!}{(n-k)!} }' class='tex'></p>

<p>How can we think about this?</p>

<p>The numerator (<img src="https://betterexplained.com/latex/adf65e8eac4805481924.png" alt="$n!$" width="16" height="14" style="vertical-align:-0.2px" class="bex-math"></img>) is the max volume assuming each of the <img src="https://betterexplained.com/latex/e5e0f1078316e19bf059.png" alt="$n$" width="11" height="9" style="vertical-align:-0.2px" class="bex-math"></img> choices has its own dimension. The number of rearrangements of 8 people is 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1.</p>

<p>But suppose we only care about the first 3 decisions -- picking a Gold, Silver and Bronze among 8 contestants. In this case, we shrink our solution space by dividing out the 5 dimensions we aren't using (which has 5! options on its own). We are left with 8! / 5! = 8 * 7 * 6 = 336 choices, with the general formula <img src="https://betterexplained.com/latex/04eb6fb5968885c879fc.png" alt="$\frac{n!}{(n-k)!}$" width="46" height="27" style="vertical-align:-9.9px" class="bex-math"></img>.</p>

<p>(If multiplication creates dimensions, then division should remove them.)</p>

<p>Now, let's say the medals are identical: we're giving a tin can to 3 out of 8 people. We need to further remove dimensions, because we have 3! = 3 * 2 * 1 = 6 redundancies for each permutation in our solution space. We again shrink our solution space:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/ac6fd7e067169bf05ed91601033aa5b1.png' width='317' height='39' alt='\displaystyle{C(n,k) = \frac{\text{permutation count}}{\text{redundancies}} = \frac{P(n,k)}{k!} }' class='tex'></p>

<p>(I imagine the solution space volume getting denser.)</p>

<p>Ah! That's what's happening with the combination and permutation formula. We create the max volume and shrink it by the dimensions we are not using. Mentally translate the scenario into a version that makes sense to you.</p>

<h2>Example: Flipping Coins</h2>

<p>Here's how I think through a few sample problems.</p>

<p><em>You flip a coin 10 times. How many ways can you get at least 7 heads?</em></p>

<p>First off, the total number of possibilities is 2^10 = 1024. Intuitively, I see each flip as a decision along a different dimension, not the same number line. This means we have 2 * 2 * 2 *... possibilities, not 2 + 2+ 2 + ... possibilities.</p>

<p>Geometrically, this would be a 10-dimensional "choice space", or, written out:</p>

<p><code>(Heads OR tails) AND (Heads OR tails) AND (Heads OR tails) AND ...</code></p>

<p>Ok. Now, how can we get at least 7 heads? That means we had 0 tails [10 heads], 1 tails [9 heads], 2 tails [8 heads], or 3 tails [7 heads].</p>

<p>Switching to the written description, this becomes:</p>

<p><code>choices we want = (0 tails OR 1 tail OR 2 tails OR 3 tails)</code></p>

<p>Given our 10 flips, the number of outcomes are:</p>

<ul>
<li>0 tails = 1 choice (all heads)</li>
<li>1 tail = 10 choices (exactly one flip was tails)</li>
<li>2 tails = C(10,2) = <code>10*9/(2*1) = 45 choices</code> based on the combination formula</li>
<li>3 tails = C(10,3) = <code>10 * 9 * 8 / (3 * 2 * 1) = 720 / 6 = 120 choices</code></li>
</ul>

<p>So, the total is</p>

<p><code>choices we want = (1 + 10 + 45 + 120) = 176</code></p>

<p>And for kicks, the chance of seeing this happen is:</p>

<p><code>176 / 1024 = 17.2%</code></p>

<p>Multiplication goes beyond "repeated addition". It's a general notion of combining for which I'm still discovering interpretations. Let's not get tied into a single meaning.</p>

<p>Happy math.</p>

<h2>Appendix: Computer Programming</h2>

<p>Turning AND/OR statements into arithmetic maps nicely to Boolean logic.</p>

<p>If A and B are variables with the values 1 or 0, we can write:</p>

<ul>
<li><code>A AND B = A * B</code></li>
<li><code>A OR B = A + B</code></li>
</ul>

<p>In most languages, a positive number evaluates to "true", so A + B = 2 is true. Note that this OR is an "inclusive OR" that allows both values to be true. To force an exclusive OR, we could take the remainder after dividing by two:</p>

<ul>
<li><code>A XOR B = (A + B) % 2</code></li>
</ul>

<p>Most programming languages have separate operators for AND (<code>&amp;&amp;</code>), OR (<code>||</code>) and XOR (<code>^</code>), but it's nice seeing how logic works with regular arithmetic.</p>

<p>Additionally, "if/then/else" statements can be converted to arithmetic.</p>

<p>If <code>y</code> is a variable (1 or 0) that determines a result, instead of:</p>

<pre>
if (y) {
   result = ResultIfTrue;
}
else {
   result = ResultIfFalse;
}
</pre>

<p>we can use the single statement:</p>

<p><code>result = y * ResultIfTrue + (1 - y) * ResultIfFalse</code></p>

<p>This version avoids the needs for branching, which is expensive for a CPU, and is a formula we can optimize with Calculus (used in machine learning algorithms).</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/why-do-we-multiply-combinations/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		

			</item>
	<item>
		<title>Navigate a Grid Using Combinations And Permutations</title>
		<link>https://betterexplained.com/articles/navigate-a-grid-using-combinations-and-permutations/</link>
					<comments>https://betterexplained.com/articles/navigate-a-grid-using-combinations-and-permutations/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Tue, 20 Oct 2009 17:25:20 +0000</pubDate>
				<category><![CDATA[Math]]></category>
				<category><![CDATA[Combination]]></category>
				<category><![CDATA[Permutation]]></category>
		<guid isPermaLink="false">http://betterexplained.com/?p=205</guid>

					<description><![CDATA[Puzzles can help develop your intuition -- figuring how to navigate a grid helped me understand combinations and permutations. Suppose you're on a 4 × 6 grid, and want to go from the bottom left to the top right. How many different paths can you take? Avoid backtracking -- you can only move right or [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Puzzles can help develop your intuition -- figuring how to navigate a grid helped me understand combinations and permutations.</p>

<p>Suppose you're on a 4 × 6 grid, and want to go from the bottom left to the top right. How many different paths can you take? Avoid backtracking -- you can only move right or up.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/grid/grid_paths.png" alt="number of paths in grid" class="webpexpress-processed"></p>

<p>Spend a few seconds thinking about how you'd figure it out.</p>

<h2>Insight: Convert Pictures To Text</h2>

<p>When considering the possible paths (tracing them out with your finger), you might whisper "Up, right, up, right...".</p>

<p>Why not write those thoughts down? Using "u" and "r" we can write out a path:</p>

<pre><code>r r r r r r r u u u u
</code></pre>

<p>That is, go all the way right (6 r's), then all the way up (4 u's). The path in the diagram would be:</p>

<pre><code>r r r r u u u u r r
</code></pre>

<p>Using the text interpretation, the question becomes "How many ways can we re-arrange the letters <code>rrrrrruuuu</code>?"</p>

<p>Ah, the ubiquitous <a href="https://betterexplained.com/articles/easy-permutations-and-combinations/">combination/permutation problem</a> -- never thought it'd be useful, eh?</p>

<h2>Understanding Combinations And Permutations</h2>

<p>There's several ways to see combination and permutation problems. Once the first explanation clicks, we can go back and see it a different way. When trying to <a href="https://betterexplained.com/articles/developing-your-intuition-for-math/">build math intuition</a> for a problem, I imagine several mental models circling a core idea. Starting with one insight, I work around to the others.</p>

<h2>Approach 1: Start The Same</h2>

<p>Instead of having 6 rights at 4 ups, imagine we start with 10 rights (<code>r r r r r r r r r r</code>).</p>

<p>Clearly this won't do: we need to change 4 of those rights into ups. How many ways can we pick 4 rights to change?</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/grid/grid_start_similar.png" alt="convert grid paths to letters" class="webpexpress-processed"></p>

<p>Well, we have 10 choices for the first 'right' to convert (see the <a href="https://betterexplained.com/articles/easy-permutations-and-combinations/">combinations article</a>). And 9 for the second, 8 for the third, and 7 choices for the final right-to-up conversion. There are 10 * 9 * 8  * 7 = 10!/6! = 5040 possibilities.</p>

<p>But, wait! We need to remove the redundancies: after all, converting moves #1 #2 #3 and #4 (in that order) is the same as converting #4 #3 #2 #1&#46; We have 4! (4 * 3 * 2 *  1 = 24) ways to rearrange the ups we picked, so we finally get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/0150695d6544b852dd602b95908e47e9.png' width='178' height='39' alt='\displaystyle{\frac{(10!/6!)}{4!} =  \frac{5040}{24} = 210 }' class='tex'></p>

<p>We're just picking the items to convert (10!/6!) and dividing out the redundancies (4!).</p>

<h2>Approach 2: Just Use the Combination Formula</h2>

<p>Halfway through that explanation, you might have realized we were recreating the combination formula:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/bcfbb2fb7c0d1a3ec67f47f887aebe16.png' width='114' height='18' alt='\displaystyle{C(10,4) = 210}' class='tex'></p>

<p>That's the shortcut when you know order doesn't matter. However, sometimes I'm not sure whether I need a permutation or combination from the outset. While saying "Just use C(10,4)" may be accurate, it's not helpful as a teaching tool. Sometimes it helps to re-create the situation on your own.</p>

<h2>Approach 3: Start Different</h2>

<p>Here's another approach: instead of letting each r and u be interchangeable, label the 'right' moves r1 to r6, and the 'up' moves u1 to u4&#46; How many ways can we re-arrange these 10 items?</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/grid/grid_order_unique.png" alt="remove duplicate orderings" class="webpexpress-processed"></p>

<p>This question is easy: 10! = 3,628,800 (wow, big number). We have 10 choices for the 1st move, 9 for the second, and so on, until we have 2 choices for the 9th and only 1 for the last. Cool.</p>

<p>Of course, we know that "r1 r2 u1 u2" is the same path as "r2 r1 u2 u1". We can shuffle the r's and u's in their own subgroups and the path will stay the same.</p>

<ul>
<li>How many ways can we shuffle all 10? 10! = 3,628,800</li>
<li>How many ways can we shuffle 6 r's? 6! = 720</li>
<li>How many ways can we shuffle 4 u's? 4! = 24</li>
</ul>

<p>So, we start with the total number of possibilities (10! = 3,628,800) and divide out the cases where we shuffle the r's (6! = 720) and the u's (4! = 24):</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/c3645d16f964630949d783bf277db37e.png' width='232' height='18' alt='\displaystyle{10! / 6! / 4! = 10! / (6! \cdot 4!) = 210}' class='tex'></p>

<p>Neat! It's cool seeing the same set of multiplications and divisions in different ways, just by regrouping them.</p>

<h2>Why is this useful?</h2>

<p>One goal is to learn how problems can be transformed. Remember that painting of the old lady &amp; young woman?</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/grid/youngwomanoldlady.jpg" alt="illusion" class="webpexpress-processed"></p>

<p>Do you see both? Can you switch between them? Isn't that cool?</p>

<p>Part of the fun of the grid-path puzzle is seeing how to look at a problem using a visual or text metaphor. The more math you learn, the more models you have available, and you can turn problems into each other.</p>

<p>This doesn't have to be "practical" -- it's fun to see how listing out paths can be done simply using letters on paper.</p>

<p>In math lingo, problems which can be converted to each other are "isomorphic". Mathematically, they may be the same -- but from a human perspective, one may be easier than the other (like seeing the old woman or young woman first).</p>

<p>For the grid puzzle, we used each perspective where comfortable:</p>

<ul>
<li><strong>Visualizing the grid</strong> to understand the general problem and see a single path.</li>
<li><strong>Write the paths as text</strong> to see the general format of all paths &amp; an easy method to enumerate them</li>
</ul>

<p>And that's the key lesson: <strong>It's completely fine to use one model to understand the idea, and another to work out the details.</strong> Math becomes difficult when we think there's only one way to approach it.</p>

<h2>Variations and Extensions</h2>

<p>Now that we've been building our mental models, let's tackle some harder problems.</p>

<p>Imagine your "grid" is actually in 3 dimensions. This is harder to draw, but the text representation keeps on working. Let's say we have a cube (x, y and z dimensions) that is 5 units long on each side. How many paths are there from one corner to its opposite?</p>

<p>Hrm. In this case, I might try the second approach, where we listed out all the possibilities. Assume we label each move differently: we have 5 uniquely-labeled moves of each type (x1-x5, y1-y5, z1-z5). We can arrange these in 15! ways (it's huge: 1.3 trillion). But, we need to remember to divide out the redundancies for each dimension.</p>

<p>There are 5! ways to rearrange the 5 identical motions in each direction, and we divide them out:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/f26b024061381e029db2bdd625a4d01e.png' width='317' height='18' alt='\displaystyle{15! / 5! / 5! / 5! = 15!/(5!\cdot 5!\cdot 5!) = 756,756}' class='tex'></p>

<p>Wow, that's huge number of paths on a small cube! Earlier today you'd have trouble with the question -- I know I would have. But starting with the grid example and converting it to text, we've beefed up our model to handle 3 dimensions. Paths in four, five or 10-d should be no problem.</p>

<h2>Redefining The Problem</h2>

<p>Here's the fun part: instead of changing how we see the solution, why not change the <strong>problem</strong>? What else could "Find paths on a grid" represent?</p>

<ul>
<li><p><strong>Trap platform</strong>: Let's say you're making a set of trapdoors 4 × 6, with only 1 real path through (the others drop you into a volcano). What are the chances someone randomly walks through? With a 4×6 it's 210, as before. With a 12×12 grid it's 24!/12!12! = 2.7 million paths, with only 1 correct one.</p></li>
<li><p><strong>Order of operations</strong>: Suppose you have 10 sets of exercises to do: 4 identical leg exercises, and 6 identical arm exercises. How many different routines can you pick? This is the same as navigating the path, except the axis labels are "legs" and "arms" instead of "right" and "up".</p></li>
<li><p><strong>Random walk</strong>. Suppose we know an object moves randomly up or right. What's the chance it hits our desired endpoint after 10 steps? Well, there are 2^10 = 1024 ways to move up or right (pick "u" or "r" 10 times), and 210 ways to get to our exact destination. Therefore, you can expect to hit our spot 210 / 1024 = 20.5% of the time!</p></li>
</ul>

<p>Here's a calculator to play with a few variations:</p>

<iframe src="https://instacalc.com/2335/embed" frameborder="0" marginwidth="0" marginheight="0" width="450" height="410"></iframe>

<h2>Onward and Upward</h2>

<p>Puzzles are a fun way to learn new mental models, and deepen your understanding for the ones you're familiar with. While I might "know" combinations and permutations, it's not until I recognize them in the wild do I feel really comfortable. Ideas do no good sitting inside your head like artifacts in a museum -- they need to be taken out and played with. Happy math.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/navigate-a-grid-using-combinations-and-permutations/feed/</wfw:commentRss>
			<slash:comments>72</slash:comments>
		

			</item>
	<item>
		<title>How To Understand Combinations Using Multiplication</title>
		<link>https://betterexplained.com/articles/how-to-understand-combinations-using-multiplication/</link>
					<comments>https://betterexplained.com/articles/how-to-understand-combinations-using-multiplication/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Mon, 25 Feb 2008 16:00:49 +0000</pubDate>
				<category><![CDATA[Math]]></category>
				<category><![CDATA[Combination]]></category>
		<guid isPermaLink="false">http://betterexplained.com/articles/how-to-understand-combinations-using-multiplication/</guid>

					<description><![CDATA[Multiplication is a wonderful little operation. Depending on the context, it can Scale or stretch a number Rotate a vector , without needing sine or cosine And today we’ll see yet another use: listing combinations . Revisiting multiplication has a few uses: It demystifies other parts of math . The binomial theorem, Boolean algebra (used [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Multiplication is a wonderful little operation. Depending on the context, it can</p>

<ul>
<li><a href="https://betterexplained.com/articles/rethinking-arithmetic-a-visual-guide/">Scale or stretch</a> a number</li>
<li><a href="https://betterexplained.com/articles/a-visual-intuitive-guide-to-imaginary-numbers/" title="complex multiplication">Rotate a vector</a>, without needing sine or cosine</li>
</ul>

<p>And today we’ll see yet another use: <strong>listing combinations</strong>.</p>

<p>Revisiting multiplication has a few uses:</p>

<ul>
<li><strong>It demystifies other parts of math</strong>. The binomial theorem, Boolean algebra (used in computer circuits) and even parts of calculus become easier with a new interpretation of “multiplication”.</li>
<li><strong>It keeps our brain fresh.</strong><a href="https://betterexplained.com/articles/how-to-develop-a-mindset-for-math/">Math gives us models to work with</a>, and it’s good to see how one model can have many uses. Even a wrench can drive nails, once you understand the true nature of “being a hammer” (<em>very Zen, eh?</em>).</li>
</ul>

<p>The long multiplication you learned in elementary school is quite useful: we can find the possibilities of several coin flips, for example. Let’s take a look.</p>

<h2>You’ve Been Making Combinations All Along</h2>

<p>How would you find 12 × 34? It’s ok, you can do it on paper:</p>

<p><center>
<img decoding="async" src="https://betterexplained.com/wp-content/uploads/mult/basic_multiplication.png" alt="Basic multiplication" title="Basic multiplication" class="webpexpress-processed"></center></p>

<p><em>“Well, let’s see… 4 times 12 is 48&#46; 3 times 12 is 36… but it’s shifted over one place, so it’s 360&#46; Add 48 and 360 and you get… uh… carry the 1… 408&#46; Phew.”</em></p>

<p>Not bad. But instead of doing 12 × 34 all at once, break it into steps:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/mult/expanding_multiplication.png" alt="Expanding Multiplication" title="Expanding Multiplication" class="webpexpress-processed"></p>

<p>What’s happening? Well, 4 × 12 is actually “4 x (10 + 2)” or “40 + 8″, right? We can view that first step (blue) as two separate multiplications (4×10 and 4×2).</p>

<p>We’re so used to combining and carrying that we merge the steps, but they’re there. (For example, 4 × 17 = 4 x (10 + 7) = 40 + 28 = 68, but we usually don’t separate it like that.)</p>

<p>Similarly, the red step of “3 × 12″ is really “30 × 12″ — the 3 is in the tens column, after all. We get “30 x (10 + 2)” or “300 + 60″. Again, we can split the number into two parts.</p>

<p>What does this have to do with combinations? Hang in there, you’ll see soon enough.</p>

<h2>Curses, Foiled Again</h2>

<p>Take a closer look at what happened: 12 × 34 is really (10 + 2) x (30 + 4) = 300 + 40 + 60 + 8&#46; This breakdown looks suspiciously like algebra equation (a + b) * (c + d):</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/mult/listing_combinations.png" alt="Listing combinations" title="Listing combinations" class="webpexpress-processed"></p>

<p>And yes, that’s what’s happening! In both cases we’re multiplying one “group” by another. We take each item in the red group (10 and 2) and combine it with every element of the blue group (30 and 4). We don’t mix red items with each other, and we don’t mix blue items with each other.</p>

<p>This combination technique is often called <span class="caps">FOIL </span>(first-inside-outside-last), and gives headaches to kids. But it’s not a magical operation! It’s just laying things out in a grid. <strong><span class="caps">FOIL </span>is already built into the way we multiply!</strong></p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/mult/foil_multiplication.png" alt="Foil and multiplication" title="Foil and multiplication" class="webpexpress-processed"></p>

<p>When doing long multiplication, we “know” we’re not supposed to multiply across: you don’t do 1 × 2, because they’re in the same row. Similarly, you don’t do a x b, because they’re in the same parenthesis. We only multiply “up and down” — that is, we need an item from the top row (1 or 2, a or b) and an item from the bottom row (3 or 4, c or d).</p>

<p>Everyday multiplication (aka <span class="caps">FOIL</span>) gives us a way to crank out combinations of two groups: one from group A, another from group B. And sometimes it’s nice having all the possibilities as an equation.</p>

<h2>Examples Make It Click</h2>

<p>Let’s try an example. Suppose we want to find every combination of flipping a coin twice. There’s a few ways to do it, like using a grid or decision tree:</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/mult/grid_and_tree.png" alt="Decision grid and tree" title="Decision grid and tree" class="webpexpress-processed"></p>

<p>That’s fine, but let’s be different. We can turn the question into an <strong>equation</strong> using the following rules:</p>

<ul>
<li><strong>addition = OR</strong>. We can get heads OR tails: (h+t)</li>
<li><strong>multiplication = <span class="caps">AND</span></strong>. We have a first toss <span class="caps">AND </span>a second toss: (h+t) * (h+t)</li>
</ul>

<p>Wow! How does this work?</p>

<p>Well, we really just want to crank out combinations, just like doing (a+b) * (c+d) = ac + bc + ad + bd. Looking carefully, this format means we pick <strong>a</strong> OR <strong>b</strong>, and combine it with one of <strong>c</strong> OR <strong>d</strong>.</p>

<p>When we see an addition (a+b), we know it means we must choose one variable: this OR that. When we see a multiplication (group1 * group2), we know it means we take one item from each: this <span class="caps">AND </span>that.</p>

<p>The shortcuts “AND = multiply” &amp; “OR = add” are simply another way to describe the <strong>relationship</strong> inside the equation. (Be careful; when we say three hundred and four, most people think 304, which is right too. This <span class="caps">AND</span>/OR trick works in the context of <em>describing combinations</em>).</p>

<p>So, when all’s said and done, we can turn the sentence “(heads OR tails) <span class="caps">AND </span>(heads OR tails)” into:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/b6c5d0a26ee4a1bf0ceba38a12ab64e4.png' width='117' height='18' alt='\displaystyle{(h + t)\cdot(h + t)}' class='tex'></p>

<p>And just for kicks, we can multiply it out:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/dba1608d6c33e959433fdd0bc55592df.png' width='403' height='21' alt='\displaystyle{(h + t) \cdot (h + t) = h^2 + th + ht + t^2 = h^2 + 2ht + t^2}' class='tex'></p>

<p>The result “h<sup>2</sup> + 2ht + t<sup>2</sup>” shows us every possibility, just like the grids and decision trees. And the size (coefficient) of each combination shows the number of ways it can happen:</p>

<ul>
<li>h^2: There’s one way to get two heads (h<sup>2</sup> = hh = heads <span class="caps">AND </span>heads)</li>
<li>2ht: There’s two ways to get a head and tails (ht, th)</li>
<li>t^2: There’s one way to get two tails (tt)</li>
</ul>

<p>Neato. The sum of the coefficients is 1 + 2 + 1 = 4, the total number of possibilities. The chance of getting exactly one heads and one tails is 2/4 = 50%. We figured this out without a tree or grid — regular multiplication does the trick!</p>

<h2>Grids? Trees? I Figured That Out In My Head.</h2>

<p>Ok, hotshot, let’s expand the scope. How many ways can we get exactly 2 heads and 2 tails with 4 coin flips? What’s the chance of getting 3 or more heads?</p>

<p>Our sentence becomes: “(heads OR tails) <span class="caps">AND </span>(h OR t) <span class="caps">AND </span>(h OR t) <span class="caps">AND </span>(h OR t)”</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/76bade695a284ce8ccfcf514157708a1.png' width='315' height='21' alt='\displaystyle{(h+t)^4 = h^4 + 4h^3t + 6h^2t^2 + 4ht^3 + t^4}' class='tex'></p>

<p>Looking at the result (it looks hard but <a href="https://en.wikipedia.org/wiki/Pascal's_triangle">there are shortcuts</a>), there are <strong>6</strong> ways to get 2 heads and 2 tails. There’s 1 + 4 + 6 + 4 + 1 = 16 possibilities, so there’s only a 6/16 = 37.5% chance of having a “balanced” result after 4 coin flips. (It’s a bit surprising that it’s <em>much more likely</em> to be uneven than even).</p>

<p>And how many ways can we get 3 or more heads? Well, that means any components with h<sup>3</sup> or h<sup>4</sup>: 4 + 1 = 5&#46; So we have 5/16 = 31.25% chance of 3 or more heads.</p>

<p>Sometimes equations are better than grids and trees — look at how much info we crammed into a single line! Formulas work great when you have a calculator or computer handy.</p>

<p>But most of all, we have another tool in our box: <strong>we can write possibilities as equations, and use multiplication to find combinations.</strong></p>

<h2>Where Next?</h2>

<p>There’s a few areas of math that benefit from seeing multiplication in this way:</p>

<ul>
<li><p><strong>Binomial Theorem</strong>. This scary-sounding theorem relates (h+t)^n to the coefficients. If you’re clever, you realize you can use <a href="https://betterexplained.com/articles/easy-permutations-and-combinations/">combinations and permutations</a> to figure out the exponents rather than having to multiply out the whole equation. This is what the binomial theorem does. We’ll cover more later — this theorem shows up in a lot of places, including calculus.</p></li>
<li><p><strong>Boolean Algebra</strong>. Computer geeks love converting conditions like OR and <span class="caps">AND </span>into mathematical statements. This type of <span class="caps">AND</span>/OR logic is used when designing computer circuits, and expressing possibilities with equations (not diagrams) is very useful. The fancy name of this technique is Boolean Algebra, which we’ll save for a rainy day as well.</p></li>
<li><p><strong>Calculus</strong>. Calculus gets a double bonus from this interpretation. First, the binomial theorem makes working with equations like x^n much easier. Second, one view of calculus is an “expansion” of multiplication. Today we got practice thinking that multiplication means a lot more than “repeated addition”. (“12 × 34″ means 12 groups of 34, right?)</p></li>
<li><p><strong>More advanced combinations</strong>. Let’s say you have 3 guests (Alice, Bob, and Charlie) and they are bringing soda, ice cream, or yogurt. Someone knocks at the door — what are the possibilities? (a + b + c) * (s + i + y). The equation has it all there.</p></li>
</ul>

<p>So you can teach an old dog like multiplication new tricks after all. Well, the tricks have always been there — it’s like discovering Fido has been barking poetry in morse code all this time.</p>

<p>And come to think of it, maybe <em>we’re the animal</em> that learned a new trick. The poetry was there, staring us in the face and we just didn’t recognize it (12 × 34 is based on combinations!). I know I had some forehead-slapping moments after seeing how similar combinations and regular multiplication really were.</p>

<p>Happy math.</p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/how-to-understand-combinations-using-multiplication/feed/</wfw:commentRss>
			<slash:comments>44</slash:comments>
		

			</item>
	<item>
		<title>Easy Permutations and Combinations</title>
		<link>https://betterexplained.com/articles/easy-permutations-and-combinations/</link>
					<comments>https://betterexplained.com/articles/easy-permutations-and-combinations/#disqus_thread</comments>
		
		<dc:creator><![CDATA[kalid]]></dc:creator>
		<pubDate>Sun, 11 Feb 2007 15:24:22 +0000</pubDate>
				<category><![CDATA[Math]]></category>
				<category><![CDATA[Combination]]></category>
				<category><![CDATA[Permutation]]></category>
		<guid isPermaLink="false">http://betterexplained.com/articles/easy-permutations-and-combinations/</guid>

					<description><![CDATA[I’ve always confused “permutation” and “combination” — which one’s which? Here’s an easy way to remember: permutation sounds complicated , doesn’t it? And it is. With permutations, every little detail matters. Alice, Bob and Charlie is different from Charlie, Bob and Alice (insert your friends’ names here). Combinations, on the other hand, are pretty easy [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I’ve always confused “permutation” and “combination” — which one’s which?</p>

<p>Here’s an easy way to remember: <strong>permutation sounds complicated</strong>, doesn’t it? And it is. With permutations, every little detail matters. Alice, Bob and Charlie is different from Charlie, Bob and Alice (insert your friends’ names here).</p>

<p>Combinations, on the other hand, are pretty easy going. The details don’t matter. Alice, Bob and Charlie is the same as Charlie, Bob and Alice.</p>

<p><strong>Permutations are for lists (order matters) and combinations are for groups (order doesn’t matter).</strong></p>

<p>You know, a "combination lock" should really be called a "permutation lock". The order you put the numbers in matters.</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/2007/02/combination-lock.png" alt="Easy Permutations and Combinations" width="162" height="213" class="alignnone size-full wp-image-12468"></p>

<p>A true "combination lock" would accept both 10-17-23 and 23-17-10 as correct.</p>

<div style="position:relative;height:0;padding-bottom:56.25%"><iframe src="https://www.youtube.com/embed/bAk_7p5gAWc?ecver=2" width="640" height="360" frameborder="0" style="position:absolute;width:100%;height:100%;left:0" allowfullscreen></iframe></div>

<h2>Permutations: The hairy details</h2>

<p>Let’s start with permutations, or <strong>all possible ways</strong> of doing something. We’re using the fancy-pants term “permutation”, so we’re going to care about every last detail, including the order of each item. Let’s say we have 8 people:</p>

<pre><code>1: Alice
2: Bob
3: Charlie
4: David
5: Eve
6: Frank
7: George
8: Horatio
</code></pre>

<p>How many ways can we award a 1st, 2nd and 3rd place prize among eight contestants? (Gold / Silver / Bronze)</p>

<p><img decoding="async" src="https://betterexplained.com/wp-content/uploads/math/permuations/permuation_medals.png" alt="permutation example medals" title="permuation_medals.png" class="webpexpress-processed"></p>

<p>We’re going to use permutations since the order we hand out these medals matters. Here’s how it breaks down:</p>

<ul>
<li>Gold medal: 8 choices: A B C D E F G H (Clever how I made the names match up with letters, eh?). Let’s say A wins the Gold.</li>
<li>Silver medal: 7 choices: B C D E F G H. Let’s say B wins the silver.</li>
<li>Bronze medal: 6 choices: C D E F G H. Let’s say… C wins the bronze.</li>
</ul>

<p>We picked certain people to win, but the details don’t matter: we had 8 choices at first, then 7, then 6. The total number of options was <img src="https://betterexplained.com/latex/54212b58b2c30d812427.png" alt="$8 * 7 * 6 = 336$" width="113" height="14" style="vertical-align:-1.49px" class="bex-math"></img>.</p>

<p>Let’s look at the details. We had to order 3 people out of 8. To do this, we started with all options (8) then took them away one at a time (7, then 6) until we ran out of medals.</p>

<p>We know the factorial is:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/24cb43f2a6cb02a29481794d26b0e26a.png' width='202' height='14' alt='\displaystyle{ 8! = 8 \cdot 7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1 }' class='tex'></p>

<p>Unfortunately, that does too much! We only want <img src="https://betterexplained.com/latex/c93619878a3aa3724ae9.png" alt="$8 * 7 * 6$" width="62" height="13" style="vertical-align:-0.4px" class="bex-math"></img>. How can we “stop” the factorial at 5?</p>

<p>This is where permutations get cool: notice how we want to get rid of <img src="https://betterexplained.com/latex/9cea9035c942b911f6e7.png" alt="$5 * 4 * 3 * 2 * 1$" width="114" height="13" style="vertical-align:-0.4px" class="bex-math"></img>. What’s another name for this? 5 factorial!</p>

<p>So, if we do 8!/5! we get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/61ecd7fe1d7f131623fd0dcc57f5da0e.png' width='286' height='38' alt='\displaystyle{\frac{8!}{5!} = \frac{8 \cdot 7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1}{5 \cdot 4 \cdot 3 \cdot 2 \cdot 1}  = 8 \cdot 7 \cdot 6}' class='tex'></p>

<p>And why did we use the number 5? Because it was left over after we picked 3 medals from 8. So, a better way to write this would be:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/5b4d125e63d7498f8c3cb318454cf963.png' width='60' height='43' alt='\displaystyle{\frac{8!}{(8-3)!}}' class='tex'></p>

<p>where 8!/(8-3)! is just a fancy way of saying “Use the first 3 numbers of 8!”. If we have <strong>n</strong> items total and want to pick <strong>k</strong> in a certain order, we get:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/899fa6e32e1e23123bda5aa00e21a119.png' width='63' height='43' alt='\displaystyle{\frac{n!}{(n-k)!}}' class='tex'></p>

<p>And this is the fancy permutation formula: You have <strong>n</strong> items and want to find the number of ways <strong>k</strong> items can be ordered:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/7164200acc9606cf3547c31ddc023cdd.png' width='146' height='43' alt='\displaystyle{P(n,k) = \frac{n!}{(n-k)!}}' class='tex'></p>

<h2>Combinations, Ho!</h2>

<p>Combinations are easy going. Order doesn’t matter. You can mix it up and it looks the same. Let’s say I’m a cheapskate and can’t afford separate Gold, Silver and Bronze medals. In fact, I can only afford empty tin cans.</p>

<p>How many ways can I give 3 tin cans to 8 people?</p>

<p>Well, in this case, the order we pick people doesn’t matter. If I give a can to Alice, Bob and then Charlie, it’s the same as giving to Charlie, Alice and then Bob. Either way, they’re equally disappointed.</p>

<p>This raises an interesting point — we’ve got some redundancies here. Alice Bob Charlie = Charlie Bob Alice. For a moment, let’s just figure out how many ways we can rearrange 3 people.</p>

<p>Well, we have 3 choices for the first person, 2 for the second, and only 1 for the last. So we have <img src="https://betterexplained.com/latex/fdb71a5147399e0cb53b.png" alt="$3 * 2 * 1$" width="62" height="13" style="vertical-align:-0.4px" class="bex-math"></img> ways to re-arrange 3 people.</p>

<p>Wait a minute… this is looking a bit like a permutation! You tricked me!</p>

<p>Indeed I did. If you have N people and you want to know how many arrangements there are for <strong>all</strong> of them, it’s just N factorial or N!</p>

<p>So, if we have 3 tin cans to give away, there are 3! or 6 variations for every choice we pick. If we want to figure out how many combinations we have, we just <strong>create all the permutations and divide by all the redundancies</strong>. In our case, we get 336 permutations (from above), and we divide by the 6 redundancies for each permutation and get 336/6 = 56.</p>

<p>The general formula is</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/677d1e00b27408c0417be10dae451184.png' width='141' height='39' alt='\displaystyle{C(n,k) = \frac{P(n,k)}{k!}}' class='tex'></p>

<p>which means “Find all the ways to pick k people from n, and divide by the k! variants”. Writing this out, we get our <strong>combination formula</strong>, or the number of ways to combine k items from a set of n:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/be21eae92ceda7a78ac8b0042e7b7407.png' width='161' height='43' alt='\displaystyle{C(n,k) = \frac{n!}{(n-k)!k!}}' class='tex'></p>

<p>Sometimes C(n,k) is written as:</p>

<p><img src='https://betterexplained.com/wp-content/plugins/wp-latexrender/pictures/9bbf2e913f973ac6e6043c75a9608e09.png' width='30' height='44' alt='\displaystyle{\binom {n}{k}}' class='tex'></p>

<p>which is the <a href="https://en.wikipedia.org/wiki/Binomial_coefficient">binomial coefficient</a>.</p>

<h2>A few examples</h2>

<p>Here’s a few examples of combinations (order doesn’t matter) from permutations (order matters).</p>

<ul>
<li><p>Combination: Picking a team of 3 people from a group of 10. <img src="https://betterexplained.com/latex/314a4024c2b733724251.png" alt="$C(10,3) = 10!/(7! * 3!) = 10 * 9 * 8 / (3 * 2 * 1) = 120$" width="409" height="19" style="vertical-align:-4.53px" class="bex-math"></img>.</p>

<p>Permutation: Picking a President, VP and Waterboy from a group of 10. <img src="https://betterexplained.com/latex/c894e2e6e8814b18d15a.png" alt="$P(10,3) = 10!/7! = 10 * 9 * 8 = 720$" width="280" height="19" style="vertical-align:-4.53px" class="bex-math"></img>.</p></li>
<li><p>Combination: Choosing 3 desserts from a menu of 10. C(10,3) = 120.</p>

<p>Permutation: Listing your 3 favorite desserts, in order, from a menu of 10. P(10,3) = 720.</p></li>
</ul>

<p>Don’t memorize the formulas, understand why they work. <strong>Combinations sound simpler than permutations, and they are. You have fewer combinations than permutations.</strong></p>

]]></content:encoded>
					
					<wfw:commentRss>https://betterexplained.com/articles/easy-permutations-and-combinations/feed/</wfw:commentRss>
			<slash:comments>1416</slash:comments>
		

			</item>
	</channel>
</rss>
