Fundamentals of statistical andf thermal physics