examples for the lectures at https://class.coursera.org/progfun-004