Thursday, January 8, 2009

Stairs and Ramp

Is the energy spent climbing  stairs different from a ramp, even though both accomplish the same task of transporting cross two points.

In a stair you bring yourself up a stair height and then stop and re-do the climbing process. So your momentum starts from zero and ends at zero at zero for each climb (perhaps you have very little residual momentum at the end of each climb). In a ramp, you are more "walking" than just climbing, so carry a forward momentum. Does this help climb better? 

Thursday, November 6, 2008


Wall Street Journal has a very interesting article on tipping today. They ask the question

Why do we give a $2 tip to the waitress in the coffee shop who brings us eggs and refills our coffee cup four times, and a $20 tip to the waiter who pops open a $100 bottle of wine?
The article mentions a reader who goes out for breakfast with friends regularly.
The tab is always between $20 and $30, and they generally leave $10. That's a tip of between 33% and 50%, pretty much off the scales. But looked at another way, $10 to provide great service for four guys doesn't seem so extravagant.

"What do we get in return?," wrote the reader. "Our table is all set when we arrive at exactly 7 a.m., including the right coffee and tea cups. My V8 juice stands proudly on the table with ice in it (to keep it cold, in case we are a bit late), etc.
The article does not mention that we go probably twice (or more) as often to a place where we spend $30 per visit than to a place where we spend $60 per visit. So in total the tip we give out is probably spread more evenly than we imagine. It might be in your best "interest" to tip higher percentage in the places you visit often and less in the places your don't frequent often.

Thursday, October 16, 2008

random permutations

1. Get 10 random numbers between 0 and 1 using the rand function
2. sort them in decreasing (or increasing) order
3. assign to each number its rank
4. replace in the original list, the random numbers by their ranks

Now you have a random permutation, where every permutation is equally likely.