I think there is a logical / mathematical solution to this problem and I am pretty sure someone here knows the answer. 🙂
This is being written in PHP.
Lets say I have 3 apples, 3 bananas, and 3 oranges.
I need to be able to create the maximum amount of “Fruit Baskets possible” with categories / requirements of:
Category A = Any Fruit / 3 Required
Category B = Bananas or Oranges / 2 Required
Category C = Oranges / 1 Required
Category D = Apples or Bananas / 2 Required
What are the maximum number of baskets I can make? I need to know how to get the solution, not necessarily what the solution is. I also would like to know what this is called if anyone knows.
Additionally, these numbers can grow into the thousands, so I need to be able to do this without destroying the computer.
These are called “combinations”
http://en.wikipedia.org/wiki/Combination