ipython notebook illustrating a solution to a probability problem