Source: https://www.math.univ-toulouse.fr/~msablik/Cours/MathDiscretes/2018-2019-MathDiscretes-TD2-Langages.pdf