Tuesday, February 24, 2009

Toggle bulbs and switches

room lighting.. room with 100 bulbs and switches..

100 people goes in one by one.

1st person toggles all switches.

2nd person toggles all switeches which are multiles of 2 (2,4,6..)

and so on ( till 100th person toggling only 100th switch)

once finished with all, ==> which all bulbs are ON.

1th: all switches are ON
2nd: 2, 4, 6, 8, ... switches are OFF
3rd: 3, 9,... OFF
3rd: 6 12 ... ON
:
:
:
100th: only toggle 100th switch

No comments: