  Ensembles of random density matrices determined by various probability
measures are analysed. A simple and efficient algorithm to generate at random
density matrices distributed according to the Bures measure is proposed. This
procedure may serve as an initial step in performing Bayesian approach to
quantum state estimation based on the Bures prior. We study the distribution of
purity of random mixed states. The moments of the distribution of purity are
determined for quantum states generated with respect to the Bures measure. This
calculation serves as an exemplary application of the "deform-and-study"
approach based on ideas of integrability theory. It is shown that Painlev\'e
equation appeared as a part of the presented theory.
