Algorithm to find all possible combinations of a group of LEGOs?

149 Views Asked by At

The other day I walked by a LEGO store in The Mall I was shopping at, and it brought back some memories. Then that got me thinking: There's got to be some mathematical algorithm to find all the possible combinations of any given group of LEGO pieces. (If you don't know what LEGOs are, see this link). I'm not great in the math department, but I was wondering if anyone's already come up with something like this, or if someone could. I just thought this would be an interesting idea.

Edit: I understand that this is quite a bit more difficult than I thought when I originally proposed the idea, so for the sake of simplification, suppose that they're just regular 2x4 legos of the same color. The number of them would be 2. After that we could try 3 to see if our algorithm works.