I have a question, suppose I have 3 wires which can be connected to input and output nodes 'a', 'b' and 'c', and the combination number of wire pairings needs to be calculated and returned.
By manually trying to solve this it appears that the combination number is simply the factorial of the wire number, or 3!, like in the following example:
I'm interested in an algorithmic approach though (in Python) to solve it for bigger numbers, however, my programming skills are pretty terrible as of now...
So I tried to initialize two tuples with the names of the inputs/outputs: (Maybe I should use sets instead because the order doesn't matter?)
inputs = ('a', 'b', 'c')
outputs = ('a', 'b', 'c')
But now I have no idea what next, I tried different methods with nested for-loops but I can't seem to get the correct results.
The output of the program in this case should return me lists with the combinations, something like the following:
1. [['a <-> a'], ['b <-> b'], ['c <-> c']]
2. [['a <-> a'], ['b <-> c'], ['c <-> b']]
3. [['a <-> c'], ['b <-> b'], ['c <-> a']]
4. [['a <-> b'], ['b <-> a'], ['c <-> c']]
5. [['a <-> b'], ['b <-> c'], ['c <-> a']]
6. [['a <-> c'], ['b <-> a'], ['c <-> b']]
Number of combinations: 6
Thank you again, I'd be very thankful for any help, and excuse me if the question is silly...