Source: https://www2.bioch.ox.ac.uk/glycob/mark_wormald/lectures/basic_thermodynamics.pdf