# [Numpy-discussion] Combinations of objects (?)

Andrea Gavana andrea.gavana@gmail....
Mon Oct 20 10:02:47 CDT 2008

```Hi All,

On Mon, Oct 20, 2008 at 12:48 PM, Alan G Isaac wrote:
> On 10/20/2008 5:20 AM Andrea Gavana apparently wrote:
>>     this is probably a very silly question, but combinatorial math is
>> not exactly my strength and I am not even sure on how to formulate the
>> question. I apologize if it is a very elementary problem.
>> Let's suppose that I have 60 oil wells and 3 surface facilities. Every
>> well must be tied-in (linked, attached) to one and only one of these
>> surface facilities. No orphan well is allowed (i.e., a well not
>> attached to any surface unit) and no multi-links are allowed (i.e.,
>> one well attached to 2 or more units). Is there any simple way in
>> numpy (scipy?) in which I can get the number of possible combinations
>> of wells attached to the different 3 units, without repetitions? For
>> example, I could have all 60 wells attached to unit number 1, then 59
>> on unit 1 and 1 on unit 3 and so on...
>
> I think you are just asking how many ways you
> can put N marbles into K boxes, with no restrictions.
> Since there are K possibilities for each marble,

Uhm, I am not sure, I imagined TJ answer is correct by reading the
Python thread he kindly posted. As there shouldn't be repetitions
(i.e., each combination is unique) and every single well must be
attached to one and only one unit, it seems to me that 3**60 is a very
big number :-D
But combinatorial things are pretty obscure to me...

In any case, thanks to you all for your suggestions.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
```