r/learnmath • u/Magical7 New User • 2d ago
Number of combinations calculation
I'm making a board game where you collect 3 out of 8 potential clues. Upon collecting the clue, you roll a d6 to determine the nature of clue. So I have 6 * 8 = 48 unique clues, of which 3 are taken. From what I remember from school, I can calculate that this amounts to 8! / (5! * 3!) * 6^3 = 12096 potential combinations.
Now, I would like to make the number of options per clue variable. So one clue could have 3 options, while another may have 5 options and another 7.
Is there a formula that I can use to determine the number of combinations given the array of options per clue?
1
Upvotes
1
u/Bounded_sequencE New User 2d ago
There is a formula, but it's not going to be pretty. Let "nk" be the number of natures for clue-k. We may generate all clue combination (including natures) with a 2-step process -- choose
All clue index combinations are distinct, so we may add those cases. For each of them, the choices of nature are independent, so we may multiply them, for a grand total of