4 Wires

Probability Level pending

You have a cable with 4 wires inside.

If they were color coded like this, it would be easy to tell which wires are which.

However, suppose they aren't color coded, but you have a potentiometer, which can detect if two ends of a wire are connected or not, and you can short together as many wires as you like on either end of the cable, including one you might have hooked to the potentiometer.

What is the minimum number of times you would need to hook up the potentiometer in order to guarantee the determination of which wires on one end connect to which wires on the other end?

Clarification: No matter what the result of your measurements (i.e. assuming the worst case scenario), what is the minimum number of measurements that guarantees that you can determine the connectivity of all four wires?


Inspired by: Brian Charlesworth

Image credit: http://www.newyorkcables.com
4 3 5 7 16 8 10 6

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Geoff Pilling
Feb 19, 2017

First off, there are 4 ! = 24 4! = 24 different ways the wires could be connected up, and every time you make a measurement, you get one bit of information (connected or not connected).

So, the lower bound on the number of times you'd need to hook up the potentiometer is:

log 2 ( 24 ) = 5 \lceil \log_2(24) \rceil = 5

And, you can do it with five measurements as follows:

Call the wires on one end A1, B1, C1, and D1, and the wires on the other end A2, B2, C2, and D2.

(1) Short A2 and B2 together, and hook the potentiometer between them and A1.

If it shows a connection, you know A1 connects to A2 or B2. Otherwise, you know that A1 connects to C2 or D2.

(2) Connect the potentiometer between A1 and one of the two that you know it has to be connect to.

Now you have determined which one A1 connects to with 2 hook ups.

So, now you have 3 wires you need to figure out the connectivity of, lets rename them E1, F1, and G1 on one end, and E2, F2, and G2 on the other end.

This can be done, as follows:


3) Measure E1 vs E2:

   If they connect:
          4) Measure F1 vs F2
                   If they connect:  E1-E2, F1-F2, G1-G2
                   If they don't:  E1-E2, F1-G2, G1-F2
   If they don't:
          4) Measure F1 vs E2:
                   If they connect:  
                          5) Measure E1 vs F2:
                                 If they connect:  E1-F2, F1-E2, G1-G2
                                 If they don't:  F1-E2, E1-G2, G1-F2
                   If they don't:   
                          5) Measure F1 vs F2
                                 If they connect:  E1-G2, F1-F2, G1-E2
                                 If they don't:  E1-F2, F1-G2, G1-E2

So, the most it should take is 5 \boxed5 measurements.

Nice solution. I figured you wouldn't have posted this question unless you had found a way to make a full determination in 5 measurements, but before choosing that option I gave it another try and realized we could indeed identify the first wire in 2 measurements, reducing the problem to the 3-wire version.

So with 5 wires ..... :)

The first wire can be identified in 3 measurements for sure, which would give an upper bound of 8 total, but is there a way to get it down to the lower bound of 7?

Brian Charlesworth - 4 years, 3 months ago

Log in to reply

Haha... Just what I was wondering... Its 120 vs 128, so we will need to be very careful how we choose our measurements to split the remaining possibilities in half as closely as possible each time...

Geoff Pilling - 4 years, 3 months ago

Log in to reply

I think the obvious solutions are out... Connecting one on one end to multiple on the other end... And I tried connecting 2 on one end with 2 on the other end, and none seem to achieve the optimal lower bound... So, I think 5 might be the first one that breaks us... But, I wonder if there might be a clean way to prove that this is the first that breaks us... And I wonder if there might be higher numbers of wires for which you can once again achieve the lower bound... Like one where n! is quite a bit less than the next highest power of two...

Geoff Pilling - 4 years, 3 months ago

Log in to reply

@Geoff Pilling I wonder if maybe tying them together on one end, and hooking the potentiometer up to the other end could work for 5 wires?

Geoff Pilling - 4 years, 3 months ago

Log in to reply

@Geoff Pilling Hmm.... This does give me some ideas ....

Brian Charlesworth - 4 years, 3 months ago

@Geoff Pilling Yeah, I tried the same things and couldn't find any efficiencies. The 'one on one side/multiple on the other' test approach identifies the first wire in 3 measurements, reducing the problem to the 4-wire case. The 'two on one side/two on the other' test leads to too many scenarios that one has to track down. I had hoped this last test would allow us to identify 2 wires in 4 measurements, reducing the problem to the 3-wire case, but it just doesn't seem to pan out. That first wire seems to take a minimum of n 2 \lceil \frac{n}{2} \rceil measurements to identify, reducing the problem to the ( n 1 ) (n - 1) -wire case.

There still may be some not-so-obvious method just around the corner ....

Brian Charlesworth - 4 years, 3 months ago

Perfect solution! So you simplified it to 3 out of 3 which we have already solved. However I am confused as to what your first measurement was. Doesn't the pot only show whether the connections are correct or not?

Ajinkya Shivashankar - 4 years, 3 months ago

Log in to reply

Ah, glad you liked it! Good, point, in a bit, I'll clarify the solution.

Geoff Pilling - 4 years, 3 months ago

Log in to reply

There, I've clarified the solution a bit.

Geoff Pilling - 4 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...