Dynamic Programming in Python: Bayesian Blocks (2012) – http://jakevdp.github.io/blog/2012/09/12/dynamic-programming-in-python/