Switch

Logic Level 2

There is a circle of n n light bulbs with a switch next to each of them. Each switch can be flipped between two positions, thereby toggling the on/off states of three lights: its own and the two lights adjacent to it. Initially, all the lights are off.

Let the minimum number of flips needed to turn on all the n = 12 n=12 and n = 13 n=13 light bulbs be a a and b b , respectively. Then what is the value of a + b a+b ?


The answer is 17.

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.

3 solutions

Jesse Nieminen
Jun 23, 2016

Relevant wiki: Information Compression

General solution:

Let us have n n light bulbs labeled a 1 , a 2 , , a n a_1, a_2, \cdots, a_n and n n switches labeled b 1 , b 2 , , b n b_1, b_2, \cdots, b_n .

If n 3 n \leq 3 clearly the minimum number of flicks is 1 1 since any flick causes every light bulb to turn on.

Now, if n > 3 n > 3 is divisible by 3 3 clearly the minimum number of flicks needed is n 3 \frac{n}{3} because flicking every third switch turns every light bulb on.

However, if n > 3 n > 3 is not divisible by 3 3 the minimum number of flicks needed is n n .

Proof:

If we flick a switch, for instance b i b_i , lamps a i 1 , a i and a i + 1 a_{i-1}, a_{i} \text{ and } a_{i+1} turn on.

Now if we flick b i + 1 b_{i+1} by induction we must also flick b i + 2 b_{i+2} and hence every switch must be flicked resulting the minimum number of flicks to be n n . Also, by symmetry, flicking b i 1 b_{i-1} gives the same result.

If we flick b i + 2 b_{i+2} we must also flick b i + 1 b_{i+1} because lamp a i + 1 a_{i+1} is on and flicking any switch again makes no sense, since we already have flicked it. This gives the same result.

Now we are forced to flick b i + 3 b_{i+3} since it is the only possible way to try to turn lamp a i + 2 a_{i+2} on without flicking every switch.

We continue like this, flicking every third switch, but this results in us flicking every switch because n n is not divisible by 3 3 .

Thus, the minimum number of flicks in this case is n n . \square

Answer to the problem:

Using the general solution we find that a = 4 , b = 13 a + b = 17 a = 4, b = 13 \Rightarrow a+b = \boxed{17} .

Or you can say for proving that for a number of bulbs which are not divisible with 3 there are anyway needed n switches since every light bulbs must be turned an odd number of times anyway.

This leads to the conclusion , considering the argument of parity , that under the limits of switching in the problem generally you have to turn all the light bulbs anyway.

A A - 4 years, 11 months ago

I don't understand your proof because it says that we absolutely MUST flick certain switches, but I don't see why.

Fabricio Kolberg - 3 years, 7 months ago

When there are 13 bulbs we can turn all switches each in clockwise direction, Hence after 13 flips all bulbs are turned on since each bulb is toggled 3 times in whole process once when it's switch is used and other two times when adjacent switches are used, Thus b=13. When there are 12 bulbs we can flip 1st, 4th, 7th, 10th switches for example ie; grouping them into multiples of three, Thus a=4. Therefore a+b=13+4=17.

The process described by you for 13 bulbs is right but you do not point out if this procedure is the minimum or not and hence do not prove it. Show that it is minimal and it's done anyway.

A A - 4 years, 11 months ago
Willem Monsuwe
Aug 20, 2018

The order in which the switches are flipped does not matter, and flipping the same switch twice results in the same configuration. Therefore in a minimal solution, each switch is flipped at most once.

Look at a group of three adjacent lights. The middle light is only affected by the three switches next to those. Therefore, for each group of three adjacent lights, the number of flipped switches in that group must be odd.

Now, look at two groups of three that overlap, forming a group of four lights. The difference between the two groups is the two switches at the ends. But since both groups must have an odd number of flipped switches, the switches on the ends must be in the same position.

In short, every third switch must be flipped, going around the circle, until we reach a switch that is already flipped. If the circle is divisible by 3, we flip every 3rd switch, but otherwise that means we visit (and flip) every switch.

So for n=12 that is 4 switches, and for n=13, 13 switches for a total of 17.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...