Wednesday, September 3, 2008

Mirror problem

Q: Imagine you are standing in front of a mirror, facing it. Raise your left hand. Raise your right hand. Look at your reflection. When you raise your left hand your reflection raises what appears to be his right hand. But when you tilt your head up, your reflection does too, and does not appear to tilt his/her head down. Why is it that the mirror appears to reverse left and right, but not up and down?

A: This is because human is left-right symmetric and with well defined up-down. Imagine a red cross is put in front of a mirror floating in outer space, the reflection can be interpreted either as fixed left-right, reversed up-down, or fixed up-down and reversed left-right.

Four women cross bridge

Q: There are 4 women who want to cross a bridge. They all begin on the same side. You have 17 minutes to get all of them across to the other side. It is night. There is one flashlight. A maximum of two people can cross at one time. Any party who crosses, either 1 or 2 people, must have the flashlight with them. The flashlight must be walked back and forth, it cannot be thrown, etc. Each woman walks at a different speed. A pair must walk together at the rate of the slower woman's pace.
Woman 1: 1 minute to cross
Woman 2: 2 minutes to cross
Woman 3: 5 minutes to cross
Woman 4: 10 minutes to cross
For example if Woman 1 and Woman 4 walk across first, 10 minutes have elapsed when they get to the other side of the bridge. If Woman 4 then returns with the flashlight, a total of 20 minutes have passed and you have failed the mission. What is the order required to get all women across in 17 minutes? Now, what's the other way?

A: The key of this question is that two people are allowed to cross the bridge in opposite direction, as long as one of them have the flashlight.
So, lets say four women are on side A initially, and they want to go to the side B of the bridge.
1. 1, 4 and flashlight: A->B, 10min
2. 1 and flashlight: B->A, 3: A->B, 5min
3. 1, 2 and flashlight: A->B, 2 min

Alternatively, switch the roles of 1 and 2, or switch 3 and 4.

measure 4 quarts water from 5 and 3 quart pails

Q: If you had an infinite supply of water and a 5 quart and 3 quart pail, how
would you measure exactly 4 quarts?

A: 1. Fill the 5 quart pail,
2. pour the water into the 3 quart pail,
3. empty the 3 quart pail
4. pour the 2 quart water remained to 3 quart pail
5. fill the 5 quart pail
6. pour the water into the 3 quart pail
7. the remaining water in the 5 quart pail is 4 quart

colored jelly beans

Q: You have a bucket of jelly beans. Some are red, some are blue, and some green. With your eyes closed, pick out 2 of a like color. How many do you have to grab to be sure you have 2 of the same?
A: since there are three different colors, we need to grab at least 3+1=4 beans to make sure 2 of them are same.

Red and Blue paint problem

Q:If you have two buckets, one with red paint and the other with blue paint, and you take one cup from the blue bucket and poor it into the red bucket. Then you take one cup from the red bucket and poor it into the blue bucket. Which bucket has the highest ratio between red and blue? Prove it
mathematically.

A: let the initial red and blue paint be V1, the cup size be Vc, and assume the bucket size Vb>V1+Vc, V1>>Vc, and the two paints are distributed uniformly in red bucket after the first pouring.
in red bucket, the ratio of red and blue is Rr = V1/Vc,
in blue bucket, the ration of blue and red is
Rb = ((V1-Vc) + Vc * Vc/(Vc+V1)) / (Vc*V1/(Vc+V1))
= V1/Vc
So the two buckets have the same ratio.

Monday, September 1, 2008

森林小屋冰箱题

Q:如果你有个森林小屋, 你每年去两次, 间隔六个月, 第一次带新鲜肉去放在冰箱冷冻室里, 假设因为可能性断电造成肉化冻而损坏, 你在第一次去安置什么样最简单/便宜的装置, 这样第二次去打开冰箱就知道肉已经是坏的了?

A: Put a piece of ice there. Check whether the ice is melt at the second visit.

Three questions on Expected number of three heads, steinmetz solid volume, and correlation

1. What is the expected minimum number of coin tosses needed to make in order to get 3 heads in a row?
A: let x be the expected number. Consider the first toss, it has 1/2 probability to be tail, in this case, the expected number would be x+1; if the first toss is head, and the second toss is tail, this would be a probability of 1/4, with expected number x+2; if the first three are head, this would be a probability of 1/8 with expected number 3; if the first three are head, head, tail, this would be a probability of 1/8 with expected number x+3. Therefore,
x = 1/2*(x+1) + 1/4*(x+2) + 1/8*(x+3) + 1/8*3
==> x = 14.

2. Suppose 2 cylinders each with radius 1 intersect at right angles and their centers also intersect. What is the volume of the intersection?
A: a calculus solution can be obtained, see:
http://mathworld.wolfram.com/SteinmetzSolid.html
Don't know how to obtain the result with non-calculus method.

3. If X,Y, Z are 3 random variables such that X and Y are 90% correlated, Y and Z are 80% correlated, what is the minimum correlation that X and Z could have?
A: Correlation is a similar to cosine relationship. Corr(x,y) = 0.9 ==> cos(theta1)= 0.9
corr(y,z) = 0.8 ==> cos(theta2) = 0.8
min(Corr(x,z)) = cos(theta1 + theta2)
= cos(theta1)cos(theta2) - sin(theta1)sin(theta2)
= 0.72 - sqrt(1-0.9*0.9)*sqrt(1-0.8*0.8)
= 0.72 - 0.2615
= 0.4585