Suppose the wires are labeled W1, W2, etc., on the west bank and E1, E2, etc. on the east bank. Start by tying W1 to W2, W3 to W4, and so on, leaving W49 and W50 untied.
Now row across the river and test the wires to see which are connected. We might find that E16 is tied E37, E11 is tied E26, E7 is tied E41, and E19 and E27 are unconnected.
Row back to the west bank, untie the wires, and now connect W2 to W3, W4 to W5, and so on, leaving W1 and W50 unconnected.
Now return to the east bank and test again. We might learn that E41 is tied E19, E26 is tied E7, E37 is tied E11, and E16 and E27 are unconnected.
Happily, we can now deduce all the connections. There will be one wire that had been paired in our first test but not in our second — here that’s E16. That wire corresponds to W1. The wire that E16 had been paired with in our first test, E37, must then correspond to W2. And E37 is now connected to E11, so E11 must be W3. And so on: We can work down the list from W1, alternately consulting the current connections and our memory of the first connections to reveal each wire in succession. So only three rowings are necessary.
From Roland Sprague, Recreation in Mathematics, 1963.
Sort of related: There’s a light bulb in the attic, and you’re downstairs facing three on-off switches. How can you tell which switch controls the light with only a single trip to the attic? Turn on Switch 1, leave it on for a minute, then turn it off, turn on Switch 2, and run upstairs. If the bulb is on, then Switch 2 controls it. If the bulb is off and warm (ha!), then Switch 1 controls it. Otherwise it’s Switch 3.