- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
tastey can apply for a tuition refund as well.
Admin
This is the most hilariously depressing thread I've ever seen. I think some sort of congratulations is in order.
Admin
What if studies found that candidates passing a specific test were deemed to be more valuable to the company who hired them.
Game or not, it is reasonable for the company to ask you to submit to this exam for employment, as it decreases their risk.
If you choose not to take the test, thats fine. But the company is not doing anything wrong or unprofessional by using the tools at their disposal to make a good hire.
Either you can't get past the fact the problems are silly and seemingly unrelated, you suck at puzzles, or you've had experiences with people who you wouldn't have like even if they didn't give you a puzzle.
As to the usefulness of using such puzzles... well, I'll wait for the research studies to pass judgment on their effectiveness. But I don't find people using them unreasonable for doing so.
Admin
This thread is an amazing goldmine of stupid. I've switched my opinion from disgust to awe.
And I can't believe no one thought of just yelling out everyone else's hat color. I mean, it's not communicating, you're just yelling out loud, not to anyone in particular!!
Admin
Admin
Talk about stupid. Bad zip, no millions for you!
Admin
Admin
Probably already answered, but with 500+ responses I'm just going to spill it anyway:
The other folks' hat colors are only relevant if there is a measurable predominance of one color, indicating a non-even coin-flipping odds.
So, one person (picked at random and in secret so that the runners of this contest can't rig it) looks around the room. If he sees more red hats, he guesses red; if he sees more blue hats then he guesses blue. If he sees exactly one more of one color than the other then he assumes that the "no impact on other flips" thing is incorrect and guesses the less-seen color.
Gives just a scootch better than 50% chance of winning, moreso the less even the coin "toss".
Admin
Yep you failed too. The proper strategy gives you a 75% chance to win. It is posted many times in the thread with the proof.
Admin
Wow, depriving those fools the privilege of paying you money and the chance to put up with your tantrums. You sure showed them who's boss!
Admin
Admin
I only read page one, but the fact that no one seems to understand how the game works is apparent with regard to the hats. You don't use probability, and if you think you do, then you have no idea how to properly solve the problem.
There are 3 people and only 2 hat colors. It is IMPOSSIBLE for there to be a different hat on each head, so here's what you decide beforehand: If the other two guys each have a different hat, pass. At least one person MUST see the other two wearing the same hat. So if 2 of them pass, the third has the color he doesn't see. If no one says anything after a few seconds, they all have the same hat color.
Problem solved.
And no, I've never heard it before. It took me about 30 seconds to figure out, because unlike all of you, I read the rules, which say that yelling out the wrong color is an instant loss. So the only thing you can safely say is "Pass" without losing. Hence, that's the keyphrase you use to tell the others about it. It's simple deductive reasoning, and THAT'S what the riddle is trying to draw out from you.
Whether it makes you a better programmer, or worker, I don't know, but not all of the riddles are absurd situations (like the airplane one, and the bike one).
Admin
Admin
My idea of measuring the individual tire pressures and multiplying by the rectangular surface areas touching the ground is a much more practical solution. I assume they measure the tire pressures before each flight anyway.
Admin
I assume you're just trolling now. But the key word is simultaneous. If you don't guess when everyone else guesses, you are implicitly passing. You can't say a color or pass before or after everyone SIMULTANEOUSLY answers.
Admin
Wow, I just realized that I misread the question as well XD
If you have to answer simultaneously, then yeah, I don't think there's a reliable way to do it.
Admin
Yes, everyone is out to get you and control you. Also the sky is falling.
It's easy to test whether someone can code. By your complaining and whining, I would assume you are not happy about having your problem-solving abilities tested for a reason.
Admin
You've given the correct answer to the wrong riddle. The fact that you got confused probably means you are lying and have heard it before.
Admin
I'm sorry. You, like many others in this thread, fail. Perhaps you should go re-read the problem? It might also be helpful to look up the definition to the word "Simultaneously". While you are at it, I would also look up "No" and "Communication".
Admin
Yes, except that one of these interpretations is obviously stupid. If for some reason you thought it was the first case, the "everyone pass" option is obviously a 100% loser. And "everyone guesses" is also obviously a 1/8 chance of winning. Since this game is ridiculous, clearly the question means the other style.
As people have pointed out over and over again, yes, your personal chances are 50% because your hat is independent. However, the winning strategy structures it so that all three players shout out the wrong answer in the same case (all one color), while the right answer is spread over the 2-1 possibilities (which happen 3/4 of the time).
Admin
Actually you have the solution, but you missed the truth of the results. If all three have the same hat color then by your process all three say the opposite color. This is the only losing situation.
I bet if you thought for 35 seconds you would have found this part out and realized that yes, it comes down to a 75% chance of winning using this strategy.
Admin
I don't think they're trolling. I think they're actually right on.
English is naturally ambiguous, especially written English. If it weren't for that, our computers would be much better at understanding plain language commands.
Let's say the goal is to pick a red apple or banana. Have I specified the color of the banana? Or was I just clarifying that a yellow or green apple would not suffice?
To be honest, it wasn't until I saw others' answers that I realized that it was intended that of an instant the three participants would say one of three things: "red", "blue", or "pass".
Admin
I think you mean Dijkstra, as in Edsger Dijkstra.
Admin
At which point I failed because I missed the first part of the question wherein three people walked in, not a large group ...
Admin
Admin
Not to mention, the law of averages state that if there are only two equal possibilities and you see a larger group of one, you would be better off assuming you are in the lesser group.
It is not guaranteed to win but your overall chances are higher due to balance over time. I mean seriously, flip a coin 5 times and get 5 tails, you next flip still has a 50% probability of either heads or tails, but the law of averages states it will probably be heads.
If you disagree, then think about the ramifications, if I flip 5 tails, then for each tail I flip there is a lower chance of flipping heads until my chances of flipping heads reach null and that coin will always be tails.
Taken individually, yes there is a pure 50% chance, taken collectively, these probabilities become skewed.
Admin
Don't let the door hit you in the ass on the way out.
Admin
"simultaneously ... OR ..."?? That's nonsense. Literally.
Admin
Fortune cookie says you best to avoid casino in future.
Seriously, there is a reason casinos hand out cards for people to track which numbers have come up in roulette.
Independence means independence. Run a simulation if you doubt this fact.
Admin
I did, but I've been trained not to use i and j close together as it can be confused in some fonts.
Admin
Another one for the refund line.
My god, do people even take math these days?
Admin
Admin
KattMan is wrong.
http://en.wikipedia.org/wiki/Law_of_averages
Go educate yourself.
Admin
I doubt it highly, unless the roulette wheel in rigged.
Think about this, Forget the numbers, we are talking just red and black spots. There is a 50% chance it will be either red or black, not a problem, place a bet on either you have the same chances.
Now instead of placing a bet, watch the wheel. First spin lands on red, second spin lands on red. What do you think the third spin has a higher statistical chance of landing on? The probability is still 50%, but statistically it is a 75% chance it will land on black, so bet black. The only time this fails is if the wheel is rigged. It isn't a guaranteed win but the odds do favor the choice of black on the third spin. Is it possible I will lose and the wheel lands on red? Yes, even if not rigged, but I would bet black again, knowing that due to statistics and all things being equal black will come up to balance the odds back to 50%.
Admin
[quote user=Look at me! I'm on the internets] If you are suggesting KattMan is wrong, I suggest you are the one needing a refund. [/quote]
Holy christ. HOLY CHRIST.
Are you people all devoid of understanding of probability and statistics? How did you make it through college? (Oh wait... LIBERAL ARTS DEGREES)
If you get 5 heads in a row... there's no point switching to guessing tails for the next flip. It's just as likely to be another head. 50%! No more, no less.
Easy simulation that even you Visual Basic retards can understand:
Generate a very, very long sequence of rando ones and zeros. Copy and paste an implementation of the Merseinne Twister.
Now: search for every occurence of five {Heads, Zeros, Trues}. Now look at the very next letter/bit/boolean. Tally it.
Run this test repeatedly.
You'll find your tallys are about even. Completely contrary to what KattMan said.
Admin
Wrong. That is called the gamblers fallacy.
Before you begin, you may expect that there will be an approximately even number of red and black numbers that come up (disregarding the green numbers of course).
After a run of a color, you will still expect that in the future, you will have the same number of red and black numbers come up.
In practical terms this means that overall, you expect the distribution to average closer to 50% ( the average of 50% and 100% is closer to 50% than 100% is - law of averages).
What it does not mean is that the next number is more likely to be the opposite color. You don't expect the wheel to suddenly bring the distribution to even out.
Your understanding is exactly why casinos hand out tracking cards. It encourages people to think that this is indeed a fact, and that they have better odds through this tracking.
Admin
Kattman is introducing theory that is completely irrelevant to the problem at hand.
Run a simulation: 1)prime the solution by flipping and counting h & t a sufficient number of times (say 11) 2) guess the next flip based on prior results. 3) flip, right++ or wrong++ and h++ or t++ depending on the result 4) loop from 2) for 10000 iterations.
at the end of the day, right ~= wrong which is the same result as blind guessing.
For better results, don't guess on even numbered flips so that h != t and you are never doing a blind guess.
Of course, you'll need a proper monte carlo library for randomization.
Kattman's statement "if I flip 5 tails, then for each tail I flip there is a lower chance of flipping heads until my chances of flipping heads reach null and that coin will always be tails. " is completely wrong. It even has the name "Gambler's Fallacy."
The chance of flipping heads is ALWAYS 50% on an honest coin. (ignoring the infinitesimal chance of it landing on edge.)
Kattman also used the term "Law of Averages," A law which does not in fact exist in mathematics.
Admin
First of all, you are forgetting the green zero, but that's forgivable.
"but statistically it is a 75% chance it will land on black," Wrong. Wrong and Wrong. There is a 50% chance that it will land on black.
Admin
Admin
I actually don't think anyone's trolling. The sad situation is that there are way too many morons who program for a living. And a good half of those are bitter because their huge sense of entitlement can't comprehend what reality tells them over and over: that they are teh sux.
They are to true programmers what a typist is to a writer.
captcha = paint, which I suppose I just did.
Admin
Still no.
Lets go back to the hats. You see two hats the same color. By your logic, the chance my hat is the other color is greater than 50%.
But this is not so. For my hat is chosen independently of the other hats. Given that a coin has already flipped HH, then the sequence HHH and HHT are equally likely.
Admin
Binary search (weigh first four versus second four; take lighter of two and weigh 2 vs 2; if one lighter sub-group is lighter, weigh the coins against each other and pick lightest; if each lighter sub-group is identical then odd coin is in heavier group, so weigh that 2:2, then weigh heavier group's coins and pick the heaviest.) leads to 3 weighings if the coin is lighter, or 4 weighings if the coin is heavier.
Can't see a more efficient route given the problem defined here using binary search. Leads to 50% 3, 50% 4.
A ternary-search would take three groups (first three, second three, and last two), weigh the first two of them. If the two groups weighed identically then you know the odd coin is in the third group (weigh coin 7 against one of the others; if it is the same weight then the coin 8 is the odd one: answer in 2 weighings). If the two groups are weighted differently (define that 1+2+3 > 4+5+6; swap the two groups around if necessary here), then you know the odd coin is in your group of 6. Divide that group into three (1+2, 3+4, 5+6). Weigh 1+2 versus 5+6. If they weigh the same, then weigh 3 versus 1: if it is the same then 4 is odd; otherwise 3 is odd: answer in three weighings. If 1+2 != 5+6 then you have a problem of 4 (and 1+2 will always be > 5+6). Weigh 1:2: The heavier is the odd one in three weighings. If 1==2 then weigh 5:6: the lighter is the odd one in four weighings.
So, while a ternary search wouldn't get you there any faster in all cases, it would improve your results in some cases. If the odd coin is at position 7 or 8 then we'd find it in 2 weighings. If the odd coin is in position 3 or 4 or is heavier then we'd find it in 3 weighings. If the odd coin is lighter and not in position 3 or 4 or 7 or 8 then we'd find it in 4 weighings. 25% would take 4; 50% would take 3; 25% would take 2.
Next, try a quad-search. Group as 1+2, 3+4, 5+6, 7+8. Weigh 1+2 vs 3+4. If same, we know the answer is in the other half; redefine 5/6/7/8 as 1/2/3/4 and repeat this weighing. If different then we know the odd coin is in this half. Define the heavier of the quads as 1+2 and the lighter as 3+4. Weigh 1+5 vs 2+6. If they are the same, then repeat with 3+5 and 4+6. If 1+5 < 2+6 then 2 is the odd (heavy) coin; otherwise 1 is. Reversed logic when weighing 3+5 : 4+6.
Ends up with the same distribution as the ternary search (25% 4; 50% 3; 25% 2), but if you have an idea that the coin is lighter or heavier you can tweak the algorithm to get 50% 2 / 50% 3.
At least, that's my off-the-cuff answer :)
Admin
Just for the sake of argument, which of these is the most likely occurrence in 10 spins of the roulette wheel?
bbbbbbbbbb or rrrrrrrrrr or rrrrrbbbbb or rbrbrbrbrb or brbbrbrrbbr
Most people would pick one of the last two since it gives you a 50% distribution of blacks and red. The last one is especially enticing because it looks random-ish.
Of course, there is an exactly equal probability of any of them occurring.
Admin
The real WTF is that I haven't quit my job and opened up a casino... apparently.
Admin
However, if you are seeing two hats of the same color then you have applied selection to the game board, which is why that strategy wins 75% of the time.
While the "game" (coin flip) is still random, the game board is not (only play when the other two have the same hat color). This doesn't mean that the "game" will be won more than 50% of the times it is played; it means the "game" will be won 75% of the possible times for it to be played.
Admin
Well, the customer IS always right. That doesn't mean that the customer is always reasonable or correct. It means that it's the customer who's providing the money, and obtaining that money is the only goal in business. If that means you give in to unreasonable requests, then that's what it means.
That's too whorish for a lot of left-brained techies to whom being mathematically correct is the only thing that counts, but that's also why so few successful business are run by techies.
Admin
Here is my attempt to remove as much ambiguity from the hat question as possible.
There are 3 people, call them A,B, and C. They are going to be put in isolated rooms in separate buildings the only contents of which are two monitors, a piece of paper, and a pencil.
There will be a fourth building with three rooms. One room will contain A's hat and a camera pointed at it. One room will contain B's hat and a camera pointed at it. The last will have C's hat and a camera pointed at it. The color of each persons hat is determined by a completely random 50% probablity decider to be either red or blue.
Back to the three people. Once the hat colors are chosen, their monitors will each show the color of the other two people's hats. That is, A's monitors will show B's hat and C's hat. B's monitor will show A's hat and C's hat. etc.
After a given amount of time, say one minute, they must write on their paper the color they guess their hat to be (red or blue), or pass. Once I have all their papers I will determine if any guessed correctly or incorrectly. If at least one person guessed correctly and no-one guessed incorrectly they will split some large amount of money. This is a one time thing. If they all pass, there is no round two. They simply don't get the money.
The understand these rules and have been allowed to meet and discuss a strategy before this takes place. I am allowed to monitor this discussion and do anything I can to attempt to foil their plans as long as I keep the decision of the hat colors random and follow all other rules I have dictated. That is, if they decide to use cell phones I will search them first and take cell phones, use a jammer, etc.
Is there any ambiguity left in that?
And for the record I agree and understand the 75% acurate solution. It seemed counter intuitive at first but is actually neat.
And to all the people saying if they were asked a riddle they would get up and walk out, you are lying. It is easy to say that now, but what if you had been laid off, needed a job, etc? And you are really going to judge a whole company based on the interviewing practices of one person there? In my experience, it is an interview "loop" of like 5 people, some of which are just peons you "might" have to work with or direct. They have been in interviews where asking riddles is the thing to do. They have learned by example. They ask you a riddle. That communicates nothing to you about how good of a company that place is to work for. That just tells you something about that individual. I interviewed with and went to work for a company named after a river in brazil. On the phone screens I was asked some riddle type questions. I answered as best I could and got an in person interview. I ended up getting the job and didn't work with anyone that phone screened me. My point? Who cares if they were ammateur interviewers that didn't know what they were doing? I didn't even end up working with them.
Admin
Let's do it! Kattman can come play.
Admin
But it IS a fucking game. All you people getting mad at the interviewer are forgetting one thing -- your competition, the OTHER applicants, among whom will undoubtedly be someone who impresses the interviewer with his or her approach to the game.
And all you such people are forgetting another important thing -- the point of the game is to win (i.e. get a job offer, which you can then evaluate and turn down or accept), not to be self-righteous.
captcha = tacos, and even someone who sells tacos for a living knows the importance of winning over being right.
Admin
If you flip a coin ten times and get "heads" each time, the next time you flip it you will probalby get "heads" too. In the real world there is no such thing as perfectly equal possibilities; if a particular thing keeps happening then it is likely because something (the "tail" side of the coin being heavier, for instance) causing it to happen.
Take it this way: you know on average a programmer can accomplish a particular task in one day. You have given a particular programmer a similar task four times, each of which times he has completed it in 2 days instead of 1. Will you then expect him to complete the next task in 0 days, 1 day, or 2 days? I'd expect 2, because the "law of averages" doesn't apply to individual tests!
If that cuts too close to the bone: on average, money lent out gets returned with interest. You have lent money to your brother 3 times, and he hasn't paid you one red cent back. Is it a good idea to lend him money again?