• (cs) in reply to Herby
    Herby:
    Puzzles... One time when I was in an airport lounge, I noticed a math teacher giving quizzes to his group of students. Being the helpful type, I answered them before he could get the whole puzzle out. It felt real good for me (a bystander) and you could see the math teacher fuming that I knew the answers. The two puzzles were: You have a bunch of socks in a drawer, (usually 10 black, and 10 brown), how many socks does it take to get a proper pair to wear. Answer: 3. A tree is dropping leaves as the season progresses. Each day it drops twice as many as the day before. Assuming that it always drops the maximum numbe, on which day do most of the leaves drop. Answer: last day.

    I was smiling as I went to the plane.

    Did you put on a shit-eating grin and say to the teacher "Problem?"

  • geoffrey (unregistered) in reply to airdrik
    airdrik:
    geoffrey:
    Puzzles:
    Whenever I see someone bring up that lightbulb puzzle, I feel compelled to point out that the puzzle itself is fundamentally broken. ...

    The point of the light bulb puzzle is that it is best to go down the path of least resistance first. Maybe the bulbs do not put out heat, but given that most do, it is an option with a high probability of success.

    I'm more interested in someone who will troubleshoot through experimentation and observation, and who will not be more interested in the elegance or cleverness of the solution than in solving the problem at hand.

    It is still a fundamentally broken puzzle - it relies on assumptions about particular light bulbs (yes the most common type, but alternatives are readily available and that common type is approaching a rapid decline). While most candidates will have had some experience with a heated bulb (who hasn't changed a light bulb just after turning it off, or tried while it was still on), slim few are going to make the required leap to the assumption made by the puzzle to make it solvable.

    There are plenty of other puzzles which don't have some catch to them from which the puzzle draws assumptions and requires familiarity with the catch to solve.

    You are looking at the puzzle from only one perspective. Try instead to look at the value to a leader who values efficiency and common sense in his team.

  • Dirty Sock Smell (unregistered) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    Herby:
    Puzzles... One time when I was in an airport lounge, I noticed a math teacher giving quizzes to his group of students. Being the helpful type, I answered them before he could get the whole puzzle out. It felt real good for me (a bystander) and you could see the math teacher fuming that I knew the answers. The two puzzles were: You have a bunch of socks in a drawer, (usually 10 black, and 10 brown), how many socks does it take to get a proper pair to wear. Answer: 3. A tree is dropping leaves as the season progresses. Each day it drops twice as many as the day before. Assuming that it always drops the maximum numbe, on which day do most of the leaves drop. Answer: last day.

    I was smiling as I went to the plane.

    And here, folks, we have an excellent example of an IRL troll.
    I'm not so sure that counts as a troll. It's more of a buttinsky dork maneuver.

  • (cs) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    And here, folks, we have an excellent example of an IRL troll.
    That's not trolling. That's just being a jackass. Trolling would have been giving persuasive but wrong answers.

    As for geoffrey, his trolling is so subtle that it's redundant to all the genuine stupidity circulating around here.

    The plague of Nagesh doesn't even try to troll. It's just line noise at this point.

  • Nagesh (unregistered) in reply to Nagesh == Satan's smegma
    Nagesh == Satan's smegma:
    Nagesh:
    ...some unfunny trolling nonsense...

    Oh, so you haven't died in a fire yet. Well, there's always tomorrow.

    Luky I was not being on number 7 trane this am: it deraled an kiling 2.3 million persons.

  • Puzzles (unregistered) in reply to geoffrey
    geoffrey:
    The point of the light bulb puzzle is that it is best to go down the path of least resistance first. Maybe the bulbs do not put out heat, but given that most do, it is an option with a high probability of success.

    I'm more interested in someone who will troubleshoot through experimentation and observation, and who will not be more interested in the elegance or cleverness of the solution than in solving the problem at hand.

    Actually, since the puzzle specifies that all the switches are permanently locked when you open the box, someone who attempts this solution and fails has quite possibly destroyed any chance for an alternate solution. (If the puzzle could be reset, it would be trivial.)

    If that's truly the "point" of the light bulb puzzle, its design is even worse than I imagined!

  • no Bob (unregistered) in reply to Zylon
    Zylon:
    PedanticCurmudgeon:
    And here, folks, we have an excellent example of an IRL troll.
    That's not trolling. That's just being a jackass. Trolling would have been giving persuasive but wrong answers.

    As for geoffrey, his trolling is so subtle that it's redundant to all the genuine stupidity circulating around here.

    The plague of Nagesh doesn't even try to troll. It's just line noise at this point.

    Of course it's a troll. The story is bout him being a jackass. The troll is how he's extremely proud of 1) being a jackass and 2) solving middle school-level puzzles.

    He can't possibly be serious.

  • geoffrey (unregistered) in reply to Puzzles
    Puzzles:
    geoffrey:
    The point of the light bulb puzzle is that it is best to go down the path of least resistance first. Maybe the bulbs do not put out heat, but given that most do, it is an option with a high probability of success.

    I'm more interested in someone who will troubleshoot through experimentation and observation, and who will not be more interested in the elegance or cleverness of the solution than in solving the problem at hand.

    Actually, since the puzzle specifies that all the switches are permanently locked when you open the box, someone who attempts this solution and fails has quite possibly destroyed any chance for an alternate solution. (If the puzzle could be reset, it would be trivial.)

    If that's truly the "point" of the light bulb puzzle, its design is even worse than I imagined!

    Failure is part of life. So wouldn't your attempt at a solution be one that gave you the greatest probability of success?

  • Ken (unregistered) in reply to geoffrey

    I have never worked in a place where the lightbulbs produce heat and the lightbulbs my landlord gives me for free do not produce heat either. Therefore your assumption that most lightbulbs produce heat is outdated.

  • anonymouser (unregistered) in reply to Herby
    Herby:
    Puzzles... One time when I was in an airport lounge, I noticed a math teacher giving quizzes to his group of students. Being the helpful type, I answered them before he could get the whole puzzle out. It felt real good for me (a bystander) and you could see the math teacher fuming that I knew the answers. The two puzzles were: You have a bunch of socks in a drawer, (usually 10 black, and 10 brown), how many socks does it take to get a proper pair to wear. Answer: 3. A tree is dropping leaves as the season progresses. Each day it drops twice as many as the day before. Assuming that it always drops the maximum numbe, on which day do most of the leaves drop. Answer: last day.

    I was smiling as I went to the plane.

    Do you have 3 feet? Why couldn't you just take 2 black socks?

    Or, did you forgot to mention that the room is dark and you can't see the socks, which is quite important to this puzzle. In that case, you'd be correct that 3 would guarantee a proper pair. It being too dark to see them, however, you only have a 1 in 3 chance of getting a proper pair on your feet.

  • (cs) in reply to ping floyd
    ping floyd:
    Well, to be honest, HTML really is more limiting that Java or C.
    For one, it can't take screen shots of wooden tables on embedded systems using NetBeans.
  • 404d (unregistered) in reply to chic

    If I am interviewing for a web development position, and a candidate has no idea what a 404 is, s/he has something to explain...

  • 404d (unregistered) in reply to chic
    TRWTF is asking about an error number in an interview. Although perhaps common enough, I don't think it is reasonable to expect people to know numbers that correspond to errors.

    If I am interviewing for a web development position, and a candidate has no idea what a 404 is, s/he has something to explain...

  • stir mr pot (unregistered) in reply to 404d
    404d:
    TRWTF is asking about an error number in an interview. Although perhaps common enough, I don't think it is reasonable to expect people to know numbers that correspond to errors.

    If I am interviewing for a web development position, and a candidate has no idea what a 404 is, s/he has something to explain...

    I agree it [i]might[/p] point to some serious knowledge gaps (especially in that context - as would not knowing 200 (and maybe 401,403)), but isn't it more important to understand what the error is and what the cause may be, than to know exactly what the number is?

    Interestingly, the biggest reason that we expect people (even outside of the Web Development space) to know what 404 is, because we are obsessed with bashing them over the head with it....

  • Captain Jean Luc Picard (unregistered)
    Teh Borgs:
    "IF YOU HAVE A BOX WITH THREE LIGHTBULBS..."
    There are FOUR LIGHTS.
  • geoffrey (unregistered) in reply to 404d
    404d:
    TRWTF is asking about an error number in an interview. Although perhaps common enough, I don't think it is reasonable to expect people to know numbers that correspond to errors.

    If I am interviewing for a web development position, and a candidate has no idea what a 404 is, s/he has something to explain...

    No offense, but that's very Web 1.0 thinking. Modern development platforms have abstracted error codes into semantically meaningful data items. I care little if someone has committed a bunch of arcane error numbers to rote memory.

  • Nagesh == Satan's smegma (unregistered) in reply to geoffrey
    geoffrey:
    404d:
    TRWTF is asking about an error number in an interview. Although perhaps common enough, I don't think it is reasonable to expect people to know numbers that correspond to errors.

    If I am interviewing for a web development position, and a candidate has no idea what a 404 is, s/he has something to explain...

    No offense, but that's very Web 1.0 thinking. Modern development platforms have abstracted error codes into semantically meaningful data items. I care little if someone has committed a bunch of arcane error numbers to rote memory.

    Oh, goody, it's Nagesh's annoying little brother.

  • (cs) in reply to Nagesh
    Nagesh:
    Nagesh == Satan's smegma:
    Nagesh:
    ...some unfunny trolling nonsense...

    Oh, so you haven't died in a fire yet. Well, there's always tomorrow.

    Luky I was not being on number 7 trane this am: it deraled an kiling 2.3 million persons.
    You may return to your office under the bridge now.

  • Mathlete (unregistered) in reply to Richard
    Richard:
    The general solution for N weights is CEIL(N / 3) weighings, so 5 weights would need 2 weighings, and 8 would need 3.

    This is just plain wrong. For the version of the problem where you do now know if the fake coin is lighter or heavier, and need to determin which it is, the maximum number of coins you can have for n > 1 weighings is c = (3^n - 3)/2.

    Conversely, the minimum number of weighings for c > 2 coins is n = ceil(log3(2c + 3)).

  • Chris (unregistered) in reply to geoffrey

    [quote user="geoffrey"][quote user="404d"][quote] No offense, but that's very Web 1.0 thinking. Modern development platforms have abstracted error codes into semantically meaningful data items. I care little if someone has committed a bunch of arcane error numbers to rote memory.[/quote]

    Yes, as Vertiy Stob says, nowadays the standard approach on handling an exception is to send the user a page of ODBC diagnostics, preferably mashed up with a few suggestions from Apache.

  • (cs)

    Ha! We were interviewing candidates for our offsore team member positions and I KNEW that subsequent candidates would be given hints about our interview questions given to previous candidates. During the interviews, the handler is always on the phone too for some reason.

    So I laid a little trap.

    I asked the first candidate how they would handle parsing a 20GB XML file on a machine with only 4GB of memory. They didn't know, of course. So in my feedback, I put "did not know when to use a SAX or a DOM parser".

    The next candidate I ask, "What is the difference between a SAX and a DOM parser." The answer: "Well, you can use a SAX parser to parse a 20GB XML file on a machine with 4GB of memory."

    As if.

  • Master Troll (formerly Top3Coder) (unregistered)

    I had to leave this site because of the abysmal quality of trolling. I was trolled so badly, when all I did was express my honest opinions.

  • Master Troll (formerly Top3Coder) (unregistered) in reply to ooblek

    If you create a 20GB XML file, you're doing it wrong.

  • Dani (unregistered) in reply to Zylon
    Zylon:
    PedanticCurmudgeon:
    And here, folks, we have an excellent example of an IRL troll.
    That's not trolling. That's just being a jackass. Trolling would have been giving persuasive but wrong answers.

    As for geoffrey, his trolling is so subtle that it's redundant to all the genuine stupidity circulating around here.

    The plague of Nagesh doesn't even try to troll. It's just line noise at this point.

    The answers are actually wrong, and since you didn't notice they are also persuasive. So he does count as a troll.

  • NPSF3000 (unregistered) in reply to geoffrey
    geoffrey:
    airdrik:
    geoffrey:
    Puzzles:
    Whenever I see someone bring up that lightbulb puzzle, I feel compelled to point out that the puzzle itself is fundamentally broken. ...

    The point of the light bulb puzzle is that it is best to go down the path of least resistance first. Maybe the bulbs do not put out heat, but given that most do, it is an option with a high probability of success.

    I'm more interested in someone who will troubleshoot through experimentation and observation, and who will not be more interested in the elegance or cleverness of the solution than in solving the problem at hand.

    It is still a fundamentally broken puzzle - it relies on assumptions about particular light bulbs (yes the most common type, but alternatives are readily available and that common type is approaching a rapid decline). While most candidates will have had some experience with a heated bulb (who hasn't changed a light bulb just after turning it off, or tried while it was still on), slim few are going to make the required leap to the assumption made by the puzzle to make it solvable.

    There are plenty of other puzzles which don't have some catch to them from which the puzzle draws assumptions and requires familiarity with the catch to solve.

    You are looking at the puzzle from only one perspective. Try instead to look at the value to a leader who values efficiency and common sense in his team.

    How about the perspective of hiring a programmer who is more than happy to use undocumented and unreliable side-effects of systems?

    Though it's a good question for a hacker :P

  • Franz Kafka (unregistered) in reply to ooblek
    ooblek:
    The next candidate I ask, "What is the difference between a SAX and a DOM parser." The answer: "Well, you can use a SAX parser to parse a 20GB XML file on a machine with 4GB of memory."

    As if.

    You left out the actual trap: "Describe how that is."

  • (cs) in reply to My Name Is Missing
    My Name Is Missing:
    IF YOU HAVE A BOX WITH THREE LIGHTBULBS... I'd answer "I 'd have something smarter than you"

    Why can't interviewers ask more challenging questions like:

    What's the quickest way to toast 3 slices of bread on both sides under a grill that toasts only two slices, and only one one side of each, at a time?

  • GA2K (unregistered) in reply to Ken
    Ken:
    I have never worked in a place where the lightbulbs produce heat and the lightbulbs my landlord gives me for free do not produce heat either. Therefore your assumption that most lightbulbs produce heat is outdated.

    Are you 5 years old? Are you seriously suggesting you know that lightbulbs generate heat?

  • (cs) in reply to Herby
    Herby:
    Puzzles... One time when I was in an airport lounge, I noticed a math teacher giving quizzes to his group of students. Being the helpful type, I answered them before he could get the whole puzzle out. It felt real good for me (a bystander) and you could see the math teacher fuming that I knew the answers. The two puzzles were: You have a bunch of socks in a drawer, (usually 10 black, and 10 brown), how many socks does it take to get a proper pair to wear. Answer: 3. A tree is dropping leaves as the season progresses. Each day it drops twice as many as the day before. Assuming that it always drops the maximum numbe, on which day do most of the leaves drop. Answer: last day.

    I was smiling as I went to the plane.

    You're not necessarily right. If the day before the last day all the leaves drop but one, then on the last day there's only that one leaf left to drop, and be blowed to your mathematics.

  • (cs) in reply to Nagesh
    Nagesh:
    Nagesh == Satan's smegma:
    Nagesh:
    ...some unfunny trolling nonsense...

    Oh, so you haven't died in a fire yet. Well, there's always tomorrow.

    Luky I was not being on number 7 trane this am: it deraled an kiling 2.3 million persons.

    Only one carriage fell over, then?

  • Andrew Brehm (unregistered) in reply to Herby
    Herby:
    You have a bunch of socks in a drawer, (usually 10 black, and 10 brown), how many socks does it take to get a proper pair to wear. Answer: 3.

    Actually, the real answer is 7.

    Try it out.

    I found that when it comes to socks, all theory is useless.

    Captcha: "enim" = "truly"

  • (cs) in reply to Puzzles
    Puzzles:
    geoffrey:
    The point of the light bulb puzzle is that it is best to go down the path of least resistance first. Maybe the bulbs do not put out heat, but given that most do, it is an option with a high probability of success.

    I'm more interested in someone who will troubleshoot through experimentation and observation, and who will not be more interested in the elegance or cleverness of the solution than in solving the problem at hand.

    Actually, since the puzzle specifies that all the switches are permanently locked when you open the box, someone who attempts this solution and fails has quite possibly destroyed any chance for an alternate solution. (If the puzzle could be reset, it would be trivial.)

    If that's truly the "point" of the light bulb puzzle, its design is even worse than I imagined!

    Presumably the question is to determine which of the bulbs in the box is broken, with the limitation that when the box is open all the bulbs are turned off.

    I'd put the question back to the questioner: "How do you know one of the bulbs is broken if you can't see them when they're lit? Oh, so you've stuck an ammeter into the circuit to see it's drawing only two thirds the current. So why can't you stick the ammeter into each individual circuit? I can see why you need a new system designer - you've just fired the idiot who built this box of lights. Have you got one of those devices that you clip round the wire and it measures the magnetic flux, so determining the current going through the wire? ..." etc.

  • (cs) in reply to ping floyd
    ping floyd:
    Well, to be honest, HTML really is more limiting that Java or C.

    i certainly miss the "data flow" feature. and garbage collection, but i suppose that would make 98% of web display just a blank page so it's a good thing... maybe?

  • this socks (unregistered) in reply to anonymouser
    anonymouser:
    It being too dark to see them, however, you only have a 1 in 3 chance of getting a proper pair on your feet.

    The first sock you pick will always be right (or left) The chance to pick a correct second sock is now 9 out of 19. So not 1 out of 3 but almost 50%abico

  • (cs) in reply to this socks

    If you can't see what color socks are in your drawer, how does it matter how many socks you fetch? You always have the same chance of ending up with two different socks on your feet.

    Unless I'm missing some vital information in this question, such as "you can, for some reason, only turn the light on AFTER you have got your socks from the drawer." For putting your socks on in the dark, it doesn't matter how many socks you have in your hands. So why can't you just turn the light on first?

  • itsmo (unregistered) in reply to My Name Is Missing
    My Name Is Missing:
    IF YOU HAVE A BOX WITH THREE LIGHTBULBS... I'd answer "I 'd have something smarter than you"

    Brighter FFS, brighter...

  • Expert (unregistered) in reply to this socks
    this socks:
    anonymouser:
    It being too dark to see them, however, you only have a 1 in 3 chance of getting a proper pair on your feet.

    The first sock you pick will always be right (or left) The chance to pick a correct second sock is now 9 out of 19. So not 1 out of 3 but almost 50%abico

    One extra failure is when you put both blues, but they didn't match brown shoes (which you pulled randomly, too)

  • (cs) in reply to Pim
    Pim:
    If you can't see what color socks are in your drawer, how does it matter how many socks you fetch? You always have the same chance of ending up with two different socks on your feet.

    Unless I'm missing some vital information in this question, such as "you can, for some reason, only turn the light on AFTER you have got your socks from the drawer." For putting your socks on in the dark, it doesn't matter how many socks you have in your hands. So why can't you just turn the light on first?

    I'm colourblind, so even with the lights on, chances'd be about 8% that I'd have a matching pair, even with only 2 colours to choose from.
  • Brilliand (unregistered) in reply to Mathlete
    Mathlete :
    Richard:
    The general solution for N weights is CEIL(N / 3) weighings, so 5 weights would need 2 weighings, and 8 would need 3.

    This is just plain wrong. For the version of the problem where you do now know if the fake coin is lighter or heavier, and need to determin which it is, the maximum number of coins you can have for n > 1 weighings is c = (3^n - 3)/2.

    Conversely, the minimum number of weighings for c > 2 coins is n = ceil(log3(2c + 3)).

    For not knowing whether the weight is larger or smaller, and not needing to determine that: c = (3^n)/2 and n = ceil(log3(2c)) [Usually what I assume upon hearing this sort of problem] For knowing in advance: c = 3^n and n = ceil(log3(c)) [Apparently what the 8 coins 2 weighings version is]

  • (cs)

    I never actually heard the lightbulbs thing. How does that one go?

  • muteKi (unregistered) in reply to Pim

    I could actually see a situation where this might be the case. Walk-in-closet without windows, light burnt out*. Sock drawer's in back, it's hard to tell what color sock is what, but all you need is a matching pair of either kind. Take 3 socks and wear the 2 that match.

    *Well, we could replace it, but the guy who wired the house was a moron and we can't tell what switches or breakers go to it. And for some reason after tripping a breaker we can't reset it.

  • itsmo (unregistered) in reply to Puzzles
    Puzzles:
    Whenever I see someone bring up that lightbulb puzzle, I feel compelled to point out that the puzzle itself is fundamentally broken.

    The normal assumption in a puzzle is that all the components are ideal, because the story is really just window-dressing on an ABSTRACT puzzle. If something is in an opaque box, you can't peek through a crack. If something has an on/off switch, you can't hold it in some middle position that makes intermittent contact. If you don't make those kinds of assumptions, these puzzles generally have a huge number of possible solutions, most of which are uninteresting and rely on circumstances not specified in the problem statement.

    The accepted solution of the lightbulb puzzle is to check the temperature of the bulbs. But that relies on an arbitrary non-ideal assumption (non-negligible waste heat) that isn't stated in the problem, so that's no more legitimate an answer than "I peek through a crack in the box" or "I trace the wires to see what's connected to what". It's arguably not even a REASONABLE assumption these days--what if the lights are LEDs?

    Lateral thinking puzzles don't generally belong in interviews, but that particular puzzle doesn't even belong in a game of puzzles. If you got the "correct" answer without being told, that actually means you're WORSE at these puzzles than many of the people who didn't get it, because under the normal implicit rules, it doesn't have a solution.

    clcto:
    5 weights in 3 weighings? That doesn't require any level of brain power. Isn't the question 8 in 2 weighings?
    I imagine that puzzle has many permutations depending on the exact nature of the measurement tool you use and whether you are told in advance that the different weight is lighter or heavier or only that it is "different".

    8 is likely a popular number because it is a power of 2, and therefore adds an extra red herring to the puzzle.

    Seriously, please, STFU with the fucking brain-teasers (nothing personal Puzzles, this is just the point where I couldn't stand it anymore)

  • muteKi (unregistered) in reply to muteKi

    If it wasn't clear the idea is that after taking the socks you could verify in a better-lit area which two matched. But it probably is and I'm just thinking it isn't because I'm up at 3:30 AM for no good reason.

  • (cs) in reply to The poop of DOOM
    The poop of DOOM:
    I never actually heard the lightbulbs thing. How does that one go?
    It goes something like this: You've got a box with a bunch of lights in it, one of which is broken. The box is opaque and openable; a switch in the hinge mechanism ensures that no electricity is flowing through the circuit when the lid is open. How do you work out which light is broken so you can fit the replacement?

    The answer's obvious and trivial to remember once you know it; it's a stupid “A-ha!” question that reveals that the interviewer isn't very good at it. A good interview question should be either genuinely tricky or thoroughly open-ended; in the former case, you're testing whether they actually know what they claim, and in the latter case you'd be looking for whether the interviewee identifies the major strategies for tackling the problem.

  • (cs) in reply to dkf
    dkf:
    The poop of DOOM:
    I never actually heard the lightbulbs thing. How does that one go?
    It goes something like this: You've got a box with a bunch of lights in it, one of which is broken. The box is opaque and openable; a switch in the hinge mechanism ensures that no electricity is flowing through the circuit when the lid is open. How do you work out which light is broken so you can fit the replacement?

    The answer's obvious and trivial to remember once you know it; it's a stupid “A-ha!” question that reveals that the interviewer isn't very good at it. A good interview question should be either genuinely tricky or thoroughly open-ended; in the former case, you're testing whether they actually know what they claim, and in the latter case you'd be looking for whether the interviewee identifies the major strategies for tackling the problem.

    Oh, so it's basically one of those questions that interviewer read in one of their magazines, and base their judgement of you on your response. Bet he wouldn't know what to do if you tell him to smash every bulb, so you know 100% sure that all of them are broken and need to be replaced.

    That or, if he's actually genuinly into riddles, you can solve it for him, then ask him another one. Good interview will be good then :P

  • MarkW (unregistered)

    Solution to the 5 weights problem:

    1. Weigh A+B against C+D. If they are equal, E is the odd weight. OTHERWISE: note which set is heavier.
    2. Weigh B+C against D+E. If they are equal, A is the odd weight. OTHERWISE: note which set is heavier. If A+B was heavier than C+D and D+E was heavier than B+C: C is the odd weight (and is lighter than the others) If C+D was heavier than A+B and B+C was heavier than D+E: C is the odd weight (and is heavier than the others)
    3. Weight B against A: If they are the same, D is the odd weight, otherwise B is the odd weight.
  • Enam Rouy (unregistered) in reply to Steve H.

    3 weighs if you want to know whether it's heavier or lighter. With weights ABCDE:

    Weigh(1) A+B against C+D. If they match then E is different. Weigh(2) E against any other weight to determine heavier or lighter.

    Otherwise: Weigh(2) A against C. If unmatched then weigh(3) A against E

    • If unmatched A is different, heavier/lighter is also given by the last comparison
    • If matched then C is different. Result of A,C comparison gives heavier or lighter since we know whether A was heavier or lighter than C.

    If same: Weigh(3) B against E If unmatched then B is different, heavier or lighter If same then D is different. Result of A+B vs C+D comparison determines whether D is heavier or lighter.

    Three weighs, heavier/lighter known.

  • Anchors aweigh (unregistered) in reply to MarkW

    The question usually assumes a balance scale (at least for the 8 weight issue).

    For that:

    1. Weigh A+B+C vs D+E+F. If they are equal then G or H are heavier.
    2. If G or H are heavier, then obviously weigh them against each other.
    3. If G and H are the same, then repeat the step one with the heavier triad, but leaving one out.

    So 2 weighings for 8 on a balance scale.

  • C# Guy (unregistered) in reply to anonymouser
    anonymouser:
    Or, did you forgot to mention that the room is dark and you can't see the socks, which is quite important to this puzzle. In that case, you'd be correct that 3 would guarantee a proper pair. It being too dark to see them, however, you only have a 1 in 3 chance of getting a proper pair on your feet.

    Actually, you'd have a better than 1 in 3 chance.

  • geoffrey (unregistered) in reply to NPSF3000
    NPSF3000:
    geoffrey:

    You are looking at the puzzle from only one perspective. Try instead to look at the value to a leader who values efficiency and common sense in his team.

    How about the perspective of hiring a programmer who is more than happy to use undocumented and unreliable side-effects of systems?

    Though it's a good question for a hacker :P

    Or from the perspective of hiring someone who just gets things done. I don't care how it's done; I just want results.

    Standing in front of a whiteboard all day does not lead to results.

Leave a comment on “More Limitin', Wrong Major, and Parallel Universe Replacement”

Log In or post as a guest

Replying to comment #:

« Return to Article