- #1
Lee1
- 5
- 0
Hey guys,
I'd love to get the formula to answer the following question:
I have 50 colorless balls and 100 different paints. All balls have to be painted.
Note that the balls' order is not important and repetition is allowed (means I can paint up to 50 balls in any single color if I want).
With that in mind, there are (100+50-1)!/50!(100-1)! possible color combinations in total (1.34191072e+40) to end up with. So far, so good.
But now I want to split this amount of combinations into two different categories based on the frequency of colors appearing:
Group 1 shall include any of these combinations that contain no more than three balls of any individual color.
Group 2 shall include every combination that contains at least four balls of at least one individual color (e.g. "6 blue and 5 yellow balls + 89 differently colored balls")
--> In the end I want to be able to tell how many combinations belong to each group.
Note that only one of these cases has to be solved (whichever is easier to calculate, I bet it's the 2nd) as the other one equals the difference to the total number of combinations.
I tried hard to solve this but I failed since I've never learned how to count the number of combinations by calculation and formula rather than by simply counting them all through.
As a little help here's some data to testproof your formula (note that this data is not directly related to the task above):
If n (colors) is 5 and r (balls) is 8, then the total number of combinations is 495, while 155 belong to the first and 340 to the second group. These are the numbers you should get when using 5 and 8 as values other than 100 and 50. I got these numbers by simply counting every possible calculation (and then doublechecked that result) to have some data for verification. Any help is highly recommended, thanks in advance! =)
Best wishes,
Manuel
I'd love to get the formula to answer the following question:
I have 50 colorless balls and 100 different paints. All balls have to be painted.
Note that the balls' order is not important and repetition is allowed (means I can paint up to 50 balls in any single color if I want).
With that in mind, there are (100+50-1)!/50!(100-1)! possible color combinations in total (1.34191072e+40) to end up with. So far, so good.
But now I want to split this amount of combinations into two different categories based on the frequency of colors appearing:
Group 1 shall include any of these combinations that contain no more than three balls of any individual color.
Group 2 shall include every combination that contains at least four balls of at least one individual color (e.g. "6 blue and 5 yellow balls + 89 differently colored balls")
--> In the end I want to be able to tell how many combinations belong to each group.
Note that only one of these cases has to be solved (whichever is easier to calculate, I bet it's the 2nd) as the other one equals the difference to the total number of combinations.
I tried hard to solve this but I failed since I've never learned how to count the number of combinations by calculation and formula rather than by simply counting them all through.
As a little help here's some data to testproof your formula (note that this data is not directly related to the task above):
If n (colors) is 5 and r (balls) is 8, then the total number of combinations is 495, while 155 belong to the first and 340 to the second group. These are the numbers you should get when using 5 and 8 as values other than 100 and 50. I got these numbers by simply counting every possible calculation (and then doublechecked that result) to have some data for verification. Any help is highly recommended, thanks in advance! =)
Best wishes,
Manuel