Source: http://www.ac-grenoble.fr/maths/PM/Ressources/661/LivretAutomatisme.pdf