There is a house with 100 lights. In the basement there are 100 switches for the lights. Sadly, you have forgotten which switch is connected to which light.

Currently they are all on. You go down and change some switches and come back up. You check the lights. This counts as 1 trip.

What is the minimum number of trips required to know exactly which switch is connected to which light?

Each switch is connected to only one light, and each light is connected to only one switch (i.e. a switch turns on/off a specific light).

  • 2
    $\begingroup$ Does this answer your question? Least amount of trips (see the answers for generalisations that can be expanded to cover the 100-bulb case) $\endgroup$
    – Stiv
    Mar 8 at 21:57
  • $\begingroup$ @Stiv i am not happy with u closing my question without telling me and also the 'similar question; did not answer this question so there was no need to close this one and also the answer was 7 $\endgroup$ Mar 8 at 22:15
  • 5
    $\begingroup$ Hi TG. This is how the system works with duplicates, I'm afraid - once a sufficient number of dup-votes are placed the question is auto-closed. But note that we already have an answer on this site to your question - see Sleafar's answer in the linked question for a method that can be applied to any number of bulbs and switches. It's the same question, just with a different number of switches. Being a different number isn't sufficient justification to have a whole other question - all other elements are the same. (Otherwise we could have 100 questions on the site to cover the first 100 cases.) $\endgroup$
    – Stiv
    Mar 8 at 22:20


Browse other questions tagged or ask your own question.