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. Logic Question? [modified]

Logic Question? [modified]

Scheduled Pinned Locked Moved The Lounge
questionc++regexhelp
22 Posts 15 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.
  • H hackC

    Tom has six pairs of black gloves and six pairs of brown gloves in his drawer. In complete darkness, how many gloves must he take from the drawer in order to be sure to get a pair that match? Just to have a little fun.... "C++ will solve any problem."

    J Offline
    J Offline
    Josh Smith
    wrote on last edited by
    #4

    3

    H 1 Reply Last reply
    0
    • J Josh Smith

      3

      H Offline
      H Offline
      hackC
      wrote on last edited by
      #5

      Remeber it says "how many TO BE SURE" "C++ will solve any problem." -- modified at 10:58 Friday 16th June, 2006

      J 1 Reply Last reply
      0
      • H hackC

        Tom has six pairs of black gloves and six pairs of brown gloves in his drawer. In complete darkness, how many gloves must he take from the drawer in order to be sure to get a pair that match? Just to have a little fun.... "C++ will solve any problem."

        D Offline
        D Offline
        Dario Solera
        wrote on last edited by
        #6

        Ooooooooold. :) I knew it with socks, not gloves, though... :-D _____________________________________________ Tozzi is right: Gaia is getting rid of us. My Blog [ITA] - Developing ScrewTurn Wiki 0.2a...

        1 Reply Last reply
        0
        • H hackC

          Tom has six pairs of black gloves and six pairs of brown gloves in his drawer. In complete darkness, how many gloves must he take from the drawer in order to be sure to get a pair that match? Just to have a little fun.... "C++ will solve any problem."

          H Offline
          H Offline
          hackC
          wrote on last edited by
          #7

          13 he could possibly take out 6 black left hand gloves and then 6 brown left hand gloves, the next one would have to be either the right hand or left hand match. "C++ will solve any problem." -- modified at 11:08 Friday 16th June, 2006

          N M 2 Replies Last reply
          0
          • H hackC

            13 he could possibly take out 6 black left hand gloves and then 6 brown left hand gloves, the next one would have to be either the right hand or left hand match. "C++ will solve any problem." -- modified at 11:08 Friday 16th June, 2006

            N Offline
            N Offline
            Nish Nishant
            wrote on last edited by
            #8

            Cool - good puzzle :-) Regards, Nish


            Nish’s thoughts on MFC, C++/CLI and .NET (my blog)
            Currently working on C++/CLI in Action for Manning Publications. Also visit the Ultimate Toolbox blog (New)

            1 Reply Last reply
            0
            • H hackC

              Tom has six pairs of black gloves and six pairs of brown gloves in his drawer. In complete darkness, how many gloves must he take from the drawer in order to be sure to get a pair that match? Just to have a little fun.... "C++ will solve any problem."

              J Offline
              J Offline
              Jun Du
              wrote on last edited by
              #9

              It depends on whether you can wear left glove on right hand and vice versa. This is old...some company's quiz test for new hires. Keep on trying. - It's easier to make than to correct a mistake.

              P 1 Reply Last reply
              0
              • H hackC

                13 he could possibly take out 6 black left hand gloves and then 6 brown left hand gloves, the next one would have to be either the right hand or left hand match. "C++ will solve any problem." -- modified at 11:08 Friday 16th June, 2006

                M Offline
                M Offline
                Martin Haesemeyer
                wrote on last edited by
                #10

                Wow, see I knew this one with socks - and then 3 would have been the answer. Didn't think at all about the "handedness" of the gloves... Cheers Martin

                "When your own heart asks - how will you respond?" Gosen waka shū "Situation normal - all fu***d up" Illuminatus! My photos on flickr

                1 Reply Last reply
                0
                • H hackC

                  Remeber it says "how many TO BE SURE" "C++ will solve any problem." -- modified at 10:58 Friday 16th June, 2006

                  J Offline
                  J Offline
                  Josh Smith
                  wrote on last edited by
                  #11

                  I heard this one with socks, not gloves. As Jun Du pointed out, some gloves can be worn on either hand. The lefthand/righthand issue was noted, but safely ignored because of this. :-D Good puzzle, though. I think that it would be better if the objects were shoes, instead of gloves, because then you could have no doubt that the left/right issue was inescapable. Josh

                  1 Reply Last reply
                  0
                  • J Jun Du

                    It depends on whether you can wear left glove on right hand and vice versa. This is old...some company's quiz test for new hires. Keep on trying. - It's easier to make than to correct a mistake.

                    P Offline
                    P Offline
                    Photonman007
                    wrote on last edited by
                    #12

                    I've been lurking here for a while but I had to respond to this one... A lot of people probably know this one (or something similar) but here goes: There are two rooms. In one there are four light switches, in the other there are four lights controlled by the swtiches. It is impossible to see into one room from the other. If you can enter each room only once, how do you determine which switch controls which light? Anyway, this being my first post.. Hello everyone, hope to be useful and/or entertaining.

                    J D J 3 Replies Last reply
                    0
                    • P Photonman007

                      I've been lurking here for a while but I had to respond to this one... A lot of people probably know this one (or something similar) but here goes: There are two rooms. In one there are four light switches, in the other there are four lights controlled by the swtiches. It is impossible to see into one room from the other. If you can enter each room only once, how do you determine which switch controls which light? Anyway, this being my first post.. Hello everyone, hope to be useful and/or entertaining.

                      J Offline
                      J Offline
                      J4amieC
                      wrote on last edited by
                      #13

                      Something to do with feeling which lightbulbs are hot. Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

                      D 1 Reply Last reply
                      0
                      • H hackC

                        Tom has six pairs of black gloves and six pairs of brown gloves in his drawer. In complete darkness, how many gloves must he take from the drawer in order to be sure to get a pair that match? Just to have a little fun.... "C++ will solve any problem."

                        C Offline
                        C Offline
                        Chris Losinger
                        wrote on last edited by
                        #14

                        13 worst case draw is 6 LH Black then 6 RH Brown #13 will match something Cleek | Image Toolkits | Thumbnail maker

                        1 Reply Last reply
                        0
                        • P Photonman007

                          I've been lurking here for a while but I had to respond to this one... A lot of people probably know this one (or something similar) but here goes: There are two rooms. In one there are four light switches, in the other there are four lights controlled by the swtiches. It is impossible to see into one room from the other. If you can enter each room only once, how do you determine which switch controls which light? Anyway, this being my first post.. Hello everyone, hope to be useful and/or entertaining.

                          D Offline
                          D Offline
                          David Crow
                          wrote on last edited by
                          #15

                          Photonman007 wrote:

                          In one there are four light switches...

                          I've heard it before, but with three.


                          "The largest fire starts but with the smallest spark." - David Crow

                          "Judge not by the eye but by the heart." - Native American Proverb

                          1 Reply Last reply
                          0
                          • P Photonman007

                            I've been lurking here for a while but I had to respond to this one... A lot of people probably know this one (or something similar) but here goes: There are two rooms. In one there are four light switches, in the other there are four lights controlled by the swtiches. It is impossible to see into one room from the other. If you can enter each room only once, how do you determine which switch controls which light? Anyway, this being my first post.. Hello everyone, hope to be useful and/or entertaining.

                            J Offline
                            J Offline
                            Jun Du
                            wrote on last edited by
                            #16

                            An IBM or MS quiz? Don't remember which one. Three is easy, lets try four. I guess you need to label all four switches first. Then follow these steps: 1) Turn on switch 1, wait for a couple of seconds, then turn it off; 2) Waite a comple of minutes; 3) Turn on switch 2, wait for a couple of seconds, then turn it off; 4) Turn on switch 3 and leave it on; 5) Enter the bulb room to check: - The light on is linked to switch 3; - The warm one is switch 1; - The hotter one is 2; - The last is 4. Any other thoughts? - It's easier to make than to correct a mistake.

                            1 Reply Last reply
                            0
                            • H hackC

                              Tom has six pairs of black gloves and six pairs of brown gloves in his drawer. In complete darkness, how many gloves must he take from the drawer in order to be sure to get a pair that match? Just to have a little fun.... "C++ will solve any problem."

                              A Offline
                              A Offline
                              Andy Brummer
                              wrote on last edited by
                              #17

                              I came up with 8 because surely you can feel the difference between left hand and right hand gloves when you are picking them up. 1 left hand glove 7 right hand gloves


                              I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon

                              1 Reply Last reply
                              0
                              • J J4amieC

                                Something to do with feeling which lightbulbs are hot. Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour

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

                                This solution requires the bulbs be incandesent. flourecent and led bulbs put out very little waste here, incandesent bulbs put out primarily heat with a little bit of light as an afterthought.

                                D 1 Reply Last reply
                                0
                                • H hackC

                                  Tom has six pairs of black gloves and six pairs of brown gloves in his drawer. In complete darkness, how many gloves must he take from the drawer in order to be sure to get a pair that match? Just to have a little fun.... "C++ will solve any problem."

                                  O Offline
                                  O Offline
                                  Office Lineman
                                  wrote on last edited by
                                  #19

                                  2. A logical person would turn on the light, use a flashlight, or would have installed emergency power-outage lights. Having reduced this to an already-solved problem, Tom simply retrieves gloves from the drawer as desired. :-> -- I've killed again, haven't I?

                                  1 Reply Last reply
                                  0
                                  • D Dan Neely

                                    This solution requires the bulbs be incandesent. flourecent and led bulbs put out very little waste here, incandesent bulbs put out primarily heat with a little bit of light as an afterthought.

                                    D Offline
                                    D Offline
                                    David Crow
                                    wrote on last edited by
                                    #20

                                    dan neely wrote:

                                    ...with a little bit of light as an afterthought.

                                    I like that!


                                    "The largest fire starts but with the smallest spark." - David Crow

                                    "Judge not by the eye but by the heart." - Native American Proverb

                                    D 1 Reply Last reply
                                    0
                                    • D David Crow

                                      dan neely wrote:

                                      ...with a little bit of light as an afterthought.

                                      I like that!


                                      "The largest fire starts but with the smallest spark." - David Crow

                                      "Judge not by the eye but by the heart." - Native American Proverb

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

                                      DavidCrow wrote:

                                      dan neely wrote: ...with a little bit of light as an afterthought. I like that!

                                      It's literally true. The black body curve of an incandesent bulb peaks in the IR range. The light is rich in red wavelengths and poor in blue.

                                      1 Reply Last reply
                                      0
                                      • H hackC

                                        Tom has six pairs of black gloves and six pairs of brown gloves in his drawer. In complete darkness, how many gloves must he take from the drawer in order to be sure to get a pair that match? Just to have a little fun.... "C++ will solve any problem."

                                        C Offline
                                        C Offline
                                        Chris Meech
                                        wrote on last edited by
                                        #22

                                        How many hands does he have? :) Chris Meech I am Canadian. [heard in a local bar] When no one was looking, every single American woman between the ages of 18 and 32 went out and got a tatoo just above their rumpus. [link[^]]

                                        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