Lecture 04 - Helmholtz free energy and the partition function