   SEARCH HOME Math Central Quandaries & Queries  Question from Kelley, I vaguely remember some formula for determining all the possible combinations of a set of numbers (or whatever). If I have 3 numbers (0 - 2), then I have 0, 1, 2, 00, 01, 02, 10, 11, 12, 20, 21, 22, 000, 001, 002, 010, 011, 012, 020, 021, 022, 100, 101, 102 and so on. What is the formula for determining all potential results? Thank you!! Kelley Hi Kelley,

You have done most of the work and you have them in a nice order. I am going to call them strings of characters since combination is a word in mathematics that has a technical meaning.

The possible one character strings as you say are 0, 1 and 2. Hence there are 3 possible one character strings.

Each of these you can extend to a two character string by placing either 0, 1 or 2 at the end of the string. Thus 0 extends to 00 01 and 02; 1 extends to 10, 11 and 12 and 2 extends to 20, 21, and 22. Hence you have $3 \times 3 = 3^2$ possible two character strings.

Again each of these you can extend to a three character string by placing either 0, 1 or 2 at the end of the string. Thus 00 extends to 000, 001, and 002; 01 extends to 010, 011 and 012; 02 extends to 020, 021 and 022; and so on. Hence each of the two character strings can be extended to 3, three character strings and there are therefore $3 \times 3 \times 3 = 3^{3}$ possible three digit strings.

Continuing you can see that for any positive integer $n$ there are $3^{n}$ possible n character strings.

I hope this helps,
Penny     Math Central is supported by the University of Regina and The Pacific Institute for the Mathematical Sciences.