identical balls. one ball is heavy. find the heavy ball with only 2 measurements ........ dead easy.

Suppose jar 1 is labelled lemon

jar 2 -> banana

jar 3 -> Mix

Take a candy from the jar 3 which is labelled as Mix of both and eat.

Suppose it is lemon, take the lemon label from the jar 1 and place it on jar 3. Now we are done. jar 2 will be mix, jar 1 banana from the fact that all jars have wrong labels.

Same logic goes in case it turns out to be banana candy after eating.

3 Split the 9 balls into three groups of 3 balls. 4 Choose two groups and weigh them on the balance: 5 If balanced, the heavy ball is in the other group. 6 If imbalanced, the heavy ball is in the heavier group. 7 Find the group with the heavy ball, pick two balls from the three and weigh them: 8 If balanced, the heavy ball is the other one. 9 If imbalanced, the heavy ball is the heavier one.http://www.careercup.com/question?id=5428361417457664

You have three jars filled with candies. One jar is filled with banana candies, one jar is filled with lemon candies and one jar has a mix of both. All the jars are mislabelled (i.e. all the jars have wrong labels about what kind of candies they contain). All the candies look very similar in shape, size and color and they even smell the same. The only way to distinguish them is by tasting. You have to eat one and only one candy to determine the correct jar labels. You can eat that one candy from any jar you want as long as you eat only one in total.

Suppose jar 1 is labelled lemon

jar 2 -> banana

jar 3 -> Mix

Take a candy from the jar 3 which is labelled as Mix of both and eat.

Suppose it is lemon, take the lemon label from the jar 1 and place it on jar 3. Now we are done. jar 2 will be mix, jar 1 banana from the fact that all jars have wrong labels.

Same logic goes in case it turns out to be banana candy after eating.

http://segmentfault.com/q/1010000003737940

一个岔路口分别通向诚实国和说谎国，来了两个人，一个说真话一个说假话，我们不知道哪个说真话哪个说假话，现在要去诚实国，问两个人，请问怎么问才能到诚实国。

方法当然是问其中一个人，这条路是去诚实国的吗，然后问第二个人，根据他得回答分析。

这个不时重点，重点是题目要用编程中的逻辑运算表达式解释原因？这该如何用逻辑运算表达式解释原因呢？

这个不时重点，重点是题目要用编程中的逻辑运算表达式解释原因？这该如何用逻辑运算表达式解释原因呢？

```
var a = Math.random() < 0.5;
var b = !a;
```

这时候不知道

`a`

和 `b`

哪个是真哪个是假，但是一定知道 `a && b`

是假，`a || b`

是真。
联合两个人的说话，向 b 问：如果我问 a 这条路是否通向诚实图，他会怎么回答？

不管谁回答的是假话，这个综合的结果都一定是假的。