Light and bulb problem from an old maths contest

combinatoricscontest-mathproblem solvingproof-writingpuzzle

In a room there is a series of bulbs on a wall and corresponding switches on the opposite wall. If you put on the $n$ -th switch the $n$ -th bulb will light up. There is a group of men who are operating the switches according to the following rule: they go in one by one and starts flipping the switches starting from the first switch until he has to turn on a bulb; as soon as he turns a bulb on, he leaves the room. For example the first person goes in, turns the first switch on and leaves. Then the second man goes in, seeing that the first switch on turns it off and then lights the second bulb. Then the third person goes in, finds the first switch off and turns it on and leaves the room. Then the fourth person enters and switches off the first and second bulbs and switches on the third. The process continues in this way. Finally we find out that first 10 bulbs are off and the 11 -th bulb is on. Then how many people were involved in the entire process?

note– can anyone please show what the pattern of the $n$th switching person will be ? And also how the problem must be solved ? Thank you!

Best Answer

To me, this just seems like binary! Let's count in base 2 to see the pattern.

$0\\1\\10\\11\\100\\101\\110\\111\\1000$

...etc.

We can denote that a switch is off by a $0$ and that a switch is on by a $1$.

But the thing about binary is, it's a way to count! That is, if the eleventh switch is on and the rest are off, then we just have to see what the value of $10000000000$ is in base $10$ (it is $2^{10}$, or $1024$).

Conversely, if we know that $n$ people have visited, then express $n$ as a binary number and read it from right to left (i.e. the last digit is the first switch, the second last digit is the second switch, etc). For example, suppose we know that $37$ people have visited the room. First we express $37$ in binary as $100101$, and read from right to left: the first, third, and sixth switches are on, and the rest are off.

Let me know if you need further clarification :)

Related Question