Source: https://icfp.51.pagesperso-orange.fr/docmaths/ch12exos.pdf