Are the labels all definitely wrong, or is it that we aren't sure if they are right or wrong? If the former, I think I gots it.
If all the labels are definitely wrong, then -- like text -- I'm pretty sure I have the answer.
The labels are all wrong, not merely unknown. And the fact that you both went straight for that suggests that this was, perhaps, not the most fiendishly difficult possible puzzle.
But I found it satisfyingly neat.
minimum = 4 jelly beans.
maximum = "alot more"
1) Start with jar #1. Pull it out and note its color. Let's assume "red".
2) Jar #2. Pull it out and note it's color. Let's assume "blue".
3) Jar #3. Pull it out and note it's color. Let's assume red".
Then 2 is definitely blue jar and either 1 or 3 is mixed jar. Pull bean #4 from jar 3. If blue, then Jar #1 is red jar and Jar #3 is mixed jar and you're done.
But, if bean #4 was red, then we still don't know if jar 1 or 3 is mixed one or not. Proceed to alternate picking jelly beans from jar #1 and jar #3 until a blue is found. That jar is the mixed one and the other one is the red jar.
My thought was 1 jellybean only. Can I give my explanation?
Ahh, missed the "all" are labeled wrong part.
I spent a few minutes charting out the last step, became most wroth (wondrously wroth), gave up, read the clue in the jump, and only then got it. I agree, it is neat, even though I got it (if I got it) and do not usually have a good head for puzzles.
5 is wrong. I don't think anyone should spoil it yet.
I think we have consensus on not fiendishly difficult here. Jms, and the rest of you, are all right.
Where is Tia, anyway? I must have missed the announcement of her absence.
I assume hiatus is because her computer is broken.
Got it. And it matters which jar you draw out of first, right?
14: The wording of your question implies you have not yet found the optimal solution.
[snicker] They jes' don't teach logic like they use ta.
All labeled wrong = 2 jelly beans
Unknown whether labeled right or wrong = 4+ jelly beans
Whoops, I meant: all the jars are labeled wrong, not just unknown, and you're still wrong under that assumption.
8: I was in the same boat since "all are wrongly labelled" isn't phrased directly. [That the three are wrongly labelled could mean that they're collectively incorrect, i.e. that the Red jar is correct but the other two aren't; or that they've all been labelled "Green" or something like that.] On such subtleties can a problem turn -- viz. Monty Hall.
OK, I'm gonna kick myself when I see the answer, I just know it. Apparently, I'm missing some trickery going on.
TD, the labels are red, blue, and mixed, and they're all wrong. Imagine the labels were correct and then were switched.
"I was at a fair, and they were having a contest. It said, 'Guess how many jelly beans there are in the jar' and you win a prize. Ah c'mon, man, lemme just haaaave some. Tell you what, you guess how many I want. If you said a handful, you are right." —Mitch Hedberg
25 - that's what I did to deduce it could be done with just 2 and, in one special case, would take up to 3.
If all 3 jars are labelled incorrectly, then you only need pull one jellybean.
Pay attention to what Chopper said...
OK, this has been driving me batty. Is this riddle not about the jelly beans at all and rather about taking the words "to get the labels straight" literally? 'Cuz if it's about the jelly beans it takes 2-3!
Ha! I was just going to post that they didn't have to be clear, but I thought that was too leading.
32: There's no trick, other than the ambiguity in about what 'wrongly labelled' means. To make it perfectly explicit: One jar is labelled 'Red', one 'Blue' and one 'Mixed'. No label truly describes the contents of the jar.
If you even attempt to solve the puzzle, the solution presents itself. Seriously, just try and typoe out what you would do if you were standing in front of the jars trying to solve this, and you almost can't help but stumble over the answer.
Okay, I've got the answer, and I'm pretty sure I know why, but not quite how it works. Yet.
It's not like I'm supposed to be preparing for a meeting tomorrow or cleaning out my office, people.
> open door
The door is locked.
>unlock door
With what?
>unlock door with key.
Okay.
>go through door.
BANG! The door is closed.
It seems highly unlikely that you would know that all the labels are wrong without knowing the contents of the jars.
The Tyde's song Brock Landers is pretty sweet.
Okay, I'm going to think this out and I don't care if it gives it away.
Obviously the end result is you remove one bean from either red or blue and put it in mixed, which makes the mixed label accurate. I think.
But let's try it. So let's say you take a bean out of red. If it's red, you know that the jar you just took the bean out of is mixed (because by definition, it isn't red--which would make the label correct--and it obviously isn't blue, since the bean is red). If the bean is blue, then the red-labelled jar is either blue or mixed.
No wait, that doesn't work.
What if you take the bean out of mixed? You know this is *not* the mixed jar b/c that's the basic premise, that the jar is definitely mis-labelled. So if the bean is blue, then this is the blue jar. If the bean is red, this is the red jar. So far so good. You move whichever label accurately describes the color of the bean and remove the "mixed" label for now.
Then you have a properly labelled jar (either blue or red), an impropertly labelled jar (blue or red, whichever's left over), and an unlabelled jar. So. Since we know that the improperly labelled jar is improperly labelled, we just move the label on it to the unlabelled jar, put the "mixed" label on the remaining jar, pop the one jellybean we've had a look at into the jar (or eat it, whichever), and voila.
Right?
I still get 2-3, depending, if you start at either the "red" or "blue" jar. Although, if you head straight to the "mixed" jar, then you can get it in 1. But, the riddle doesn't ask for what is the minimum number of beans needed, only what is the number, which is ambiguous since it depends on what jar you go to first and what results.
Wait, I didn't read your comment to the end. Sorry.
TD, you already know the mixed label is wrong.
B is correct.
40, 41: Bingo.
43: But you can take a bean out of whichever jar you like, so you get to start with 'Mixed', which means the answer is one, for B.'s reasons.
That's what I get too, DrB, if you pull one from the mixed jar, it should be sufficient.
What do you do if the labels don't come off the jars? They usually don't, you know.
Also, now I want some jelly beans.
They're those bogus little ceramic decanter labels on little pewter chains that hand around the necks of the jars.
Also, now I want 16 and 37 explained. Is there some tidier way of reaching the solution that I'm not seeing?
If those meant more than "Honestly, anyone should get this at a glance," I don't know what it is.
Maybe this variation is not interesting (or already known?) to everyone else, but what about if the jars are just unlabeled?
Also, now I want some jelly beans.
See? See why it's better to use the sock-drawer example?
45, 46 - yeah, I get that. Pulling from the jar (incorrectly) labeled "mixed" will let you immediately deduce the correct labels. BUT, still, if you pull from a different jar first, the answer is different (2-3). The riddle is ambiguous and has different solutions.
I had this exact puzzle dropped on me during the "problem solving" chapter of an over-the-phone job interview. Had to solve it on the spot, while explaining my reasoning to my interviewers two-thousand miles away.
That was a memorable afternoon.
53 - if jars are unlabeled, I say >=4 jelly beans.
55: But that's not a reasonable ambiguity. If you don't get to choose which jar you're pulling from at all, then maybe you have to keep pulling from the 'Red' jar only -- in which case you never figure it out. To surmise that maybe the rules say you have to pull from a randomly chosen jar, and then a different jar, and then a different jar, you have to bring in a lot of rules that aren't stated in the problem.
Indeed, TD, but we're not after a minimum, we're after a maximum. How many would you have to take out to be sure?
TD, you're scrambling here. Clearly the goal is minimum number of beans. Just accept that you didn't figure it out, and move on.
OK, we're not really after a maximum. I don't know what I was thinking. A minimum that works in all cases, is what I should have said.
I like the maximum argument. It would require one to eat all but four of the jellybeans.
58 - valid points. Obviously, I read too much into the problem thinking you wanted to know the answer if drawn from "any" jar (of your choosing) first, not just what jar would yield the minimum and, more specificaly, what that minimum would be.
59 - I believe the maximum would be however many you had to draw until you found a different color to know which jar is, in fact, the mixed one plus one more out of one of the others; which isn't very interesting. So, I ammend my claim in 57 and say it would be >=3 (up to this number).
To imitate a broken record, the riddle doesn't ask how few draws you could do it in, it asks how few draws you could always do it in.
The answer to 53 is also simple and elegant, but it's also a much more common riddle, I am beginning to remember.
TD, you're scrambling here. Clearly the goal is minimum number of beans. Just accept that you didn't figure it out, and move on.
haha, I admit I didn't get the "right" answer right away. But, I did eventually (see 43 and 47). OK, I'll shut up now.
Hrm. On the 'unlabelled jars' puzzle: You draw one from each jar, and get two blues and a red. You know the red is from the 'Red' jar, but I don't see any elegant way to figure out which of the other two jars is 'Blue' and which is 'Mixed', other than drawing until you got another red or emptied the jar you were drawing from.
I was looking at the problem this way: "Decide how many beans you're going to take out of which jars, before you actually start doing anything, so that you will get the right answer no matter what." That's the computer programmer in me talking, I guess. That's also the only way you get a truly elegant answer to the unlabelled jar problem.
I think I must not understand the terms of the unlabelled jar problem, because I'd swear there's no elegant answer.
66 - that's what I say too, which would require >=4.
Another approach would be to draw 2 from one jar - and get lucky that one was red and the next one was blue - which would tell you this is the mixed jar. Then draw one more from either of the other jars to deduce which one is red vs blue jar. This method would require >=3 draws. BUT, is much less probable to actually work in a less number of draws than the above >=4 method because here you'd have to have been pretty lucky to find yourself picking from the mixed jar.
In either way, I don't see a fixed ceiling for the maximum, only the minimum.
If the jars are unlabelled, then it becomes less deductive, because you can't tell the difference between a "red" jar and a "mixed" jar that is all red with one blue bean until you dump both of them out.
I read the puzzle that way at first (unlabelled rather than wrongly labelled), and I decided that you had to take one from each of the jars at first. One would be red, and two would be blue...or one would be blue, and two would be red. That way you could identify either the red jar or the blue jar. But as for the other two jars, you couldn't tell which was which without just using brute force to take out one bean from each until you get a discordant pair.
As I understand it, if the jars are unlabelled, you'd have to completely empty two of them to make a conclusive determination. This is only in the strange case where you have to say which jellybeans you'd look at before looking at them. (Probably I was subconsciously copying some puzzle about drawing socks out of a drawer in a dark room, where it would be a more coherent restriction.)
71: Yes, I started going down that path at first too.
I'll rewrite the unlabeled-jars riddle as a dark-room riddle so it's less frustratingly vague:
Three jars of jellybeans are in a dark room; one is labelled 'red', one 'blue' and one 'mixed'. You can only go in and out once. How many jellybeans do you have take out with you to conclusively know which jar is which?
68: There isn't. I sent you an email to your hotmail account with some of this stuff in it (didn't want to spoil the thread), but it's easily provable that the worst-case scenario when all three jars are unlabelled is n+2 [not n+3 as I mistakenly wrote, I double-counted a bean], where n is the number of beans in the (relevant/maximal) jar.
72: No, only one of them. You can identify one of the three jars in 3 beans, but distinguishing between the other two requires emptying one of the remaining two.
73: That's a different puzzle than the one you started with. I think you'll need to take two complete jars in the worst-case scenario, at which point you can safely ignore the third, to solve this one.
Sheesh, wander off to make a little mango chutney and someone eats all the jelly beans...
76: Maybe you did it! Did you make the chutney with mango jellybeans?
77: Wait till you see what I'm doing with the grape-flavoured ones.
74: No you can't be sure you'll identify any of the jars in 3 beans, because the mixed jar may have only 1 bean of the second color. so you have to empty at least one jar completely, and if it's not the mixed jar, then you have to empty a 2nd jar completely. If the first jar is mixed, then obviously you only need to take 1 mor bean out of one of the other jars.
74 - you could identify one of the jars with just 2 beans - if you were lucky and pulled a red and a blue one right away you'd know you had the mixed jar. Then, you would just need to pull one more bean from either of the other jars (your pick) to deduce the 3rd jar. In this highly improbable scenario, it only requires 3 total jelly beans to know the complete answer.
But, I'd still stick with the pulling one bean from each jar first approach (see 66) because, while the minimum number of beans is higher, the expected number required would be lower.
Dr B's solution is the correct one for LB's parametres: Only one bean. The rest of you are just trying to rationalise eating more than your share of the jelly beans.
79 & 80: You can always identify one of the three jars with one bean from each jar. Assume WLOG that the beans show up RRB; the only way one can get two reds is if one of those came from the mixed jar, so the third jar must be the blue jar. [TD's right that you can do it in two if you're lucky, but that's as far as that goes.] The trick is to distinguish between the remaining two jars, which you know a priori are (in this instance) Red and Mixed, and there's no way of doing that in the worst-case scenario short of emptying one of the two jars.
As for the expectation... the expectation's probably going to be lower with your technique, yeah. Shouldn't be too hard to prove, I think, since there's probably straight-up domination for any breakdown of R/B in the mixed jar, but I'm too lazy to crunch the numbers :)
75: I'm confused, how is 73 different than what I stated in 67? (Or did you just mean different from the original terms of the riddle? It isn't, really, because you can solve the original riddle while assuming that you don't get to look at the beans in between picking them.)
83 - Yep, I think what you're describing is the ">=4 method", which I agree is the most rational course of action, depite there, technically, being an alternative ">=3 method" which is very much more riskier (but for not much more reward isn't worth it).
75: Ohhhhh, I missed your 67. My bad, I thought you were taking on the original three-unlabelled-jar problem. Yeah, that would be the nonadaptive variant -- nearly didn't remember the word, it's been a while -- which I think solves (worst-case scenario) in that fairly trivial way, i.e. take all the beans from two of the rooms. It's significantly worse than the adaptive version, at least worst-case [well n v. 2n]; I've no idea about expectation in this regard.
Crap, what with running back and forth to the kitchen, I missed the change to "unlabelled".
Wothehell, I'm going back to boiling canning jars...
Step 1: Place the jars in Tennesee.
Step 2: Head for an ice cream parlor.
Zero beans.
Take out the jars with a 2000-pound bomb and wait for the natives to greet you as a liberator with flowers and properly labeled jelly bean jars.
What about this: the jar which is marked "Mixed" must be either red or blue. So take a bean from it, and you will know what is the proper label for it. Say it was red. Now you have two jars, marked "red" and "blue", of which one is blue and one is mixed. The "blue" one cannot be blue, so it is mixed; and so the "red" one must be blue. If mutatis mutandis the "mixed" jar had been blue, then the "red" jar would have to be mixed and the "blue" jar red. So only one jellybean needs to be sampled Q.E.D.
I.e. what Bitch said in 40.
But more elegantly put.
Ok, for the three unlabelled jars, you take one from each: the odd-colored bean is from the jar containing only beans of its own color. Let's say that's red.
So you have two jars now, from each of which you've chosen a blue bean. Invert one jar, carefully, over the open mouth of the other jar (we are assuming the jars are exactly the same size), seal the join with some heavy-duty duct tape, pick up the jars fairly carefully (so as not to break the duct-tape seal) and shake the bejeezus out of those fuckers.
There. Now you have one red jar, and two mixed. Problem solved, and you've only removed three beans.
shake the bejeezus out of those fuckers
This. This should be the Democratic slogan in 2006.
Excellent! "Democratic party slogan consultant" goes on the CV too!
69: glass ceiling minimum s/b glass floor. No?
Umm..."glass" s/b "fixed". Heh. I was thinking about the jars?
96 - correct (i.e. fixed ceiling for the maximum, fixed floor for the minimum).
I've only been able to read as far as comment # 40-ish before totally combusting:
One! One! One! All you need is one!
(Ahem. Now I shall go back and continue reading.)
Okay, so clearly I only made it halfway through Dr. B's #40 before said combustion. But whatever; one.
The names of 100 prisoners are placed in 100 wooden boxes, one name to a box, and the boxes are lined up on a table in a room. One by one, the prisoners are led into the room; each may look in at most 50 boxes, but must leave the room exactly as he found it and is permitted no further communication with the others.
The prisoners have a chance to plot their strategy in advance, and they are going to need it, because unless every single prisoner finds his own name all will subsequently be executed. Find a strategy for them which which has probability of success exceeding 30%.
Answer I would never guess in a million years proved in a manner I don't fully understand here.
I saw that. Dude, if that had ever happened to me, and I was responsible for making the plan, we would all be so dead.
Can the prisoners differentiate between the boxes? The solution talks about labels but I don't see any provision for such in the problem.
The trick is to have all abandoned your slave names ahead of time, just in case, and all be called "X."
Oh yeah like they're going to remember what position on the table corresponds to what prisoner for all a hundred prisoners.
Optimal solution: examine zero jelly beans.
Pour the contents of the jars labeled "Red" and "Blue" into the jar labeled "Mixed." Done!
Trevor, 107 - but then the "Red" and "Blue" labels would still be wrong, because those jars would be empty.
Clownęsthesiologist, 91 - has the elegant solution, elegantly phrased. Shorter: Take one bean from the jar mislabelled "Mixed," relabel that jar accordingly, then move the other two labels so neither is on the same jar as when you came in.
But for practical reasons, I'd amend this to "take as many beans as you have the appetite for."