Business Home Page

Combinations of letters from a 26 letter alphabet

This page has turned into a useful extension to my other page on this subject and was inspired by the following:

I have a maths problem I hope you can help me with. Ok here is the 2 problems:

I am trying to calculate how many possible combinations of 3 and 4 characters you can get.

So if I took the whole alphabet and set a program to put the letters into sets of 3… how many sets would it return? (and the same with 4 characters)

eg: aaa, aab, etc

If you can let me know what the excel formula would be I would be very happy.

Thanks
Simon

Introduction

Most people have heard of permutations and combinations: not everyone knows what they really mean and which one they should use when working out how to put two or more items together given a sample or population of two or more items.

Combinations

A combination is a grouping of a given number of items from a sample or population. For example, you might want to know how many ways it’s possible to get four heads from 10 tosses of a coin. Here, the order in which the heads appear is not important: four heads followed by six tails is no different from six tails followed by four heads.

This is a vital point that needs to be clearly understood. What it means is that if there are, say, just two characters to choose from, say 1 and 2, then as far as combinations are concerned 12 is the same as 21: the order in which they appear is not important.

If you want to work out the combinations from three characters, can you prove these answers?

  • combine one from the three characters: there are three combinations possible
  • combine two from the three characters: there are three combinations possible
  • combine three from the three characters: there is one combination possible

See The Proofs at the end of the page for the solution to these problems

There is a question at the end of this page on this aspect of the method that you might find useful.

Formula

There is a standard formula for evaluating a combination problem and we will apply it to the four heads and six tails situation:

combination formula 1

In the case of choosing combinations of letters from the English alphabet, the problem could be:

How many combinations of three letters are there from the English alphabet? Using the above formula, the solution is:

combination formula 2

Use the above formula to derive the number of other possible combinations of letters from the English alphabet. Let’s start with the easy and obvious one:

how many combinations of one letter from the 26 letters are there?

Did you get 26?

how many combinations of four letters from the 26 letters are there?

Did you get 14,950?

Five? Did you get 65,780?
Six? Did you get 230,230?

Excel Formulae

There are several ways of solving these problems using a spreadsheet: let’s use MS Excel, version 2003 although the XP version is the same.

Method 1

If you want to demonstrate the formula that I first started with, Excel has a built in FACTORIAL function:

=FACT(number) for example

=FACT(3) = 3 x 2 x 1 = 6
=FACT(26) = 403,291,461,126,606,000,000,000,000

Saves you a load of bother. Putting these factorial functions in the Combinations formula now, we get, to solve for the number of combinations of four heads from 10 tosses of a coin:

combination formula 3

Try that now for finding the combinations of three letters from 26: you know the answer already!

Method 2

Excel has a more direct way of solving these problems:

=COMBIN(number,number_chosen)

In our case, combining three from 26, the function we set up is:

=COMBIN(26,3) … it should give you 2,600

Change that to four from 26 …

=COMBIN(26,4) … it should give you 14,950

and so on.

Follow up Questions and Solutions

Question

I tried to use the excel formula to calculate how many 2 digit combinations you can get from 2 digits.

=combin(2,2)? I got 1, but there are 4?

11
12
22
21

Am I missing something?

Answer

The important point with combinations is that, assuming your two digits are 1 and 2, 12 is effectively the same as 21: hence =combin(2,2) = 1. What about 11 and 22 then you might ask? Well, you are telling the function to choose from TWO digits but your suggestion is that there are four digits! Otherwise, how could you have 11?

Moreover, your example assumes four digits (1, 1, 2, 2) and there are six ways of writing them and not just four:

11
11
12
21
22
22

Question

I have a program that generates strings of characters, and limited it to 2600 and told it to order the list. (this is the reason I want to work the maximum number of generations, otherwise it will run forever)

I expected to see:

Aaa
Aab
Aac

But I got:

aab
aar
abe
abj
abn
abx

Answer

I cannot be sure about your character strings as I’m not sure you’re your algorithm is generating! Please let me have more information and I’ll sort it out for you as best I can.

Tree Diagrams

Again depending on what you want to do with your knowledge, you might care to consider tree diagrams. In the case of tossing heads four times in 10 tosses of a coin, the tree diagram would show you that there are 210 routes, or branches, along which there are four heads possible.

Here’s a simpler version of the coin tossing problem, in tree diagram form: tossing a coin three times.

tree diagram: tossing on coin three times

Let me know if you’d like more on tree diagrams.

Just for Information: Permutations

With permutations, we might choose, say, four items from a sample of 10 items AND the order in which we choose them is important. For example, imagine your banker’s card’s PIN: 10 digits available, four digits long. How many ways are there to arrange those 10 digits in groups of four?

Here the order is important because 1234 is not equivalent to 4321: only one of them is correct.

As with combinations, his is a vital point that needs to be clearly understood. What it means is that if there are, say, just two characters to choose from, say 1 and 2, then as far as permutations are concerned 12 is not the same as 21: the order in which they appear is important. Imagine your PIN … any arrangement of the digits 1, 2, 3, 4 being equivalent to each other!

If you want to work out the permutations from three characters, can you prove these answers?

  • perm one from the three characters: there are three permutations possible
  • perm two from the three characters: there are six permutations possible
  • perm three from the three characters: there are six permutations possible

See The Proofs at the end of the page for the solution to these problems

To solve this PERMUTATIONS problem we use this formula:

permutations formula

This formula relates to our PIN example and it tells us that it’s possible for you to create 5,040 different for digit PINs for your banker’s card.

References

Les Oakshott (1994) Essential Elements of Business Statistics DPP
www.duncanwil.co.uk
MS Excel’s Help files

The Proofs

Combinations

  • combine one from the three characters: there are three combinations possible:
    • 1
    • 2
    • 3
  • combine two from the three characters: there are three combinations possible:
    • 12
    • 23
    • 13
  • combine three from the three characters: there is one combination possible:
    • 123

Permutations

  • perm one from the three characters: there are three permutations possible:
    • 1
    • 2
    • 3
  • perm two from the three characters: there are six permutations possible:
    • 12
    • 21
    • 23
    • 32
    • 13
    • 31
  • perm three from the three characters: there are six permutations possible:
    • 123
    • 132
    • 213
    • 231
    • 312
    • 321

© Duncan Williamson
19 July 2005

Write to me at any time

 
© Webmaster Duncan Williamson 2005