You have to find out which switch is of which bulb, in minimum possible steps.
Switching & entering into the room once is defined as ONE STEP
Ans
Since we have 8 bulbs and 8 switches, we only need to find out 7 bulb/switch pairs and then we should know the 8th pair.
With the remaining 7 switches, I choose to switch on two at a time (switching everything else off before each step), like this:
1&2
2&3
And then we should be able to pair switches 1, 2 and 3 to their respectful bulbs with bulb no. 2 being the one lit in both steps and bulbs no. 1 and 3 lit in their respectful steps, and then continue with the same method:
4&5
5&6
Having figured out switches 4,5 and 6 also, we only need to flick switch number 7 to see which one that links to. And as stated previously we should also know by then that bulb no. 8 is the one that was never turned on.
Anybody that can do it in fewer steps?
I'm at work right know, which I should really be getting back to
WAIT! - Strike everything above
Having written this post I wondered if turning on three bulbs at a time would work better.... and yeah.... I'm guessing we could do it in 4 steps... :P
Turning on:
Step 1: 1 & 2 & 3
Step 2: 3 & 4 & 5 Giving us the bulb linked to no. 3 (lit first two steps)
Step 3: 5 & 6 & 7 Giving us bulb no. 5 (lit in step 2&3) AND bulb no. 4 (only lit in step 2)
Step 4: 7 & 8 & 1 Same as above, giving no. 6 (only lit in step 3), no. 7 (lit in steps 3&4), no. 8 (the only one first lit in step 4) and bulb 1 (lit in steps 1 and 4)
I could have just turned on switch 7&1 with switch 8 then being linked to the one bulb never lit. Better yet, the same algorithm could be used to link 9 switch/bulb pairs, then with the 9th bulb never being lit.
I then decided to write out the steps in respect to number of odds and even numbers, as so:
1 - odd number 1 = O1
2 - even number 1 = E1
3 - odd number 2 = O2
4 - even number 2 = E2...
With this notation, the steps for the above problem (with 8 or 9 bulbs that is) would be:
O1 & E1 & O2
O2 & E2 & O3
O3 & E3 & O4
O4 & E4 & O1
As some might notice, the number of steps required to pair X switches/bulbs is the same as the number of even numbers counting up to (and including) X. And because an even number divided by two gives us the number of even numbers counting up to that number, all we need to do is to subtract one from the number if X is an odd number, and I would guess the best mathematical notation for that would by x - modulus(x/2), right?
So the the number of steps required to pair X switches to X bulbs is (x - modulus(x/2)) / 2
So, for example, to figure out 13 switch/bulb pairs, we would need:
(13 - modulus(13/2)) / 2
(13 - 1) / 2
12 / 2 = 6 steps
0 comments:
Post a Comment