Try this link
http://en.wikipedia.org/wiki/Mathematical_combination
as an example - to choose 3 out of 10 you have :
10! / (3! * (10-3)!) = 3628800/(6*5040) = 120
(calculated by SCalculator

, since the only code you need is Factorial function, you can find it there.)