Many observables seen in intermediate energy heavy-ion collisions can be explained on the basis of statistical equilibrium. Calculations based on statistical equilibrium can be implemented in microcanonical ensemble, canonical ensemble or grand canonical ensemble. This paper deals with calculations with canonical and grand canonical ensembles. A recursive relation developed recently allows calculations with arbitrary precision for many nuclear problems. Calculations are done to study the nature of phase transition in nuclear matter.