I wrote a detailed blog entry about an interesting math problem and a  
Ruby program to work out the right strategy.

code:

http://curi.us/code/envelopes.html

blog entry:

http://www.curi.us/blog/2006/06/envelope-paradox.html

-- Elliot Temple
http://www.curi.us/blog/