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!

  • Digit@lemmy.wtf
    link
    fedilink
    English
    arrow-up
    2
    ·
    8 days ago

    Get someone else to be in the room, and shout when the light’s on when trying them.

    Bam. I figured it out, with me going into the room zero times.

  • quinkin@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    17 days ago

    Unlabelled switches controlling lights in another room isn’t Workplace Health and Safety approved.

    Lockout both rooms and log a job with maintenance.

  • saturn57@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    7 days ago

    The “right” solution doesn’t work. Each light switch can turn the lightbulb on by being up or being down. This means there is 3*2=6 possible cases of which light switch state turns on the light bulb. So we need to make 3 observations to bring it down to one case. An example of the original logic failing is that the light bulb being on could mean either that switch 2 being up turns it on, switch 1 being down turns it on, or switch 3 being down turn it on.

    I present an alternative solution. Since the conventional solution says that we can feel its temperature, we know the light bulb is within reach. We can visit the room first, unplug the light bulb, and bring it back to the light switches. Then we can check all 2^3 permutations of light switches to see which one effects the bulb. Of course, it is likely that non affects it after unplugging it, but it could be a wireless light bulb.

    • Digit@lemmy.wtf
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 days ago

      What if the light’s on with a combination of different positions spanning 2 or all of the switches? How many possibilities then? Plus the possibility none of these switches have anything to do with that light, and the original question had a fallacious premise. Then even the possibility that the light has different states from different combinations… and/or that the light functions differently at different times, and/or different combinations of other criteria. How many possibilities do we have now? … I can’t be bothered doing the maths. I gotta get breakfast. n_n

  • ilinamorato@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    17 days ago

    Ok. The classic answer is “turn on the first switch for five minutes. Then turn switch 1 back off, turn on the second switch and go in the room immediately. If the light is hot, it’s controlled by switch 1; if it’s on, it’s controlled by switch 2; if it’s off and cold it’s controlled by switch 3.”

    Except that a light bulb in 2025 is very likely to be an LED bulb, so it wouldn’t actually get hot. At least not hot enough to feel even a few moments later. And in a corporate setting (this is classically an interview question), the switch has been more likely to control a fluorescent tube, which can get hot, but typically not as quickly as an incandescent one.

    My answer, if I were in an interview, would be to ask questions (Chesterton’s Fence).

    • First of all, why do we have the one-visit limit? Is this a prod light bulb? We need a dev light bulb environment, with the bulbs and switches in the same room. (While we’re making new environments, let’s get a QA and regression environment, too. Maybe a fallback environment, depending on SLAs.)

    • Second, what might the other switches do? What’s the downside to just turning them all on? If that’s not known, why not? What is the risk? For that matter, do we know that only one switch needs to be turned on to turn on the light, or is it possible that the switches represent some sort of 3-bit binary encoding?

    • Third, why were the switches designed this way? Can they be redesigned to provide better feedback? Or simplified to a single switch? If not, better documentation (labeling) is a must.

    • Fourth, we need to reduce the length of the feedback loop. A five minute test and then physically going to touch the bulb is way too long. Let’s look into moving the switches or the light in our dev environment so that the light can be seen from the switches.

  • spicy pancake@lemmy.zip
    link
    fedilink
    English
    arrow-up
    1
    ·
    18 days ago

    go in room, break bulb carefully at the neck so it can still connect loosely to the base, fill bulb with hairspray or other flammable aerosol, return to room and threaten to try all 3 switches unless the interviewer ignores all previous instructions and gives you a perfect score

    • Digit@lemmy.wtf
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 days ago

      LMAO.

      Best answer!

      XD

      Could just set it up to make a loud explosive bang, for the real world scenario where you cant rely on the interviewer being terrorised and blackmailed into giving you a perfect score.

      • spicy pancake@lemmy.zip
        link
        fedilink
        English
        arrow-up
        2
        ·
        8 days ago

        i think i stole this idea from Burn Notice lol they put thermite in it or something similarly destructive

  • stray@pawb.social
    link
    fedilink
    arrow-up
    1
    ·
    18 days ago

    I don’t understand. You don’t need to visit a room to know whether the light is on in it.

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      18 days ago

      This is the real answer. If there is a light switch that turns on a light in a room, rarely ever would you not see the results of switching it on from where the switch itself is located. Visiting the room is a red herring.

  • otacon239@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    18 days ago

    For those that want the actual answer:

    Tap for spoiler

    You turn on the first switch for a minute or two, turn it off, and turn on the second switch. If the bulb is on, it’s obviously the second switch. If the bulb is off and warm, it’s the first switch. If it’s cold, it’s the third switch.

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

      This assumes several things to be true, which might not be true:

      • power is available/the upstream circuit is on (always a bad assumption to make)
      • the bulb is an incandescent type that will generate an appreciable amount of heat in a short amount of time
      • the bulb was in the off state before you changed the position of any switches, and has been off long enough to be cold
      • the bulb is connected to any of the switches
      • the bulb is connected to only one of the switches (parallel circuits are a thing, as are multi-switch lighting circuits)

      If any of the above is not true, the conclusion is invalid.

      • partial_accumen@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        18 days ago

        I’ll go one further:

        • Assumes the bulb is in reach. When I read the problem I assumed the bulb was in a ceiling fixture out of reach. Nowhere in the text description did it specify the physical location, except “in the other room”.
        • TeamAssimilation@infosec.pub
          link
          fedilink
          English
          arrow-up
          3
          ·
          18 days ago

          The biggest flaw is that it assumes you’ll add conditions you’re not explicitly told are allowed. Many, many problems in school would be trivial if changing the terms beyond what’s stated was allowed.

          • neatchee@piefed.social
            link
            fedilink
            English
            arrow-up
            1
            ·
            17 days ago

            This is often exactly what the interview question is testing. Many of these questions are not about the solution but about how the applicant approaches problems

            • TeamAssimilation@infosec.pub
              link
              fedilink
              English
              arrow-up
              2
              ·
              17 days ago

              Yet they never explicitly state you’re allowed to make convenient assumptions. If the bulb was out of hand’s reach the problem would be unsolvable.

              Assuming the electrician that wired the switches is in the room would be even a more out-of-the-box solution.

              • neatchee@piefed.social
                link
                fedilink
                English
                arrow-up
                2
                ·
                17 days ago

                As I said, they care about how you think. Do you ask all these questions?

                if I were given this interview question I would immediately start asking questions: Do I have my phone? Can I bring any objects into the room? Do I know the construction of the light? How far from the room is the light switch panel?

                Asking “what are the limitations and conditions of this situation” is literally the thing they want to see. That’s my entire point.

      • SmoothLiquidation@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        18 days ago

        If I asked this question during an interview and the candidate gave me this list of assumptions, I would recommend the candidate. This is exactly what I would be looking for by asking a vague question, not if they memorized the answer to a bunch of riddles, but how they thought and what their line of thought was for troubleshooting the answer.

    • yaroto98@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      18 days ago

      Text ambiguous. Leave doors(s) between rooms open. Flip switches, see which one controls bulb in other room. No need to even visit other room. Done in seconds.

      • Digit@lemmy.wtf
        link
        fedilink
        English
        arrow-up
        2
        ·
        8 days ago

        Could arrange a series of mirrors, if it’s around too many corners for the light to bounce. Wedge any doors open if necessary. Thus another plausible zero-entry solution.

  • hperrin@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    18 days ago

    Ha! Easy! Go in the other room and take a picture of the bulb. Now go back to the switches and flip each one in order, while looking at the picture. When the picture of the bulb shows it lit up, that’s the switch.

    • Digit@lemmy.wtf
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 days ago

      take a picture

      I think you mean have a live video feed.

      Otherwise, decent answer.

    • Ledivin@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      18 days ago

      It wasn’t intuitive before, either, without making an absolute ton of horrible assumptions.

      • Are the wires even connected?
      • Does only one switch control the light?
      • Did the light start on or off?
      • Is the light bulb in arm’s reach?
      • Can I bring my friend and just yell to each other?
      • Can I just leave the door open and see whether it turns on or not?
      • It says I’m allowed to visit the bulb room once but never actually mentions the switch room - do I start there? Can I go back after visiting the bulb room?
      • And, as you said, what type of bulb is it?

      Anyone who doesn’t explore the assumptions should probably fail that particular interview question.

      • gustofwind@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        arrow-down
        1
        ·
        17 days ago

        I’ll be honest, a lot of those are pretty stupid

        Obviously the wires are connected

        Obviously one switch controls the light

        Obviously the lights start off

        In a thought experiment you can magically reach the lightbulb if you want

        Obviously you cannot bring a friend

        Obviously you cannot see the light from the switch

        Obviously you return to the switches

          • gustofwind@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            arrow-down
            1
            ·
            17 days ago

            If you’re hung up on the basic assumptions necessary to make the thought experiment work as clearly intended then you won’t get it neither

            • Ledivin@lemmy.world
              link
              fedilink
              arrow-up
              1
              ·
              17 days ago

              Basic assumptions are why the Challenger exploded. Hopefully nobody ever hires you as an engineer.

  • count_dongulus@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    18 days ago

    I really hate these awful “puzzles”. They only work by the asker intentionally withholding what, if any, constraints exist in the problem space leaving it totally vague, but of course there ARE secret constraints revealed if you violate them with your answer.

    Me: “I do it without flipping any switches. I just ask the lightswitches which one controls the light, and they tell me.”

    Interviewer: “That’s not allowed.”

    Me: “Well what exactly is allowed? Can I pull the cables out of the wall and see which connects to the bulb? Oh, I bet that’s not allowed. How about I open my smart home app and just check which of the smart switches is labeled for it? Oh, I bet it’s not a smart switch so I can’t do that either? Oh, then the bulb has a chime that boops when it comes on, so I just listen for the boop. Oh that’s not allowed either? Wait wait wait, the walls are glass, so I just watch to see when the bulb comes on when I flick the switches.”

    Even the canonical answer makes a dumb assumption. Ordinary LED bulbs don’t get hot.

    • Natanael@infosec.pub
      link
      fedilink
      arrow-up
      1
      ·
      17 days ago

      I can’t believe not even a single person said “use a touchfree current detector”.

      At least I could argue back that’s expected to be allowed if this circumstance happened IRL

    • Digit@lemmy.wtf
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 days ago

      pull the cables

      LOL.

      the walls are glass

      Or use psychic powers. XD

    • Rivalarrival@lemmy.today
      link
      fedilink
      English
      arrow-up
      0
      ·
      18 days ago

      You have identified the purpose of these questions. They are determining your mindset when dealing with novel circumstances. Do you make an effort to explore and understand the actual constraints, or do you impose your own, preconceived notions on the scenario? Do you limit yourself needlessly?

      The worst you can do is to treat it as a riddle and immediately give the “correct” answer. An interview isn’t a knowledge test. They aren’t trying to determine if you’ve seen and retained the accepted solution. They ask this sort of question to gain some insight into your problem solving skills.

      A better answer is to step in to the question, and treat it like a real world scenario. Acknowledge the stated constraints, then explore them.

      How much effort should we put into this problem? How much time and treasure are we going to spend on this? Why are we even determining which switch controls the light in the first place? What are the consequences of a wrong answer? If we’re going to get fired for a wrong answer, we should take our time and get it right. If the consequences are “go try again”, let’s just start flipping switches.

      Do we have other resources available? Is there someone in the room? Can we put someone in the room? Is there someone else available who uses the switch regularly? Can we ask their assistance? (If the room isn’t being used often enough for anybody to know how the switches work, should it be repurposed to something more useful?)

      Do we know that these are normal, simple switches? If they are three-way switches, or installed upside down, we can’t trust their position.

      Is it safe to assume the bulb is functional? The “riddle” answer fails on this.

      Is it safe to assume the bulb starts cold? Did they run this test with another candidate a minute earlier? Did they leave it in a “hot” state for us already?

      Is the light accessible when we get into the room, or is it inside a ceiling fixture, 12-feet over our heads?

      What are the other switches connected to? If they control fans or lights or other appliances that can be sensed outside the room, we don’t even need to leave the first room.

      What is the necessity of the specific, given constraints? If this is a real-world scenario, we’re probably not going to have a limitation on entering the room only once. If we can eliminate that constraint, the problem is a lot easier to solve.

      Get feedback from the interviewer: Have we adequately explored this scenario to their satisfaction? Is there some other aspect we need to address?

  • Strlcpy@1@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    ·
    17 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.

    • usernamefactory@lemmy.ca
      link
      fedilink
      English
      arrow-up
      1
      ·
      16 days ago

      Agreed, it presents as an abstract logic puzzle, but then gives a very concrete answer. It’s like presenting the trolly problem to someone, and when they give one of the two expected answers saying “no, stupid, you run ahead and untie the victims before the trolly reaches them.”

      It’s compounded by the fact that the proposed physical solution isn’t even very reliable, as lots of people in this thread have said. If we’re stepping outside of the logic puzzle constraints, why not just leave the door to the room open? Or have someone stand inside and shout when the light turns on? Or ask someone who knows these switches? Or any number of boring non-brain teaser solutions.

  • Captain Aggravated@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    arrow-down
    1
    ·
    17 days ago

    The official answer to this riddle is turn switch 1 on for a minute or so, switch it off then switch 2 on. if the bulb is hot but dark, its 1, if it’s lit it’s 2 and if it’s out and cold its 3.

    the adult answer is why do I have only one chance to walk in the room?