Post:

You have three switches in one room and a single light bulb in another room. You are allowed to visit the room with the light bulb only once. How do you figure out which switch controls the bulb? Write your answer in the comments before looking at other answers.


Comment:

If this were an interview question, the correct response would be "Do you have any relevant questions for me? Because have a long list of things that more deserving of my precious time than to think about this!

  • Strlcpy@1@lemmy.sdf.org
    link
    fedilink
    arrow-up
    3
    ·
    2 days ago

    What bothers me about this specific question, apart from it being dated, is that it breaks the rules of these kind of riddles. They’re implied to be in a sort of frictionless sphere universe, the whole preposition is silly except as an abstract puzzle. To then rely on the physical properties of real lamps is cheating. You’re supposed to ignore all the real-world aspects of the setting except that one.

  • MNByChoice@midwest.social
    link
    fedilink
    arrow-up
    3
    ·
    3 days ago

    Building codes, at least the ones I am aware of, require the light switch inside the room with the light next to the door, similar to how nearly every room you have ever been in. (Everyone knows of exceptions.) This means either corners have been cut, at those switches should control things within the room with the switches.

    As the interviewer if attention to detail and following build codes and specifications is important at this company. Is there a culture of safety, or are corners cut that put my life at risk.

  • NaibofTabr@infosec.pub
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    3 days ago

    Based on the provided information, there are some switches of unspecified type in one room and a light bulb of unspecified type in another room. There is no power source, nor do we know if there is even wiring between the switches and the bulb. For all we know, the switches and the bulb are still in their product packaging waiting to be installed by an electrician.

    The bulb is not controlled by any of the switches in any meaningful manner.

    Also, per the problem specification, I am allowed to visit the room with the light bulb only once. I am not allowed to visit the room with the switches, or operate the switches.

    The comment in the original image is the most rational possible answer to such an exercise. Poorly stated problems are a waste of time.

    *Edit: You know what, scratch all that, none of it really matters.

    I’m not messing with an unknown electrical circuit without seeing the circuit diagram and verifying any relevant lockout/tagout. People die from that shit.

  • JackbyDev@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 days ago

    Impossible even if you know if the light is on or off to start with. Even then, there are 2 possible outcomes which means the solution space halves on each test. 3 divided by 2 is greater than 1 (1.5) so we cannot figure it out in a single test.

    That’s my recollection of how to solve these from computer science. The classic one is 8 coins and figuring out which one weighs a different amount (and you don’t know if it is more or less). You have a scale that tells you which side is heavier (or equal) but it doesn’t give readouts (as in it doesn’t say a side is X pounds/grams). With only three uses of the scale, how can you find the fake coin? I’m not going to go into the process in depth but because you have THREE outcomes (left heavier, equal, and right heavier) you reduce the solution space (which of the 8 coins is the bad one) by a THIRD each test. The number 8 sort of lures into thinking powers of 2. You can actually do it with 9 coins in 3 tests.

    Some of the details of my explanation may be wrong, it’s been over a decade since I took that class in college lol. It was my worst professor (while different story lol) but I distinctly remember him talking about this. He had a very thick accent, some form of eastern European or Russian, I’m not really sure what exactly. But he gave us that problem as homework or something or maybe just to think about. And he’d ask us to explain how we’d do it. Whenever someone began to describe something doing like test 4, 2, etc instead of the correct way (which involves using coins you already tested) he’d say “YOU’RE DOOMED!” Then someone else would try, and when they got to a way that wouldn’t work “YOU’RE DOOMED!” It was hilarious. Very memorable.

    • chaos@beehaw.org
      link
      fedilink
      arrow-up
      3
      ·
      2 days ago

      Hint: the solution depends on a more realistic and physics-based model of the problem than you’re using. And, even bigger hint, it’s less intuitive now that light bulb technology has changed to become much more efficient, you should imagine this problem taking place with a '90s bulb.

      • JackbyDev@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 days ago

        Yeah, after reading the answers I see it more clearly. Also, I assume in hindsight that it’s three switches which can be on or off, so we know if all three are off the light is off. Which helps as well.

  • aarch64@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    3 days ago

    My burn-the-house-down take on this: very slowly flip each switch on and listen for arcing. Works fine assuming the other two switches aren’t connected to anything.