Subscribe Bookmark
mia_stephens

Staff

Joined:

May 28, 2014

Combinations and permutations calculator: A tasty new add-in

One of the great new pleasures in life, if you enjoy crunchy chocolate, is pretzel M&Ms. If you haven’t tried then yet, you should!

I’m down to my last five – one of each color (red, blue, brown, green and orange.)  Should I eat just a couple and save the others for later, or eat them all one at a time?

This gets me thinking of all of the possible ways I can eat the M&Ms. If I eat just two, which colors should I choose?  Do I start with the red and then eat the blue? What if I close my eyes and randomly select the two M&Ms? How many possible choices can I make?

Thinking back to the days when I took undergraduate probability and statistics, I recall the discussion of combinations and permutations. If I select two candies and order doesn’t matter, then I’m interested in the number of combinations. In other words, selecting a red first and then a blue counts the same as selecting a blue and then a red – it's still just one combination.

However, if I select two candies (without replacement) and order is important, then that’s a permutation. So, selecting a red first and then a blue is one outcome, and selecting a blue and then a red is another outcome.

Good thing Mark Bailey, a JMP education specialist, has written an application to do the math for us. It turns out we have a lot of choices! There are 10 possible pairs of M&Ms I can select from the five. And, if I’m interested in order, there are 20 possible outcomes, or permutations.

What if I can’t resist and decide to eat all five? How many combinations and permutations are there? There is just one combination, since all five will be eaten. But, there are 120 permutations – 120 possible orders in which I can enjoy eating my last five M&Ms!

Hmm, I’m getting hungry!

The Combinations and Permutations application is available as an add-in on the JMP File Exchange (requires a SAS profile to download) or from the Academic Resources page.

4 Comments
Community Member

Teresa Obis wrote:

Mia, thanks for this very easy to understand explanation about combinations and permutation. It will be very useful. You have to put it at the One-page Guides.

And Mark, than you for the add-in calculator.

The only problem is at the end of the reading. I would like to try the experiment eating M&Ms, so I miss the M&Ms jar you have at the training room on SAS World Headquarters in Cary.

Also I miss a webcast about applications. This is a very important feature of JMP 10, I would like to learn how to do it. It is a pity I can not join you at JMP Discovery Summit.

Community Trekker

I see that the addin uses the function "N Choose K(N.K)". However, I cannot find this function documented anywhere. How did you find it? I have been looking for it for quite some time.

Does anyone know why it is not included in the "Discrete Probability" menu in the Formula editor? It seems like an odd omission.

Jesper, the functions that I use are documented in the books and the index. For example, select Help > Scripting Index. Then click the button at the top left and select Functions. Type choose in the search box and press Enter. A short list of results includes N Choose K(). Select this function to see the information about it on the right side.

Community Trekker

Thank you :)