- #1
raminee
- 12
- 2
- TL;DR Summary
- How to come up with an indexing formulae for all set of combinations from a given set of numbers?
The Combinations formulae will find the number of possible combinations that can be obtained by taking a sample of items from a larger set.
C = n! / [r! * (n-r)! ]
Where n is the number of set samples and r is the number of desired selected samples.
So as an example say we have n=5 and r=2.
Here are all the possible 10 combinations for choosing 2 samples out of 5 samples as shown in attached picture.
Note a 1 is a selected sample.
My question is given a chosen sample combination can we come up with a formulae that can map it to its index value ??
So say we come up with combination samples 1 and 3 then how do we get to index 5 ??
C = n! / [r! * (n-r)! ]
Where n is the number of set samples and r is the number of desired selected samples.
So as an example say we have n=5 and r=2.
Here are all the possible 10 combinations for choosing 2 samples out of 5 samples as shown in attached picture.
Note a 1 is a selected sample.
My question is given a chosen sample combination can we come up with a formulae that can map it to its index value ??
So say we come up with combination samples 1 and 3 then how do we get to index 5 ??
Attachments
Last edited: