Alexander B. answered • 09/13/15

Advanced Math and Science Tutoring and Test Prep online (SAT, ACT)

Hello Amanda,

Both answers provided by Roman C. and Mark M. are correct, so I am just adding couple words in regards to computational aspects. Known from the basic combinatorics, the formula for all possible permutations k (where order matters) out of n can be written as:

P(n,k) = n! / (n-k)!

or

P(n,k) = n(n-1)...(n-k+1)

Both formulas theoretically provide identical results, however in many practical cases the calculation of n! on personal computer may cause an overflow error. Thus, the second computational method (it essentially calculates a product of numbers in decreasing arithmetic sequences) is preferable in most cases due to its computational efficiency.

Best regards,