Combinations and permutations. Permutations and combinations. What's the difference between the two? And how do you calculate each of them? Keep on reading to find out!
How many ways can you arrange the colors of a rainbow? You may not have known this, but rainbows contain an infinite array of colors—of which the human eye can perceive thousands. So, this infinite array of colors could be arranged in an infinite number of ways.
But that’s not quite what I’m talking about. I’m just talking about the classic six colors of the rainbow that we all learned as kids: red, orange, yellow, green, blue, and purple. How many different six-stripe rainbows can you make using these colors?
As we’ll soon see, the answer is, “It depends.” In particular, it depends on whether you’re asking about the number of permutations or the number of combinations. What’s the difference between the two? And how are they each calculated? Those are exactly the questions we’ll be answering today and over the next few weeks.
Permutations Versus Combinations
Before calculating the number of rainbows we can make from our six-color pallete, we need to talk about the difference between permutations and combinations. And that’s because the answer to our rainbow question depends upon which of these things we’re talking about.
In such a lock, the order of the three numbers is important.
Imagine you have a lock with three dials on it, each of which can be set to any digit from 0 through 9. When you set each of these three dials to the correct number, the lock opens. In such a lock, the order of the three numbers is important. If the code is 1-2-3 (in that order), it won’t do any good to enter the code 3-2-1. Yes, the three numbers are all there, but they’re in the wrong order.
In principal it would also be possible to construct a lock that would open whenever you've entered the correct three numbers—regardless of which dials you enter them onto. So, any of the permutations of the numbers 1, 2, and 3—that's 1-2-3, 1-3-2, 2-1-3, 2-3-1, 3-1-2, and 3-2-1—would work. As long as the combination of numbers 1, 2, and 3 are each in there, the lock would open.
Although they’re called combination locks, the first of these locks—the normal one in which the order of the numbers matters—is really a permutation lock. The second (imaginary) lock—the one in which the numbers can be entered in any order—is a true combination lock.
How to Calculate Permutations without Repeats
Now that we understand the difference between permutations (order matters) and combinations (order doesn’t matter), let’s think a bit about our six-stripe rainbow. In particular, let's see if we can calculate how many possible permutations of the six colors of the rainbow we can paint its six stripes with.
... permutations (order matters) and combinations (order doesn’t matter).
If all of the stripes have to be different colors (so that each of the six colors is used exactly once), then there are six options for the first stripe (red, orange, yellow, green, blue, or purple). After you’ve chosen the color for the first stripe, there are five colors remaining to choose from for the second stripe. Then four left for the third stripe, three left for the fourth, two left for the fifth, and only one color left for the sixth and final stripe.
That means that there are a total of 6 x 5 x 4 x 3 x 2 x 1 = 720 possible color combinations for our six-stripe rainbow. There’s a shorthand notation we can use when we have a multiplication problem like this in which we multiply a number by the number one smaller, and then by the number two smaller, then three smaller, four smaller, and so on all the way down to the number 1. We call this the factorial function. In this case, the number of colors is written 6! = 6 x 5 x 4 x 3 x 2 x 1.
What if we only wanted to make a two stripe rainbow out of our six colors, and we’re not allowed to repeat a color? Well, there are six choices for the first stripe and five for the second. And since those are all of the stripes, the number of possible permutations when choosing two objects from a group of six possibilities is 6 x 5. Notice that this is the same as 6! / (4 x 3 x 2 x 1) = 6! / 4! = 6! / (6 – 2)!, where the denominator is the factorial of the difference between the number of choices and the number of things to choose from.
How to Calculate Permutations with Repeats
What if we want to allow for the possibility that we can use each color more than once? In other words, what if we want to be able to draw a rainbow with two red stripes, or three red stripes, or three blue stripes, or all blue stripes, or anything else? How can we count the number of permutations in this case?
As before, there are six different possible colors for the first stripe. How about the second stripe? Since we’re now allowing for the possibility that the same color can be used on more than one stripe, we see that we once again have six different possible colors to choose from for the second stripe. And the third? Yep, still six possible colors. In fact, there are six possible colors for all six stripes. Which means the total number of possible permutations is 6 x 6 x 6 x 6 x 6 x 6 = 66 = 46,656.
What if we wanted to use our six colors to make a two stripe rainbow? Well, there’d be six possible colors for each of the two stripes. So, there’d be a total of 6 x 6 = 62 = 36 possible permutations. How about a ten stripe rainbow? Again, there’d be six possible colors for each of the ten stripes. So, the total number of possible permutations would be 610 = 60,466,176.
How to Calculate Combinations?
What if we don’t care about the particular order of the stripes in our rainbow? In other words, what if we only want to know something like how many ways there are to make a three-stripe rainbow with no repeating colors where the ordering of the colors doesn’t matter. So, “red, orange, and yellow” is the same as “yellow, orange, and red?” How many total combinations are possible in this case? What if we allow for repeating colors?
Unfortunately, we’re all out of time for today. So the answers to these questions about calculating combinations will have to wait until next time.
For more fun with math, please check out my book, The Math Dude’s Quick and Dirty Guide to Algebra. And remember to become a fan of The Math Dude on Facebook, where you’ll find lots of great math posted throughout the week. If you’re on Twitter, please follow me there, too.
Until next time, this is Jason Marshall with The Math Dude’s Quick and Dirty Tips to Make Math Easier. Thanks for reading, math fans!
Rainbow image courtesy of Shutterstock.