### Title

How to get all possible combinations of 20 numbers ?

### Post

How can I do that? The numbers should be in order - from minor to the largest, without any number repeated.

So, if I have numbers 1...to 20, I want

1-2-3-4-5

1-2-3-4-6

1-2-3-4-7

and so on.

Can you please help me?

Thank you very much

From a Google SearchThere are 55 possible numbers for the first number, 54 for the second, and so on to 50 possibilities for the sixth number, giving 55 x 54 x ... x 50 different possible ways of selecting six numbers from fifty five different numbers.

However, as the order of selection does not matter (the combinations {1, 2, 3, 4, 5, 6} and {6, 5, 4, 3, 2, 1} are considered the same) the first number could appear in any of the six positions, the second in any of the remaining 5, and so on until there is only 1 place left for the last number, giving 6 x 5 x ... x 1 different ways each six digit combination will appear in the selections above, so the total number of ways of combining six numbers from fifty five different numbers is:

Five combinations are:

{1, 2, 3, 4, 5, 7},

{1, 2, 3, 4, 5, 8},

{1, 2, 3, 4, 5, 9},

{1, 2, 3, 4, 5, 10}

I'll leave the remaining twenty eight million, nine hundred and eighty nine thousand, six hundred and seventy (28,989,670) combinations for you to list.

Where the order of selection matters, it is called a permutation. The formula to calculate the permutation of r items selected from a total of n items is:

_{n}P_{r}=^{n!}/_{(n-r)!}Where the order of selection does not matter, it is called a combination. The formula to calculate the combination of r items selected from a total of n items is:

_{n}C_{r}=_{n}P_{r}÷ r! =^{n!}/_{(n-r)!r! }In both the above formulae the exclamation mark is the factorial of the preceding number which is the number multiplied by all positive numbers less than it, for example 5! is five factorial:

Read more: http://wiki.answers.com/Q/How_many_6_combination_numbers_are_there_in_55_numbers_what_are_the_combinations#ixzz1uUVix3Cu