Combinations: General Function to Get All Possible Combinations
Thursday, February 28th, 2008Previously, we looked at how to calculate a binomial coefficient (to find the total number of possible combinations) and an example of how to generate a list of combinations with hard-coded loops.
A function would be much more useful to us if it was flexible - if it could generate a list of combinations for any size set of numbers. We can’t do this with the hard coded loop solution, so we need to come up with a better method.
(more…)