 Combinations, permutations

 
In order to calculate for large numbers, whose factorials are unwieldy, more suitable formulae based on series are used.
Remember that only whole positive numbers have meaning as input.  
"Combinations" gives the number of ways a subset of r items can be chosen out of a set of n items. "Permutations" makes the same calculation, but in this case different arrangements of the same items are also counted. For example, for a deck of cards n=52. There are 22100 ways that 3 cards can be chosen (nCr when r=3), but 132600 ways if it matters what order they are drawn in (nPr when r=3).  