The Thermodynamics Of Risk