EQUILIBRIUM DISTRIBUTION OF THE INHERENT STATES AND THEIR DYNAMICS IN GLASSY SYSTEMS AND GRANULAR MEDIA