FUNDAMENTALS OF STATISTICAL AND THERMAL PHYSICS