Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. The Three Switches

The Three Switches

Scheduled Pinned Locked Moved The Lounge
htmllampcomquestion
47 Posts 37 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Member 11762424

    if the light is incandescent or halogen, it will get hot if left on. so switch on the first switch, and get distracted for 10 minutes, switch it off, switch on the next one and race upstairs. If the light is on, it is that 2nd switch. If it is off but hot, it was the first switch. Else it is the third switch. If it's an energy-efficient bulb, this won't work.

    J Offline
    J Offline
    Jorgen Andersson
    wrote on last edited by
    #21

    And we have a winner.

    Wrong is evil and must be defeated. - Jeff Ello

    1 Reply Last reply
    0
    • P Peter_in_2780

      The classic solution (which I won't give away) may not work too well with modern LED globes! CFLs maybe. Cheers, Peter

      Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #22

      Exactly what I thought, this "riddle" is going to die out...

      Do not escape reality : improve reality !

      1 Reply Last reply
      0
      • J Jorgen Andersson

        Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp. The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed a single trip to the attic. How do you do it? To clarify: When you are downstairs there is no way to see into the attic, or see reflected light from the attic. Once you have gone to the attic you are not allowed back to the switches. <edit>you can also assume original state of all switches to be off.</edit><hint>Otherwise it won't work</hint> Note: If you already know the answer, or reads the newspaper where I nicked the puzzle from, then please don’t write it up immediately in the comments! Give those who have never heard it before a chance to suffer, I mean enjoy finding the solution.

        Wrong is evil and must be defeated. - Jeff Ello

        R Offline
        R Offline
        R Erasmus
        wrote on last edited by
        #23

        Check the other rooms if their light go on/off?

        "Program testing can be used to show the presence of bugs, but never to show their absence." << please vote!! >>

        1 Reply Last reply
        0
        • P Peter_in_2780

          The classic solution (which I won't give away) may not work too well with modern LED globes! CFLs maybe. Cheers, Peter

          Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

          G Offline
          G Offline
          greldak
          wrote on last edited by
          #24

          Should still work but may need to take quite a bit longer.

          1 Reply Last reply
          0
          • J Jorgen Andersson

            Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp. The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed a single trip to the attic. How do you do it? To clarify: When you are downstairs there is no way to see into the attic, or see reflected light from the attic. Once you have gone to the attic you are not allowed back to the switches. <edit>you can also assume original state of all switches to be off.</edit><hint>Otherwise it won't work</hint> Note: If you already know the answer, or reads the newspaper where I nicked the puzzle from, then please don’t write it up immediately in the comments! Give those who have never heard it before a chance to suffer, I mean enjoy finding the solution.

            Wrong is evil and must be defeated. - Jeff Ello

            B Offline
            B Offline
            b_in
            wrote on last edited by
            #25

            Firstly turn on switch1 for 1 minute, after 1 minute turn off the switch1, then turn on the switch2. go to the room and check the cases: case1: If bulb is on then switch2 is default switch. case2: Touch bulb by your hand if it is warm then switch1 is default switch. case3: If bulb is cold/normal then switch3 is default switch. default: No switch is working. ;)

            1 Reply Last reply
            0
            • P Peter_in_2780

              The classic solution (which I won't give away) may not work too well with modern LED globes! CFLs maybe. Cheers, Peter

              Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

              D Offline
              D Offline
              Dan Neely
              wrote on last edited by
              #26

              CFLs still get hot enough to the touch that you don't want to replace them immediately after they fail. LED's are only marginally more efficient; half of the "bulb" ends up being a heat sink. Bean counters being what they are; I'd expect it to be the bare minimum size required and to still get nice and warm.

              Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

              1 Reply Last reply
              0
              • M Member 11762424

                if the light is incandescent or halogen, it will get hot if left on. so switch on the first switch, and get distracted for 10 minutes, switch it off, switch on the next one and race upstairs. If the light is on, it is that 2nd switch. If it is off but hot, it was the first switch. Else it is the third switch. If it's an energy-efficient bulb, this won't work.

                M Offline
                M Offline
                Moshe Katz
                wrote on last edited by
                #27

                Member 11762424 wrote:

                If it's an energy-efficient bulb, this won't work.

                Not necessarily true. Every bulb I have ever had has gotten hot - Incandescent, Fluorescent, and LED all produce heat. The latter two just produce less heat, so you need to run quicker.

                1 Reply Last reply
                0
                • P Peter_in_2780

                  The classic solution (which I won't give away) may not work too well with modern LED globes! CFLs maybe. Cheers, Peter

                  Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

                  S Offline
                  S Offline
                  Slice24
                  wrote on last edited by
                  #28

                  I don't know... my LED bulbs would definitely fit the solution. It pains me to say, but I just checked.

                  1 Reply Last reply
                  0
                  • P Peter_in_2780

                    The classic solution (which I won't give away) may not work too well with modern LED globes! CFLs maybe. Cheers, Peter

                    Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

                    I Offline
                    I Offline
                    irneb
                    wrote on last edited by
                    #29

                    Agreed. But don't you think you gave it away, through your comment anyway?

                    1 Reply Last reply
                    0
                    • J Jorgen Andersson

                      Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp. The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed a single trip to the attic. How do you do it? To clarify: When you are downstairs there is no way to see into the attic, or see reflected light from the attic. Once you have gone to the attic you are not allowed back to the switches. <edit>you can also assume original state of all switches to be off.</edit><hint>Otherwise it won't work</hint> Note: If you already know the answer, or reads the newspaper where I nicked the puzzle from, then please don’t write it up immediately in the comments! Give those who have never heard it before a chance to suffer, I mean enjoy finding the solution.

                      Wrong is evil and must be defeated. - Jeff Ello

                      U Offline
                      U Offline
                      User 11000607
                      wrote on last edited by
                      #30

                      It's an analog solution, don't think in digital terms...unless you are well-versed in three-state logic. And yes the solution will work with CFL or LED bulbs, none of them are 100% efficient.

                      1 Reply Last reply
                      0
                      • OriginalGriffO OriginalGriff

                        Wouldn't work in this house: some of the switches are "top for off", others are "bottom for off"...:sigh: One of these days I'll sort it out, but I'm afraid the writing won't take changes and I don't want to have to redecorate... :laugh:

                        Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

                        J Offline
                        J Offline
                        James Curran
                        wrote on last edited by
                        #31

                        The "correct" answer requires knowing when a switch is "on" or "off".

                        Truth, James

                        1 Reply Last reply
                        0
                        • J Jorgen Andersson

                          Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp. The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed a single trip to the attic. How do you do it? To clarify: When you are downstairs there is no way to see into the attic, or see reflected light from the attic. Once you have gone to the attic you are not allowed back to the switches. <edit>you can also assume original state of all switches to be off.</edit><hint>Otherwise it won't work</hint> Note: If you already know the answer, or reads the newspaper where I nicked the puzzle from, then please don’t write it up immediately in the comments! Give those who have never heard it before a chance to suffer, I mean enjoy finding the solution.

                          Wrong is evil and must be defeated. - Jeff Ello

                          J Offline
                          J Offline
                          James Curran
                          wrote on last edited by
                          #32

                          The definite CORRECT solution (It's not the "official" solution) http://ericlippert.com/2011/02/14/what-would-feynman-do/[^]

                          Truth, James

                          1 Reply Last reply
                          0
                          • J Jorgen Andersson

                            Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp. The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed a single trip to the attic. How do you do it? To clarify: When you are downstairs there is no way to see into the attic, or see reflected light from the attic. Once you have gone to the attic you are not allowed back to the switches. <edit>you can also assume original state of all switches to be off.</edit><hint>Otherwise it won't work</hint> Note: If you already know the answer, or reads the newspaper where I nicked the puzzle from, then please don’t write it up immediately in the comments! Give those who have never heard it before a chance to suffer, I mean enjoy finding the solution.

                            Wrong is evil and must be defeated. - Jeff Ello

                            M Offline
                            M Offline
                            Michael Breeden
                            wrote on last edited by
                            #33

                            That was one of the three questions I was asked during an interview with a firm in Westlake Village. I got the job, so I guess I gave the answer that they wanted. Really, it's about common sense. The other question was to solve an equation for variables. It was perhaps solvable or not, but if you experimented by putting in some values, you figured out that any variables where y was x*2 and z was x*3 would work. I thought they were good tests. Common sense and problem solving.

                            1 Reply Last reply
                            0
                            • J Jorgen Andersson

                              Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp. The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed a single trip to the attic. How do you do it? To clarify: When you are downstairs there is no way to see into the attic, or see reflected light from the attic. Once you have gone to the attic you are not allowed back to the switches. <edit>you can also assume original state of all switches to be off.</edit><hint>Otherwise it won't work</hint> Note: If you already know the answer, or reads the newspaper where I nicked the puzzle from, then please don’t write it up immediately in the comments! Give those who have never heard it before a chance to suffer, I mean enjoy finding the solution.

                              Wrong is evil and must be defeated. - Jeff Ello

                              P Offline
                              P Offline
                              patrickjadams1002
                              wrote on last edited by
                              #34

                              correct answer assuming all the switches are in the OFF position to begin with is, since you only can make one trip and you dont know which one it is. You turn them ALL on, and then can go. This is a waste of electricity but NOT a waste of time. so depending on the time frame, you can play with switches and guess/deduce with one it "probably" is but .... turning them ALL on, solves the puzzle. :)

                              1 Reply Last reply
                              0
                              • J Jorgen Andersson

                                Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp. The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed a single trip to the attic. How do you do it? To clarify: When you are downstairs there is no way to see into the attic, or see reflected light from the attic. Once you have gone to the attic you are not allowed back to the switches. <edit>you can also assume original state of all switches to be off.</edit><hint>Otherwise it won't work</hint> Note: If you already know the answer, or reads the newspaper where I nicked the puzzle from, then please don’t write it up immediately in the comments! Give those who have never heard it before a chance to suffer, I mean enjoy finding the solution.

                                Wrong is evil and must be defeated. - Jeff Ello

                                K Offline
                                K Offline
                                Kirk 10389821
                                wrote on last edited by
                                #35

                                Okay, I had to think threw it a bit. Of course, my first reaction to the solution was my father yelling at me! And the hint is that you have to change 1 inspection to inspect for 2 potential details, to overcome the 3:1 input:output problem Nice puzzle

                                1 Reply Last reply
                                0
                                • I Ian Shlasko

                                  Took me a couple minutes, but I remembered the answer... It's a nice warm-up problem... :)

                                  Proud to have finally moved to the A-Ark. Which one are you in?
                                  Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                                  V Offline
                                  V Offline
                                  vtokar
                                  wrote on last edited by
                                  #36

                                  Me too.

                                  1 Reply Last reply
                                  0
                                  • P Peter_in_2780

                                    The classic solution (which I won't give away) may not work too well with modern LED globes! CFLs maybe. Cheers, Peter

                                    Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

                                    E Offline
                                    E Offline
                                    englebart
                                    wrote on last edited by
                                    #37

                                    An in depth exploration of the efficiency of lighting. I think I found this through an image search a while back. http://physics.ucsd.edu/do-the-math/2012/05/spectral-extravaganza-the-ultimate-light/[^]

                                    1 Reply Last reply
                                    0
                                    • J Jorgen Andersson

                                      Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp. The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed a single trip to the attic. How do you do it? To clarify: When you are downstairs there is no way to see into the attic, or see reflected light from the attic. Once you have gone to the attic you are not allowed back to the switches. <edit>you can also assume original state of all switches to be off.</edit><hint>Otherwise it won't work</hint> Note: If you already know the answer, or reads the newspaper where I nicked the puzzle from, then please don’t write it up immediately in the comments! Give those who have never heard it before a chance to suffer, I mean enjoy finding the solution.

                                      Wrong is evil and must be defeated. - Jeff Ello

                                      S Offline
                                      S Offline
                                      SeattleC
                                      wrote on last edited by
                                      #38

                                      Had this question at a job interview. It's a lateral thinking exercise. My experience with software development over 35 years is that lateral thinking is virtually never a part of the mental toolkit for software development. Oh, by the way, the solution requires that the bulb be an incandescent bulb. It won't work with an LED bulb or electroluminescent night light.

                                      1 Reply Last reply
                                      0
                                      • J Jorgen Andersson

                                        Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp. The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed a single trip to the attic. How do you do it? To clarify: When you are downstairs there is no way to see into the attic, or see reflected light from the attic. Once you have gone to the attic you are not allowed back to the switches. <edit>you can also assume original state of all switches to be off.</edit><hint>Otherwise it won't work</hint> Note: If you already know the answer, or reads the newspaper where I nicked the puzzle from, then please don’t write it up immediately in the comments! Give those who have never heard it before a chance to suffer, I mean enjoy finding the solution.

                                        Wrong is evil and must be defeated. - Jeff Ello

                                        K Offline
                                        K Offline
                                        KLSmith
                                        wrote on last edited by
                                        #39

                                        What if you have an LED bulb in in the attic?

                                        1 Reply Last reply
                                        0
                                        • J Jorgen Andersson

                                          Downstairs in a house are three identical on-off switches. One of them controls the lamp in the attic. The puzzle is to work out which switch controls the lamp. The rules are as follows. You are allowed to manipulate the switches all you like, and then you are allowed a single trip to the attic. How do you do it? To clarify: When you are downstairs there is no way to see into the attic, or see reflected light from the attic. Once you have gone to the attic you are not allowed back to the switches. <edit>you can also assume original state of all switches to be off.</edit><hint>Otherwise it won't work</hint> Note: If you already know the answer, or reads the newspaper where I nicked the puzzle from, then please don’t write it up immediately in the comments! Give those who have never heard it before a chance to suffer, I mean enjoy finding the solution.

                                          Wrong is evil and must be defeated. - Jeff Ello

                                          T Offline
                                          T Offline
                                          Tiger12506
                                          wrote on last edited by
                                          #40

                                          Here's my problem with the accepted solution -- How do you know that these aren't 3-way switches?? "One of them controls the lamp in the attic" -- which says nothing about whether the other two switches also control the lamp in the attic.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups