This is an Ethernet crossover cable to connect two Ethernet ports:
Let's say you forgot correct pinout. Can you try manually all possible ways to connect it?
OK, you may remember that pins 1, 2, 3 and 6 are used. How many permutations of wires are possible?
#!/usr/bin/env python3
import itertools
wires=["left_1", "left_2", "left_3", "left_6"]
print ("right_1, right_2, right_3, right_6")
for x in itertools.permutations(wires):
print (x)
This is 4!=24:
right_1, right_2, right_3, right_6
('left_1', 'left_2', 'left_3', 'left_6')
('left_1', 'left_2', 'left_6', 'left_3')
('left_1', 'left_3', 'left_2', 'left_6')
('left_1', 'left_3', 'left_6', 'left_2')
...
('left_6', 'left_2', 'left_1', 'left_3')
('left_6', 'left_2', 'left_3', 'left_1')
('left_6', 'left_3', 'left_1', 'left_2')
('left_6', 'left_3', 'left_2', 'left_1')
Now if you forgot these pins, you may ask, how many ways there are to insert 4 wires in 8P8C connector?
#!/usr/bin/env python3
import itertools
wires=[1, 2, 3, 4, 5, 6, 7, 8]
for x in itertools.combinations(wires, 4):
print (x)
This is 8 choose 4 or C(8,4)=70.
(1, 2, 3, 4) (1, 2, 3, 5) (1, 2, 3, 6) (1, 2, 3, 7) ... (4, 5, 6, 8) (4, 5, 7, 8) (4, 6, 7, 8) (5, 6, 7, 8)
Now how many ways there are to connect two 8P8C connectors using 4 wires?
#!/usr/bin/env python3
import itertools
wires=[1, 2, 3, 4, 5, 6, 7, 8]
for x in itertools.combinations(wires, 4):
for y in itertools.permutations(x):
for z in itertools.combinations(wires, 4):
print (y, "<->", z)
It's 117600:
(1, 2, 3, 4) <-> (1, 2, 3, 4) (1, 2, 3, 4) <-> (1, 2, 3, 5) (1, 2, 3, 4) <-> (1, 2, 3, 6) (1, 2, 3, 4) <-> (1, 2, 3, 7) (1, 2, 3, 4) <-> (1, 2, 3, 8) ... (8, 7, 6, 5) <-> (4, 5, 6, 7) (8, 7, 6, 5) <-> (4, 5, 6, 8) (8, 7, 6, 5) <-> (4, 5, 7, 8) (8, 7, 6, 5) <-> (4, 6, 7, 8) (8, 7, 6, 5) <-> (5, 6, 7, 8)
This coincides with Number of non-attacking placements of 4 rooks on an n X n board (for 8*8 board). (Coincidentally? Not sure.)
