Ok..
Here is a simple one
You have two cans of 5 and 7 liters ...how will u measure 11 litrs using only these and no other ..
Printable View
Ok..
Here is a simple one
You have two cans of 5 and 7 liters ...how will u measure 11 litrs using only these and no other ..
- First, fill the 7 liter can up to the top and pour it into the big bucket.
Result: 7- Fill the 7 liter can up again, and from there, put as much fluid as you can into the 5 liter can. You will have two liters left in the 7 liter can. Pour these into the big bucket.
Result: 9- Repeat step 2.
Result: 11
VoidSpace, I just give you an advice like this, you should go home looka t yourself in the mirror, you see, you just a little 2month old lion and how about YvesM, see his face, shining bright like a star in codeguru forum...How could you make such an easy, simple question for a $m@rt super moderator like that...?Quote:
Originally posted by voidspace
Ok..
Here is a simple one
You have two cans of 5 and 7 liters ...how will u measure 11 litrs using only these and no other ..
YvesM, you are so great, your answer s soooo smart... I really admire your talent, I wish I was born to be sm@rt like you...:)
another simple one...
1)you have two empty container one is 5lb another is 3 lb
2)how do u fill your 5lb container with exactly 4 lb of water?
- Fill the 3lb container with 3 lb, pour it into the 5lb container. Fill the 3 lb container again with 3 lb, and pour as much as you can (2 lb) into the 5 lb container.
Result 5lb is full, 3lb contains 1 lb- Discard the contents of the 5lb container and pour the 1lb from the 3lb container into the 5lb container.
Result: 5lb contains 1 lb, 3lb is empty- fill the 3lb container fully up and pour its contents into the 5lb container.
Result: 5lb contains 4lb, 3lb is empty.
ON MY FACE:(
well anyway...cool Mr.Yves...didn't see that comin...
BTW: this puzzle is from die hard 3..:D
Yves ...is officially the container king ..LOL..ur turn
I don't know if this one has been posted yet, but it's a pretty hard one.
100 american tourists get captured by cannibals. Of course they get the token chance to go free if they pass a certain test. The test in this instance is the following: each one will recieve a hat that's either blue, red or white. They will be put into a big circle, so that everyone can see all the hats, except their own hat. Then the chief will go around asking people at random which color their hat is. If the person answers correctly, then that person goes free.
The question is, with which strategy can you save the maximum number of people ?
P.S. When the cchief asks them which color theeir hat is, they can only answer "red", "blue" or "white". They are not allowed to talk to each other while being in the circle.
P.P.S Before being rounded up, they have one hour to decide on the best common strategy that will save the most of them.
tough one...
how ever i dont get thisQuote:
They will be put into a big circle, so that everyone can see all the hats, except their own hat.
It means that each person can see the 99 other people and their hats. They can't see their own hats though.
Well assuming all the people can have the same plan in mind before-hand, each person should name the color of the hat on the person to their left (or any other known position). If the person to their left already knows their hat color, you say the next person who doesn't know.
Each time a person is asked, some other person is saved. Even in the unlikely event that 50 people are asked and they all get it wrong, the remaining 50 people survive. More likely, 2/3 of those 50 people will die, about 34, leaving 66 still standing who have either been asked and got it right or already know.
The tricky part is remembering who knows their hat color!
Yes, they can elaborate a common plan together before the "event", so your answer is perfectly valid.
Without doing much statistical analysis, I think with your solution you would save in the mean 50% of the people. The thing with your solution is that in the worst case, only one person is saved. The chief just always asks the person to the right of the last one.
By the way, there are ways to get more people saved ;)
No, even that way, 50 people would be saved. Imagine the people are numbered 1 to 100 in order counter-clockwise in an aerial view, so that when the "chief" is going to the right he is going 1, 2, 3, etc. p1 says p100's color. p2 says p99's color. Etc., then by the time numbers 1-50 are killed, all of 51-100 know their colors.Quote:
Originally posted by Yves M
Yes, they can elaborate a common plan together before the "event", so your answer is perfectly valid.
Without doing much statistical analysis, I think with your solution you would save in the mean 50% of the people. The thing with your solution is that in the worst case, only one person is saved. The chief just always asks the person to the right of the last one.
By the way, there are ways to get more people saved ;)
They choose one leader to direct people by hand signals (without talking of coarse) where they should go in the circle. That leader will sort out everyone by their hat color. Then the leader will go from group to group until the people nod that he's in the correct group. Then anyone the leader asks will be able to look at the group they are in and realize which hat they wear. ;) Of coarse I assume that this will not be a valid answer.
- Kevin
What it boils down to is how much interpretable data can be transmitted each time a person is asked. Therefore I ask, does the color named have to be only Red, White, and Blue? (In real life they could name any color, sacrificing their own lives to save more)Quote:
Originally posted by Yves M
By the way, there are ways to get more people saved ;)
I'm also assuming that the information is limited to the utterance of the name of a color, and does not include other possible factors such as who the person is looking at before, during, and after the color is named.
You are right !Quote:
Originally posted by KevinHall
They choose one leader to direct people by hand signals (without talking of coarse) where they should go in the circle. That leader will sort out everyone by their hat color. Then the leader will go from group to group until the people nod that he's in the correct group. Then anyone the leader asks will be able to look at the group they are in and realize which hat they wear. ;) Of coarse I assume that this will not be a valid answer.
- Kevin
It's not a valid answer indeed ;)
Let me put it this way:Quote:
Originally posted by solarflare
What it boils down to is how much interpretable data can be transmitted each time a person is asked. Therefore I ask, does the color named have to be only Red, White, and Blue? (In real life they could name any color, sacrificing their own lives to save more)
I'm also assuming that the information is limited to the utterance of the name of a color, and does not include other possible factors such as who the person is looking at before, during, and after the color is named.
- If they communicate using hand-gestures, twiching in the eyes, wiggling their feet or anything like that, everyone gets killed.
- If the person who is currently questioned by the chief responds something else than "red", "blue" or "white", they all get killed.
What I mean is, there are always variables the terrorists cannot control, such as intonation, volume, exact time before speaking, etc. Is this to be taken out of the real world so that the only thing that matters is the color named?Quote:
Originally posted by Yves M
Let me put it this way:
- If they communicate using hand-gestures, twiching in the eyes, wiggling their feet or anything like that, everyone gets killed.
- If the person who is currently questioned by the chief responds something else than "red", "blue" or "white", they all get killed.
does this not mean they can talk?...Quote:
[i]
P.P.S Before being rounded up, they have one hour to decide on the best common strategy that will save the most of them.
Can they communicate in anyway?
What is the ratio of reds hats: Blue hats: Green hats ?? Or can there be just 100 white hats even
Because any person can see 99 hat colors
If he uses ration and proportion on the avaiable hats like below
He would count how many colors of each are present.
say he finds 33 Reds 32 Blue and 34 White ... he would say "blue" and survive.
The only time he would have a problem in ansering is when the count is 33 R 33 B 33 W. He can have any color so his chances of survival that time are 1/3.
Ok! this is also an invalid answer I suppose :D
Maybe I'm misunderstanding solarflare's answer, but I can't see why every other person can't name the color of the hat of the next person, and that next person can use the name said by the previous person. At least 50 people get saved, and most likely the number saved will be around 67, since about a third of the people assisting their neighbor will be correct as well. That's how I read solarflare's answer...
Or... continuing voidspace's idea...
If the distribution is not known, but the people can see the hats before hand (in that pile by the big hut), they can just count the number of each color. Then, counting the number of each color they can see, they can always figure out which color is missing and must be on their head. Then you have 100% saved!
There is another solution, which saves all hundred people: get lucky. Although if you're kidnapped by terrorists, you're probably not lucky, so that idea's out.
Take it as an abstract question, so the only thing that matters is the color they say.Quote:
What I mean is, there are always variables the terrorists cannot control, such as intonation, volume, exact time before speaking, etc. Is this to be taken out of the real world so that the only thing that matters is the color named?
They don't have a clue about that before being put into the circle. So when they are thinking about their strategy, they don't know the distribution of hat colors. They also never see the hats all together in a big pile.Quote:
voidspace
What is the ratio of reds hats: Blue hats: Green hats ?? Or can there be just 100 white hats even
galathaea
If the distribution is not known, but the people can see the hats before hand (in that pile by the big hut), they can just count the number of each color. Then, counting the number of each color they can see, they can always figure out which color is missing and must be on their head. Then you have 100% saved!
That doesn't work, because the next person to be asked is picked at random by the canibal chief.Quote:
Maybe I'm misunderstanding solarflare's answer, but I can't see why every other person can't name the color of the hat of the next person, and that next person can use the name said by the previous person. At least 50 people get saved, and most likely the number saved will be around 67, since about a third of the people assisting their neighbor will be correct as well.
The last one works if some ones that already knows his hat color just says this color (saves himself). It means that half the persons asked will give the color of someone else's hat, this person being the next one this left that doesn't know and haven't been asked yet. This saves at least 50%Quote:
Originally posted by Yves M
That doesn't work, because the next person to be asked is picked at random by the canibal chief.
Then, the theory says that there is an average of 33% saved among the other persons, meaning the at least 50% will be saved, at most 100% (if all have the same color) and and average of 66.66%.
Then if there is a better solution....
That's basically the same answer as solarflare's with the neighbours.
But you can save more people ;)
I know it's the same. You just said it didn't work. It does work, even if it is not the best answer.
Ok, this is getting confusing ^^ galathea's answer is not the same as yours, since he says "the next person" and "the previous person", which I take to mean the next person to be asked and the previous person to be asked. This strategy is impossible, since you don't know who will be asked next.
Your answer is relying on "the person next to another person on the left". That means this strategy is viable.
[rambling aimlessly]
Obviously you can describe the group more efficiently than 100 individuals. The number of possible combinations or R/B/W hats is 5151, which can be described in 8 3-bits. (i.e. 3^8>5151)
The problem with this is, how can people who don't know their hats describe the group? Just as there are 3 possible hats for a person, there are 3 possible sets for each person (a set being the percentage of R, B, and W hats in the 100).
[/rambling aimlessly]
[actual solution]
Okay how about this. The first person asked counts the number of red hats he sees. He says "red" if there is an even number and "blue" if there is an odd number. Now everyone knows exactly how many red hats there are!
The second person does the same for blue hats.
98 people are saved!! Yay!! (with 2 people having a 1/3 chance of living as well)
[/actual solution]
[edit: I probably wasn't really clear on this so I'll say it again]
The first person asked counts the number of red hats he sees. He says "red" if there is an even number and "blue" if there is an odd number.
The second person does the same for blue hats.
Then the next person asked, whomever that may be, counts red hats disregarding the hat color of the first person. If his count disagrees (first person said odd and he sees even, or vice versa), then he must be wearing a red hat. The same thing is done using blue hats and the second person's count. Finally, if both of these counts agree, then the person must be wearing a white hat. And that's how the other
98 people are saved!! Yay!! (with 2 people having a 1/3 chance of living as well)
You are getting VERY close to the best possible solution solar :) Just a little bit more effort ;)
The hint is that an answer is a tri-state, but you are only exploiting a two-state for the moment.
You are suggesting that there is a way for the first person to save everybody... I will have to think about this ;).Quote:
Originally posted by Yves M
You are getting VERY close to the best possible solution solar :) Just a little bit more effort ;)
The hint is that an answer is a tri-state, but you are only exploiting a two-state for the moment.
I suppose it seems instinctively theoretically possible.
How about taking [abs(red-blue)%3]? I think that would do it.
No, abs() wouldn't work if red or blue doesn't have the clear numerical majority. So calculate red-blue, then add or subtract 3 enough times to get to 0, 1, or 2. (="R", "W", "B")
You are so close, it's steaming ;)Quote:
Originally posted by solarflare No, abs() wouldn't work if red or blue doesn't have the clear numerical majority. So calculate red-blue, then add or subtract 3 enough times to get to 0, 1, or 2. (="R", "W", "B")
I give up, there is no solution :p.
That would probably bother you more than me ;)!
But I think my latest idea would work, I just didn't describe it well enough. The first person is able to say whether the difference between the number of red hats and blue hats is a multiple of three or one more or one less.
Assuming it's a multiple of three, then the second person seeing the same difference among the 98 people (excluding himself and the first person) has a white hat. If it's one more then he has a blue hat, and if it's one less he has a red hat. The same argument works for when the original number is one more or one less than a multiple of three, but with a shift.
solarflare... think about the first guy and continue your idea... if its even say one color, but if its odd, you still have two choices that can signal the others... so use those two colors to do what the second person would do...
But that doesn't work, because if the number is even, you lose the opportunity to transmit that extra bit of information.
Does that mean you know the answer, galathaea ? If you don't want to put it on the thread, you can PM me ;)Quote:
Originally posted by galathaea
solarflare... think about the first guy and continue your idea... if its even say one color, but if its odd, you still have two choices that can signal the others... so use those two colors to do what the second person would do...
I thought I saw the answer with my post, but wanted solarflare to make the final connections (since he had done all the hard work of moving it to that case of 98 saved minimum -- which was pure brilliance if you ask me). However, solarflare seemed to capture the problem that I had overlooked. The only option to overcome that issue is if the first person is really able to make a true sacrifice and say a non-existant color (say yellow) which is an immediate death but allows for the extra bit of communication needed to save at least 99.
Since an odd number of hats are seen, there are four possibilities of parity to transmit that sum to an odd number.
odd + even + even (and the two other permutations)
odd + odd + odd
label the first three with the color that is odd, and the fourth with the alternate color...
but I don't know if that is what is being asked for...
Continuing on what Gal said ..
Let
Red B W
...................................................
(odd + 1 ) + even + even = 100
(even + 1) + even + odd = 100
(even + 1) + odd + even = 100
(odd + 1 ) + odd + odd = 100
say he falls into case row 1:
He saw odd number of reds, even number of blue and even number of white ... then he needs to say Red.
Is there a problem with this approach?
Yes, if he sees 33 each red, blue, and white hats.Quote:
Originally posted by voidspace
Continuing on what Gal said ..
Let
Red B W
...................................................
(odd + 1 ) + even + even = 100
(even + 1) + even + odd = 100
(even + 1) + odd + even = 100
(odd + 1 ) + odd + odd = 100
say he falls into case row 1:
He saw odd number of reds, even number of blue and even number of white ... then he needs to say Red.
Is there a problem with this approach?
Yves, can you tell me what's wrong with my answer?
There is nothing wrong with it, but you can save one more person.Quote:
Originally posted by solarflare
Yves, can you tell me what's wrong with my answer?
The best possible solution saves 99.33 people. It is fairly close to what you have proposed.
If he says anything else than "red", "blue" or "white", they all die, so "yellow" is not an option.Quote:
say a non-existant color (say yellow) which is an immediate death but allows for the extra bit of communication needed to save at least 99.
As a hint, don't think about parity, but about a tri-state, since both the answer and the number of hat colors have three possible values.
But this saves 99(.33) people:
Quote:
Originally posted by solarflare
But I think my latest idea would work, I just didn't describe it well enough. The first person is able to say whether the difference between the number of red hats and blue hats is a multiple of three or one more or one less.
Assuming it's a multiple of three, then the second person seeing the same difference among the 98 people (excluding himself and the first person) has a white hat. If it's one more then he has a blue hat, and if it's one less he has a red hat. The same argument works for when the original number is one more or one less than a multiple of three, but with a shift.
Once the answer is ackl...could some please explain it clearly Maybe with pictures ..
ARg, you are of course right :) I just skimmed that post and didn't realize that you did post the answer :)Quote:
Originally posted by solarflare
But this saves 99(.33) people:
Congratulations.
good job ..solarflare ... amazing thinking
So when we're talking about canibals ;) I have a new one :p
Canibals capture two men and tell them that they are going to be eaten, but also given a chance to escape. Both men are going to be told each a number A and B, (B=A+1) (1<=A<B<=10). Each has to guess the other's number. Each has the right to say no more than 3 times "I don know your number", one time "Your number is..." and nothing else. The canibals will point one of them to begin. What must be the two men's strategy so they would guess each-other's numbers with the phrase "Your number is...", and thus escape?
oops! forgot to mention :rolleyes:
One cannot say two things in a row, they must take turns.
Its just iterating out the possibilities. If the first person has 1 or 10, then they know the other person's number is 2 or 9 respectively. Otherwise, if the first person has neither 1 nor 10, they say "I don't know your number". Then the second person knows the first has neither 1 nor 10, so if they have 2 or 9, they know the other has 3 or 8 respectively. Otherwise, they say they don't know either. Widdling down the choices the possibilities are:
First: 1, 10
Second: 2, 9
First: 3, 8
Second: 4, 7
First: 5, 6
and that's it. Somewhere along the line, one of the two will have one of the options for their turn and know the other's number. In a worst case, both people will have said that they didn't know the other's number twice (the last step possible will always have the First asked knowing the result). So the option for 3 dont-knows is one too many!
Without a calculator or computer (in other words just using algebra and/or calculus) prove that
pi^e > e^pi
Or "pi raised to the power of e is less than e raised to the power of pi"
claim: x^e < e^x for all x > e.
since ln(x) is strictly increasing on the interval (0,infinity) and so
on the interval (e,inifinity) it is enough to show that
eln(x) < x for all x > e.
consider f(x) = x - eln(x)
f(e) = 0;
f'(x) = 1 - e/x which is positive when x > e and so f(x) is
increasing on the interval [e,infinty) .
The result proven
If the pi is partially eaten (represented by pi prime), however, pi'<e, thus the solution does not hold.