In a recent SPSS training course that we were running we got into a conversation about combinations and permutations.

Although this may sound a little off topic for an SPSS blog these come into sampling in survey research, significance testing and other statistical methods and so I thought it would be useful to take a slight detour and write a post or two about combinations and permutations and other basic statistical concepts.

Combinations and permutations are related concepts and related to how many difference ways things can be sequenced.

Permutations is the number of ways that a given number of items from a given set of items can be put into difference sequences.So for example if you have A, B, C and D (so a set of 4 items) but only take 3 of them at any one time how many different ways are there that they could come up.

Working through the list of possibilities gives us ABC, ACB, ABD, ADB, ACD, ADC, BAC, BCA, BDA, BAD, BCD, BDC, CAB, CBA, CBD, CDB, CAD, CDA, DAC, DCA, DAB, DBA, DBC, DCB. So that is 24 possible permutations in total.

When you are working with a set of n items and taking r items from that set the standard notation and also way of calculating the number of permutations is given by:

nPr = n! / (n-r)!

This can obviously be simplified to nPn = n! where you are taking the same number of items from the set as there are items in the set. In this notation n! is n factorial which is calculated as (1 * 2 * 3 *4 ..... * n-1 * n) so when taking 6 distinct items for a set of 6 the number of permutations is 1 * 2 * 3 * 4 * 5 * 6 = 720.

If you are taking 4 items from a set of 6 items then the formula gives you 360 = 720 /(1*2). And using our earlier example taking 3 items from a set of 4 items gives (1*2*3*4) / (1*2) = 24 items.

Combinations is the number of subsets that can be derived from any given set of items. Combinations is independent of sequence which, as you will have seen above, is not the case with permutations where ABC and ACB, for example, are separate items and counted as such. In our above example there are 6 versions of the combination of the 3 letters ABD, so there are 6 permutations of ABD but these are all only one combination.

The relevant notation for combinations is shown below. As you can see it's very similar to the notation for permutations.

nCr = n! / ((n-r)!*r!) where again n is the number of items in the set and r is the number of items being taken from the set. So for our previous example with A, B, C and D the notation gives 4C3 = (1*2*3*4) / (1*(1*2*3)) = 4

Over the next few blog posts I will explain a few more of the basics of statistics as users of SPSS will need to understand this. Although SPSS does a lot of the work for you the more of a grounding you have in basic statistics the simpler and quicker it will be to use it.

Although this may sound a little off topic for an SPSS blog these come into sampling in survey research, significance testing and other statistical methods and so I thought it would be useful to take a slight detour and write a post or two about combinations and permutations and other basic statistical concepts.

Combinations and permutations are related concepts and related to how many difference ways things can be sequenced.

Permutations is the number of ways that a given number of items from a given set of items can be put into difference sequences.So for example if you have A, B, C and D (so a set of 4 items) but only take 3 of them at any one time how many different ways are there that they could come up.

Working through the list of possibilities gives us ABC, ACB, ABD, ADB, ACD, ADC, BAC, BCA, BDA, BAD, BCD, BDC, CAB, CBA, CBD, CDB, CAD, CDA, DAC, DCA, DAB, DBA, DBC, DCB. So that is 24 possible permutations in total.

When you are working with a set of n items and taking r items from that set the standard notation and also way of calculating the number of permutations is given by:

nPr = n! / (n-r)!

This can obviously be simplified to nPn = n! where you are taking the same number of items from the set as there are items in the set. In this notation n! is n factorial which is calculated as (1 * 2 * 3 *4 ..... * n-1 * n) so when taking 6 distinct items for a set of 6 the number of permutations is 1 * 2 * 3 * 4 * 5 * 6 = 720.

If you are taking 4 items from a set of 6 items then the formula gives you 360 = 720 /(1*2). And using our earlier example taking 3 items from a set of 4 items gives (1*2*3*4) / (1*2) = 24 items.

Combinations is the number of subsets that can be derived from any given set of items. Combinations is independent of sequence which, as you will have seen above, is not the case with permutations where ABC and ACB, for example, are separate items and counted as such. In our above example there are 6 versions of the combination of the 3 letters ABD, so there are 6 permutations of ABD but these are all only one combination.

The relevant notation for combinations is shown below. As you can see it's very similar to the notation for permutations.

nCr = n! / ((n-r)!*r!) where again n is the number of items in the set and r is the number of items being taken from the set. So for our previous example with A, B, C and D the notation gives 4C3 = (1*2*3*4) / (1*(1*2*3)) = 4

Over the next few blog posts I will explain a few more of the basics of statistics as users of SPSS will need to understand this. Although SPSS does a lot of the work for you the more of a grounding you have in basic statistics the simpler and quicker it will be to use it.