Advertisement

Combination puzzle

Started by January 18, 2001 09:21 AM
0 comments, last by BrianT 24 years ago
Hi, I have a problem I''m trying to find a good solution for, for one of my projects. In simple terms, the problem can be described as follows: There are 20 numbered balls (1-20): balls 1-5 are green, balls 6-20 are red. Rules: - The balls must be arranged into 3 groups - Each group must have at least 6 balls - Each group must have at least one green ball Questions: - How many possible combinations meet the requirements as stated in the rules? - How can you build the list of those combinations? I could use the brute-force method (generate every single possible combination of balls, then throw out the combinations where groups have less then 6 balls, and then throw out combinations where groups don''t have a green ball), but I''m interested in a more elegant solution. Any ideas? Thanks, Brian
Since each group has to have one green ball it is the same as how many ways can 15 red and 2 green balls be divided into three groups with each group having at least five balls. That can be viewed as two problems. One being how many ways can 17 balls be divided into three groups with at least five in a group and the other being how can two balls be divided into three groups. With the first one you know where 15 of those balls have to go and the only option you have is where to place the other two so how many ways can you place two balls in three groups. Now all you have to do is figure out what the answer to those two problems are and how to combine those answers together to answer the orginal problem

Edited by - LilBudyWizer on January 18, 2001 4:54:07 PM
Keys to success: Ability, ambition and opportunity.

This topic is closed to new replies.

Advertisement